1
0

lib/nixosSystem.nix: Wrap nixpkgs.lib.nixosSystem and include nixfiles modules and overlays by default

This commit is contained in:
2025-06-28 16:43:03 +02:00
parent a66da6cac9
commit 0204773d27
3 changed files with 43 additions and 17 deletions

View File

@@ -10,29 +10,13 @@ let
group ? null,
modules ? [],
}: let
localNixpkgs = import ./nixpkgs.nix inputs;
in nixpkgs.lib.nixosSystem {
in self.lib.nixosSystem {
system = system;
pkgs = localNixpkgs.${system};
modules = modules ++ [
self.nixosModules.nixfilesInputs
self.nixosModules.clerie
self.nixosModules.profiles
({ config, lib, ... }: {
# Set hostname
networking.hostName = lib.mkDefault name;
/*
Make the contents of the flake availiable to modules.
Useful for having the monitoring server scraping the
target config from all other servers automatically.
*/
_module.args = {
inputs = inputs;
_nixfiles = self;
};
# Expose host group to monitoring
clerie.monitoring = nixpkgs.lib.attrsets.optionalAttrs (group != null) { serviceLevel = group; };