feat(modules): Introduce per node module import from meta

This commit is contained in:
Tom Hubrecht 2024-04-18 16:23:25 +02:00
parent 46b550781e
commit c47437116b
3 changed files with 26 additions and 8 deletions

View file

@ -26,6 +26,8 @@
stateVersion = "23.05"; stateVersion = "23.05";
vm-cluster = "Hyperviseur NPS"; vm-cluster = "Hyperviseur NPS";
nix-modules = [ "services/crabfit" ];
}; };
compute01 = { compute01 = {
@ -53,6 +55,8 @@
storage01 = { storage01 = {
site = "pav01"; site = "pav01";
stateVersion = "23.11"; stateVersion = "23.11";
nix-modules = [ "services/forgejo-nix-runners" ];
}; };
vault01 = { vault01 = {

View file

@ -95,6 +95,14 @@ in
''; '';
}; };
nix-modules = mkOption {
type = listOf str;
default = [ ];
description = ''
List of modules to import from [nix-modules](https://git.hubrecht.ovh/hubrecht/nix-modules).
'';
};
admins = mkOption { admins = mkOption {
type = listOf str; type = listOf str;
default = [ ]; default = [ ];

View file

@ -32,7 +32,12 @@
# pris connaissance de la licence CeCILL, et que vous en avez accepté les # pris connaissance de la licence CeCILL, et que vous en avez accepté les
# termes. # termes.
{ lib, sources, ... }: {
lib,
nodeMeta,
sources,
...
}:
{ {
imports = imports =
@ -57,11 +62,12 @@
"${sources.attic}/nixos/atticd.nix" "${sources.attic}/nixos/atticd.nix"
"${sources.arkheon}/module.nix" "${sources.arkheon}/module.nix"
] ]
++ ((import sources.nix-modules { inherit lib; }).importModules [ ++ ((import sources.nix-modules { inherit lib; }).importModules (
"age-secrets" [
"services/crabfit" "age-secrets"
"services/forgejo-nix-runners" "services/bupstash"
"services/bupstash" "services/systemd-notify"
"services/systemd-notify" ]
]); ++ nodeMeta.nix-modules
));
} }