diff options
-rw-r--r-- | flake.nix | 15 | ||||
-rw-r--r-- | shell.nix | 1 |
2 files changed, 14 insertions, 2 deletions
@@ -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 | } |