summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--accounts/gkleen@sif/ssh-hosts.nix3
-rw-r--r--flake.lock55
-rw-r--r--flake.nix22
-rw-r--r--overlays/zfs.nix11
-rw-r--r--shell.nix3
5 files changed, 80 insertions, 14 deletions
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 @@
257 { hostname = "vidhar.yggdrasil"; 257 { hostname = "vidhar.yggdrasil";
258 identityFile = "~/.ssh/gkleen@sif.midgard.yggdrasil"; 258 identityFile = "~/.ssh/gkleen@sif.midgard.yggdrasil";
259 }; 259 };
260 "sif" =
261 { identityFile = "~/.ssh/gkleen@sif.midgard.yggdrasil";
262 };
260 "unison.vidhar" = 263 "unison.vidhar" =
261 { hostname = "vidhar.yggdrasil"; 264 { hostname = "vidhar.yggdrasil";
262 identityFile = "~/.ssh/unison.gkleen@vidhar.yggdrasil"; 265 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 @@
1{ 1{
2 "nodes": { 2 "nodes": {
3 "deploy-rs": {
4 "inputs": {
5 "flake-compat": "flake-compat",
6 "nixpkgs": [
7 "nixpkgs"
8 ],
9 "utils": "utils"
10 },
11 "locked": {
12 "lastModified": 1638665590,
13 "narHash": "sha256-nhtfL3z4TizWHemyZvgLvq11FhYX5Ya4ke+t6Np5PKQ=",
14 "owner": "serokell",
15 "repo": "deploy-rs",
16 "rev": "715e92a13018bc1745fb680b5860af0c5641026a",
17 "type": "github"
18 },
19 "original": {
20 "owner": "serokell",
21 "ref": "master",
22 "repo": "deploy-rs",
23 "type": "github"
24 }
25 },
26 "flake-compat": {
27 "flake": false,
28 "locked": {
29 "lastModified": 1627913399,
30 "narHash": "sha256-hY8g6H2KFL8ownSiFeMOjwPC8P0ueXpCVEbxgda3pko=",
31 "owner": "edolstra",
32 "repo": "flake-compat",
33 "rev": "12c64ca55c1014cdc1b16ed5a804aa8576601ff2",
34 "type": "github"
35 },
36 "original": {
37 "owner": "edolstra",
38 "repo": "flake-compat",
39 "type": "github"
40 }
41 },
3 "home-manager": { 42 "home-manager": {
4 "inputs": { 43 "inputs": {
5 "nixpkgs": [ 44 "nixpkgs": [
@@ -39,6 +78,7 @@
39 }, 78 },
40 "root": { 79 "root": {
41 "inputs": { 80 "inputs": {
81 "deploy-rs": "deploy-rs",
42 "home-manager": "home-manager", 82 "home-manager": "home-manager",
43 "nixpkgs": "nixpkgs", 83 "nixpkgs": "nixpkgs",
44 "sops-nix": "sops-nix" 84 "sops-nix": "sops-nix"
@@ -64,6 +104,21 @@
64 "repo": "sops-nix", 104 "repo": "sops-nix",
65 "type": "github" 105 "type": "github"
66 } 106 }
107 },
108 "utils": {
109 "locked": {
110 "lastModified": 1631561581,
111 "narHash": "sha256-3VQMV5zvxaVLvqqUrNz3iJelLw30mIVSfZmAaauM3dA=",
112 "owner": "numtide",
113 "repo": "flake-utils",
114 "rev": "7e5bf3925f6fbdfaf50a2a7ca0be2879c4261d19",
115 "type": "github"
116 },
117 "original": {
118 "owner": "numtide",
119 "repo": "flake-utils",
120 "type": "github"
121 }
67 } 122 }
68 }, 123 },
69 "root": "root", 124 "root": "root",
diff --git a/flake.nix b/flake.nix
index bb3c45c5..768f19bd 100644
--- a/flake.nix
+++ b/flake.nix
@@ -22,9 +22,16 @@
22 ref = "master"; 22 ref = "master";
23 inputs.nixpkgs.follows = "nixpkgs"; 23 inputs.nixpkgs.follows = "nixpkgs";
24 }; 24 };
25 deploy-rs = {
26 type = "github";
27 owner = "serokell";
28 repo = "deploy-rs";
29 ref = "master";
30 inputs.nixpkgs.follows = "nixpkgs";
31 };
25 }; 32 };
26 33
27 outputs = { self, nixpkgs, home-manager, sops-nix, ... }@inputs: 34 outputs = { self, nixpkgs, home-manager, sops-nix, deploy-rs, ... }@inputs:
28 let 35 let
29 inherit (builtins) attrNames attrValues elemAt toJSON isNull pathExists; 36 inherit (builtins) attrNames attrValues elemAt toJSON isNull pathExists;
30 inherit (nixpkgs) lib; 37 inherit (nixpkgs) lib;
@@ -157,11 +164,22 @@
157 164
158 apps = activateNixosConfigurations; 165 apps = activateNixosConfigurations;
159 166
160 devShell = forAllSystems (system: systemPkgs: import ./shell.nix { pkgs = self.legacyPackages.${system}; }); 167 devShell = forAllSystems (system: systemPkgs: import ./shell.nix { pkgs = self.legacyPackages.${system}; deploy-rs = deploy-rs.defaultPackage.${system}; });
161 168
162 defaultTemplate = { 169 defaultTemplate = {
163 path = ./.; 170 path = ./.;
164 description = "GKleen's flakey nixos configuration"; 171 description = "GKleen's flakey nixos configuration";
165 }; 172 };
173
174 deploy.nodes = mapAttrs (hostname: _: {
175 inherit hostname;
176 sshUser = "root";
177
178 profiles.system = {
179 path = deploy-rs.lib.${self.nixosConfigurations.${hostname}.config.nixpkgs.system}.activate.nixos self.nixosConfigurations.${hostname};
180 };
181 }) (nixImport { dir = ./hosts; _import = (_path: name: name); });
182
183 checks = builtins.mapAttrs (system: deployLib: deployLib.deployChecks self.deploy) deploy-rs.lib;
166 }; 184 };
167} 185}
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 @@
1final: prev: {
2 linuxPackages_5_15 = prev.linuxPackages_latest.extend (self: super: {
3 zfsUnstable = prev.zfsUnstable.overrideAttrs (oldAttrs: {
4 meta = oldAttrs.meta // (assert (oldAttrs.src.outputHash == "sha256-UUuJa5w/GsEvsgH/BnXFsP/dsOt9wwmPqKzDxLPrhiY="); rec {
5 broken = !(self.kernel.kernelAtLeast "3.10" && self.kernel.kernelOlder "5.16");
6 latestCompatibleLinuxPackages = final.linuxPackages_5_15;
7 });
8 });
9 });
10 linuxPackages_latest = final.linuxPackages_5_15;
11}
diff --git a/shell.nix b/shell.nix
index aef46c67..e0574ac4 100644
--- a/shell.nix
+++ b/shell.nix
@@ -1,4 +1,4 @@
1{ pkgs ? import <nixpkgs> {} }: 1{ pkgs ? import <nixpkgs> {}, deploy-rs }:
2let 2let
3 nixWithFlakes = pkgs.symlinkJoin { 3 nixWithFlakes = pkgs.symlinkJoin {
4 name = "nix-with-flakes"; 4 name = "nix-with-flakes";
@@ -16,5 +16,6 @@ in pkgs.mkShell {
16 wireguard 16 wireguard
17 gup 17 gup
18 nftables 18 nftables
19 deploy-rs
19 ]; 20 ];
20} 21}