From ba31496ec11ec48cc2c4f564fe054984ce614657 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Sun, 12 Dec 2021 14:11:05 +0100 Subject: deploy-rs, zfs: ... --- accounts/gkleen@sif/ssh-hosts.nix | 3 +++ flake.lock | 55 +++++++++++++++++++++++++++++++++++++++ flake.nix | 22 ++++++++++++++-- overlays/zfs.nix | 11 -------- shell.nix | 3 ++- 5 files changed, 80 insertions(+), 14 deletions(-) delete mode 100644 overlays/zfs.nix diff --git a/accounts/gkleen@sif/ssh-hosts.nix b/accounts/gkleen@sif/ssh-hosts.nix index cd4c0c2d..f32ac91a 100644 --- a/accounts/gkleen@sif/ssh-hosts.nix +++ b/accounts/gkleen@sif/ssh-hosts.nix @@ -257,6 +257,9 @@ { hostname = "vidhar.yggdrasil"; identityFile = "~/.ssh/gkleen@sif.midgard.yggdrasil"; }; + "sif" = + { identityFile = "~/.ssh/gkleen@sif.midgard.yggdrasil"; + }; "unison.vidhar" = { hostname = "vidhar.yggdrasil"; identityFile = "~/.ssh/unison.gkleen@vidhar.yggdrasil"; diff --git a/flake.lock b/flake.lock index 7c3fbf68..e8ecf477 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,44 @@ { "nodes": { + "deploy-rs": { + "inputs": { + "flake-compat": "flake-compat", + "nixpkgs": [ + "nixpkgs" + ], + "utils": "utils" + }, + "locked": { + "lastModified": 1638665590, + "narHash": "sha256-nhtfL3z4TizWHemyZvgLvq11FhYX5Ya4ke+t6Np5PKQ=", + "owner": "serokell", + "repo": "deploy-rs", + "rev": "715e92a13018bc1745fb680b5860af0c5641026a", + "type": "github" + }, + "original": { + "owner": "serokell", + "ref": "master", + "repo": "deploy-rs", + "type": "github" + } + }, + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1627913399, + "narHash": "sha256-hY8g6H2KFL8ownSiFeMOjwPC8P0ueXpCVEbxgda3pko=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "12c64ca55c1014cdc1b16ed5a804aa8576601ff2", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, "home-manager": { "inputs": { "nixpkgs": [ @@ -39,6 +78,7 @@ }, "root": { "inputs": { + "deploy-rs": "deploy-rs", "home-manager": "home-manager", "nixpkgs": "nixpkgs", "sops-nix": "sops-nix" @@ -64,6 +104,21 @@ "repo": "sops-nix", "type": "github" } + }, + "utils": { + "locked": { + "lastModified": 1631561581, + "narHash": "sha256-3VQMV5zvxaVLvqqUrNz3iJelLw30mIVSfZmAaauM3dA=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "7e5bf3925f6fbdfaf50a2a7ca0be2879c4261d19", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index bb3c45c5..768f19bd 100644 --- a/flake.nix +++ b/flake.nix @@ -22,9 +22,16 @@ ref = "master"; inputs.nixpkgs.follows = "nixpkgs"; }; + deploy-rs = { + type = "github"; + owner = "serokell"; + repo = "deploy-rs"; + ref = "master"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; - outputs = { self, nixpkgs, home-manager, sops-nix, ... }@inputs: + outputs = { self, nixpkgs, home-manager, sops-nix, deploy-rs, ... }@inputs: let inherit (builtins) attrNames attrValues elemAt toJSON isNull pathExists; inherit (nixpkgs) lib; @@ -157,11 +164,22 @@ apps = activateNixosConfigurations; - devShell = forAllSystems (system: systemPkgs: import ./shell.nix { pkgs = self.legacyPackages.${system}; }); + devShell = forAllSystems (system: systemPkgs: import ./shell.nix { pkgs = self.legacyPackages.${system}; deploy-rs = deploy-rs.defaultPackage.${system}; }); defaultTemplate = { path = ./.; description = "GKleen's flakey nixos configuration"; }; + + deploy.nodes = mapAttrs (hostname: _: { + inherit hostname; + sshUser = "root"; + + profiles.system = { + path = deploy-rs.lib.${self.nixosConfigurations.${hostname}.config.nixpkgs.system}.activate.nixos self.nixosConfigurations.${hostname}; + }; + }) (nixImport { dir = ./hosts; _import = (_path: name: name); }); + + checks = builtins.mapAttrs (system: deployLib: deployLib.deployChecks self.deploy) deploy-rs.lib; }; } diff --git a/overlays/zfs.nix b/overlays/zfs.nix deleted file mode 100644 index a76becff..00000000 --- a/overlays/zfs.nix +++ /dev/null @@ -1,11 +0,0 @@ -final: prev: { - linuxPackages_5_15 = prev.linuxPackages_latest.extend (self: super: { - zfsUnstable = prev.zfsUnstable.overrideAttrs (oldAttrs: { - meta = oldAttrs.meta // (assert (oldAttrs.src.outputHash == "sha256-UUuJa5w/GsEvsgH/BnXFsP/dsOt9wwmPqKzDxLPrhiY="); rec { - broken = !(self.kernel.kernelAtLeast "3.10" && self.kernel.kernelOlder "5.16"); - latestCompatibleLinuxPackages = final.linuxPackages_5_15; - }); - }); - }); - linuxPackages_latest = final.linuxPackages_5_15; -} diff --git a/shell.nix b/shell.nix index aef46c67..e0574ac4 100644 --- a/shell.nix +++ b/shell.nix @@ -1,4 +1,4 @@ -{ pkgs ? import {} }: +{ pkgs ? import {}, deploy-rs }: let nixWithFlakes = pkgs.symlinkJoin { name = "nix-with-flakes"; @@ -16,5 +16,6 @@ in pkgs.mkShell { wireguard gup nftables + deploy-rs ]; } -- cgit v1.2.3