diff options
-rw-r--r-- | flake.lock | 24 | ||||
-rw-r--r-- | flake.nix | 15 | ||||
-rw-r--r-- | shell.nix | 1 |
3 files changed, 37 insertions, 3 deletions
@@ -40,7 +40,29 @@ | |||
40 | "root": { | 40 | "root": { |
41 | "inputs": { | 41 | "inputs": { |
42 | "home-manager": "home-manager", | 42 | "home-manager": "home-manager", |
43 | "nixpkgs": "nixpkgs" | 43 | "nixpkgs": "nixpkgs", |
44 | "sops-nix": "sops-nix" | ||
45 | } | ||
46 | }, | ||
47 | "sops-nix": { | ||
48 | "inputs": { | ||
49 | "nixpkgs": [ | ||
50 | "nixpkgs" | ||
51 | ] | ||
52 | }, | ||
53 | "locked": { | ||
54 | "lastModified": 1609306567, | ||
55 | "narHash": "sha256-CPVjO4tdmhHW7sOTbo8i9JN7HlNhakwpUi3u3+V6gnY=", | ||
56 | "owner": "Mic92", | ||
57 | "repo": "sops-nix", | ||
58 | "rev": "da343afab9aace88875f24bfb2d90e3d9afaafc4", | ||
59 | "type": "github" | ||
60 | }, | ||
61 | "original": { | ||
62 | "owner": "Mic92", | ||
63 | "ref": "master", | ||
64 | "repo": "sops-nix", | ||
65 | "type": "github" | ||
44 | } | 66 | } |
45 | } | 67 | } |
46 | }, | 68 | }, |
@@ -15,9 +15,16 @@ | |||
15 | ref = "master"; | 15 | ref = "master"; |
16 | inputs.nixpkgs.follows = "nixpkgs"; | 16 | inputs.nixpkgs.follows = "nixpkgs"; |
17 | }; | 17 | }; |
18 | sops-nix = { | ||
19 | type = "github"; | ||
20 | owner = "Mic92"; | ||
21 | repo = "sops-nix"; | ||
22 | ref = "master"; | ||
23 | inputs.nixpkgs.follows = "nixpkgs"; | ||
24 | }; | ||
18 | }; | 25 | }; |
19 | 26 | ||
20 | outputs = { self, nixpkgs, home-manager }@inputs: | 27 | outputs = { self, nixpkgs, home-manager, sops-nix }@inputs: |
21 | let | 28 | let |
22 | inherit (builtins) attrNames attrValues elemAt; | 29 | inherit (builtins) attrNames attrValues elemAt; |
23 | inherit (nixpkgs) lib; | 30 | inherit (nixpkgs) lib; |
@@ -33,6 +40,10 @@ | |||
33 | }; | 40 | }; |
34 | modules = | 41 | modules = |
35 | let | 42 | let |
43 | extraModules = [ | ||
44 | sops-nix.nixosModules.sops | ||
45 | home-manager.nixosModules.home-manager | ||
46 | ]; | ||
36 | defaultProfiles = with self.nixosModules.systemProfiles; [core]; | 47 | defaultProfiles = with self.nixosModules.systemProfiles; [core]; |
37 | local = "${toString dir}/${path}"; | 48 | local = "${toString dir}/${path}"; |
38 | global._module.args = { | 49 | global._module.args = { |
@@ -45,7 +56,7 @@ | |||
45 | accountName' = splitString "@" n; | 56 | accountName' = splitString "@" n; |
46 | hostName' = elemAt accountName' 1; | 57 | hostName' = elemAt accountName' 1; |
47 | in hostName' == hostName; | 58 | in hostName' == hostName; |
48 | in [ home-manager.nixosModules.home-manager global ] ++ defaultProfiles ++ [ local ] ++ accountModules; | 59 | in extraModules ++ [ global ] ++ defaultProfiles ++ [ local ] ++ accountModules; |
49 | }; | 60 | }; |
50 | 61 | ||
51 | mkSystemProfile = dir: path: profileName: { | 62 | mkSystemProfile = dir: path: profileName: { |
@@ -12,5 +12,6 @@ in pkgs.mkShell { | |||
12 | name = "nixos"; | 12 | name = "nixos"; |
13 | nativeBuildInputs = with pkgs; [ | 13 | nativeBuildInputs = with pkgs; [ |
14 | nixWithFlakes | 14 | nixWithFlakes |
15 | sops | ||
15 | ]; | 16 | ]; |
16 | } | 17 | } |