summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2020-12-31 14:32:30 +0100
committerGregor Kleen <gkleen@yggdrasil.li>2020-12-31 14:32:30 +0100
commit34cf32a834a3b6abf46643e4cc6bc1a0d5f2992d (patch)
tree84203f165bb635d628a0d7277fd717821949dc9c
parent1dc5dff82f609bd3074d99b5308c0a2df0d1b077 (diff)
downloadnixos-34cf32a834a3b6abf46643e4cc6bc1a0d5f2992d.tar
nixos-34cf32a834a3b6abf46643e4cc6bc1a0d5f2992d.tar.gz
nixos-34cf32a834a3b6abf46643e4cc6bc1a0d5f2992d.tar.bz2
nixos-34cf32a834a3b6abf46643e4cc6bc1a0d5f2992d.tar.xz
nixos-34cf32a834a3b6abf46643e4cc6bc1a0d5f2992d.zip
Support for sops
-rw-r--r--flake.lock24
-rw-r--r--flake.nix15
-rw-r--r--shell.nix1
3 files changed, 37 insertions, 3 deletions
diff --git a/flake.lock b/flake.lock
index 89225a55..d9afa42f 100644
--- a/flake.lock
+++ b/flake.lock
@@ -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 },
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}