summaryrefslogtreecommitdiff
path: root/flake.nix
diff options
context:
space:
mode:
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix79
1 files changed, 53 insertions, 26 deletions
diff --git a/flake.nix b/flake.nix
index b6de92f2..7ed56d44 100644
--- a/flake.nix
+++ b/flake.nix
@@ -19,12 +19,24 @@
19 # ref = "nixos-unstable"; 19 # ref = "nixos-unstable";
20 ref = "ppp-systemd"; 20 ref = "ppp-systemd";
21 }; 21 };
22 nixpkgs-stable = { 22 nixpkgs-pgbackrest = {
23 type = "github"; 23 type = "github";
24 owner = "NixOS"; 24 owner = "NixOS";
25 repo = "nixpkgs"; 25 repo = "nixpkgs";
26 ref = "23.05"; 26 ref = "23.05";
27 }; 27 };
28 nixpkgs-stable = {
29 type = "github";
30 owner = "NixOS";
31 repo = "nixpkgs";
32 ref = "23.11";
33 };
34 nixpkgs-eostre = {
35 type = "github";
36 owner = "NixOS";
37 repo = "nixpkgs";
38 ref = "23.11";
39 };
28 home-manager = { 40 home-manager = {
29 type = "github"; 41 type = "github";
30 # owner = "nix-community"; 42 # owner = "nix-community";
@@ -97,23 +109,35 @@
97 nixpkgs.follows = "nixpkgs"; 109 nixpkgs.follows = "nixpkgs";
98 }; 110 };
99 }; 111 };
112 poetry2nix = {
113 type = "github";
114 owner = "nix-community";
115 repo = "poetry2nix";
116 ref = "master";
117 inputs = {
118 flake-utils.follows = "flake-utils";
119 nixpkgs.follows = "nixpkgs";
120 };
121 };
100 122
101 ca-util = { 123 ca-util = {
102 type = "gitlab"; 124 type = "gitlab";
103 owner = "gkleen"; 125 owner = "gkleen";
104 repo = "ca"; 126 repo = "ca";
105 ref = "v2.1.0"; 127 ref = "v2.3.3";
106 inputs = { 128 inputs = {
107 nixpkgs.follows = "nixpkgs"; 129 nixpkgs.follows = "nixpkgs";
130 poetry2nix.follows = "poetry2nix";
108 }; 131 };
109 }; 132 };
110 backup-utils = { 133 backup-utils = {
111 type = "gitlab"; 134 type = "gitlab";
112 owner = "gkleen"; 135 owner = "gkleen";
113 repo = "backup-utils"; 136 repo = "backup-utils";
114 ref = "v0.1.0"; 137 ref = "v0.1.2";
115 inputs = { 138 inputs = {
116 nixpkgs.follows = "nixpkgs"; 139 nixpkgs.follows = "nixpkgs";
140 poetry2nix.follows = "poetry2nix";
117 }; 141 };
118 }; 142 };
119 prometheus-borg-exporter = { 143 prometheus-borg-exporter = {
@@ -123,6 +147,7 @@
123 ref = "main"; 147 ref = "main";
124 inputs = { 148 inputs = {
125 nixpkgs.follows = "nixpkgs"; 149 nixpkgs.follows = "nixpkgs";
150 poetry2nix.follows = "poetry2nix";
126 }; 151 };
127 }; 152 };
128 }; 153 };
@@ -133,7 +158,7 @@
133 inherit (nixpkgs) lib; 158 inherit (nixpkgs) lib;
134 utils = import ./utils { inherit lib; }; 159 utils = import ./utils { inherit lib; };
135 inherit (utils) nixImport overrideModule; 160 inherit (utils) nixImport overrideModule;
136 inherit (lib) nixosSystem mkIf splitString filterAttrs listToAttrs mapAttrsToList nameValuePair concatMap composeManyExtensions mapAttrs mapAttrs' recursiveUpdate genAttrs unique elem optionalAttrs isDerivation concatLists concatStringsSep fix filter makeOverridable foldr; 161 inherit (lib) mkIf splitString filterAttrs listToAttrs mapAttrsToList nameValuePair concatMap composeManyExtensions mapAttrs mapAttrs' recursiveUpdate genAttrs unique elem optionalAttrs isDerivation concatLists concatStringsSep fix filter makeOverridable foldr;
137 inherit (lib.strings) escapeNixString hasSuffix; 162 inherit (lib.strings) escapeNixString hasSuffix;
138 163
139 accountUserName = accountName: 164 accountUserName = accountName:
@@ -149,29 +174,31 @@
149 174
150 mkOverlay = path: final: prev: import path ({ inherit final; inherit prev; flakeInputs = inputs; flake = self; } // mkSources prev); 175 mkOverlay = path: final: prev: import path ({ inherit final; inherit prev; flakeInputs = inputs; flake = self; } // mkSources prev);
151 176
152 mkNixosConfiguration = addProfiles: dir: path: hostName: nixosSystem rec { 177 mkNixosConfiguration = addProfiles: dir: path: hostName:
153 specialArgs = { 178 let inherit ((inputs."nixpkgs-${hostName}" or inputs.nixpkgs).lib) nixosSystem;
154 flake = self; 179 in nixosSystem rec {
155 flakeInputs = inputs; 180 specialArgs = {
156 path = ./.; 181 flake = self;
182 flakeInputs = inputs;
183 path = ./.;
184 };
185 modules =
186 let
187 defaultProfiles = with self.nixosModules.systemProfiles;
188 [ core
189 ];
190
191 local = dir + "/${path}";
192 argsModule = { pkgs, ... }: {
193 _module.args = {
194 customUtils = utils;
195 inherit hostName;
196 } // mkSources pkgs;
197 };
198 accountModules = attrValues (filterAttrs accountMatchesHost self.nixosModules.accounts);
199 accountMatchesHost = n: _v: accountHostName n == hostName;
200 in attrValues (filterAttrs (n: _v: !(elem n ["systemProfiles" "users" "userProfiles" "accounts"])) self.nixosModules) ++ [ argsModule ] ++ defaultProfiles ++ addProfiles ++ [ local ] ++ accountModules;
157 }; 201 };
158 modules =
159 let
160 defaultProfiles = with self.nixosModules.systemProfiles;
161 [ core
162 ];
163
164 local = dir + "/${path}";
165 argsModule = { pkgs, ... }: {
166 _module.args = {
167 customUtils = utils;
168 inherit hostName;
169 } // mkSources pkgs;
170 };
171 accountModules = attrValues (filterAttrs accountMatchesHost self.nixosModules.accounts);
172 accountMatchesHost = n: _v: accountHostName n == hostName;
173 in attrValues (filterAttrs (n: _v: !(elem n ["systemProfiles" "users" "userProfiles" "accounts"])) self.nixosModules) ++ [ argsModule ] ++ defaultProfiles ++ addProfiles ++ [ local ] ++ accountModules;
174 };
175 202
176 mkSystemProfile = dir: path: profileName: { 203 mkSystemProfile = dir: path: profileName: {
177 imports = [ (dir + "/${path}") ]; 204 imports = [ (dir + "/${path}") ];