summaryrefslogtreecommitdiff
path: root/flake.nix
diff options
context:
space:
mode:
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix15
1 files changed, 13 insertions, 2 deletions
diff --git a/flake.nix b/flake.nix
index fa1e81d6..1b2758e7 100644
--- a/flake.nix
+++ b/flake.nix
@@ -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: {