Compare commits
2 Commits
0453d34606
...
d55dc35882
Author | SHA1 | Date | |
---|---|---|---|
d55dc35882 | |||
2a3281a7c4 |
@ -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;
|
||||
|
@ -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, ... }: {
|
||||
|
||||
# Automatically load secrets from sops file for host
|
||||
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
|
@ -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;
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user