lib/flake-helper.nix: Restrcuture host module references
This commit is contained in:
parent
0453d34606
commit
2a3281a7c4
@ -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")
|
||||
];
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user