summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2020-12-31 14:32:30 +0100
committerGregor Kleen <gkleen@yggdrasil.li>2021-01-03 20:17:33 +0100
commit055dd32001bdc96fcee3ba0159ae9bb7c922d4b6 (patch)
treeaef5674cd557397d703912db7d38db147f605837
parentc6eac8a549fd9f55d5da908dbe49da9301e264f0 (diff)
downloadnixos-055dd32001bdc96fcee3ba0159ae9bb7c922d4b6.tar
nixos-055dd32001bdc96fcee3ba0159ae9bb7c922d4b6.tar.gz
nixos-055dd32001bdc96fcee3ba0159ae9bb7c922d4b6.tar.bz2
nixos-055dd32001bdc96fcee3ba0159ae9bb7c922d4b6.tar.xz
nixos-055dd32001bdc96fcee3ba0159ae9bb7c922d4b6.zip
Support for sops
-rw-r--r--flake.nix15
-rw-r--r--shell.nix1
2 files changed, 14 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: {
diff --git a/shell.nix b/shell.nix
index 2820eb1a..2840bec7 100644
--- a/shell.nix
+++ b/shell.nix
@@ -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}