1
0

lib/flake-helper.nix: Restrcuture host module references

This commit is contained in:
clerie 2024-05-13 17:00:03 +02:00
parent 0453d34606
commit 2a3281a7c4
Signed by: clerie
GPG Key ID: BD9F56480870BAD2

View File

@ -13,7 +13,14 @@ rec {
modules = modules ++ [
self.nixosModules.nixfilesInputs
self.nixosModules.clerie
({ ... }: {
({ config, lib, ... }: {
# Apply overlays
nixpkgs.overlays = [
self.overlays.nixfilesInputs
self.overlays.clerie
];
/*
Make the contents of the flake availiable to modules.
Useful for having the monitoring server scraping the
@ -23,19 +30,11 @@ rec {
inputs = inputs;
_nixfiles = self;
};
})
../configuration/common
../users/clerie
({ ... }: {
nixpkgs.overlays = [
self.overlays.nixfilesInputs
self.overlays.clerie
];
# Expose host group to monitoring
clerie.monitoring = nixpkgs.lib.attrsets.optionalAttrs (group != null) { serviceLevel = group; };
})
(../hosts + "/${name}/configuration.nix")
# Automatically load secrets from sops file for host
({ config, lib, ... }: {
# Automatically load secrets from sops file for host
sops.defaultSopsFile = ../hosts + "/${name}/secrets.json";
sops.secrets = let
secretFile = config.sops.defaultSopsFile;
@ -47,6 +46,13 @@ rec {
in
secrets;
})
# Config to be applied to every host
../configuration/common
../users/clerie
# Host specific config
(../hosts + "/${name}/configuration.nix")
];
};