1
0

Compare commits

..

2 Commits

3 changed files with 28 additions and 21 deletions

View File

@ -90,7 +90,7 @@
_iso = { name = "_iso"; };
};
nixosConfigurations = helper.mapToNixosConfigurations self.clerie.hosts;
nixosConfigurations = import ./flake/nixosConfigurations.nix inputs;
nixosModules = {
nixfilesInputs = import ./flake/modules.nix inputs;

View File

@ -1,6 +1,9 @@
{ self, nixpkgs, fernglas, fieldpoc, nixos-exporter, solid-xmpp-alarm, sops-nix, ... }@inputs:
{ self
, nixpkgs
, ...
}@inputs:
rec {
let
generateNixosSystem = {
name,
system ? "x86_64-linux",
@ -13,7 +16,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 +33,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, ... }: {
sops.defaultSopsFile = ../hosts + "/${name}/secrets.json";
sops.secrets = let
secretFile = config.sops.defaultSopsFile;
@ -47,8 +49,17 @@ rec {
in
secrets;
})
# Config to be applied to every host
../configuration/common
../users/clerie
# Host specific config
(../hosts + "/${name}/configuration.nix")
];
};
mapToNixosConfigurations = hosts: builtins.mapAttrs (name: host: generateNixosSystem host) hosts;
}
in
mapToNixosConfigurations self.clerie.hosts

View File

@ -7,10 +7,6 @@ let
} // inputs);
lib = {
flake-helper = callLibs ./flake-helper.nix;
inherit ("flake-helper")
generateNixosSystem
mapToNixosConfigurations;
clerie-monitoring-ids = callLibs ./clerie-monitoring-ids.nix;
};