nix-config/flake/nixos.nix

40 lines
881 B
Nix
Raw Normal View History

2023-03-08 18:53:21 +01:00
{ self, inputs, ... }:
let
inherit (self) lib;
defaultModules = [
{
# Let 'nixos-version --json' know about the Git revision
system.configurationRevision = self.rev or "dirty";
}
{
nixpkgs.overlays = (lib.attrValues self.overlays) ++ [
2023-03-08 18:53:21 +01:00
inputs.nur.overlay
];
}
# Include generic settings
"${self}/modules/nixos"
# Include bundles of settings
"${self}/profiles"
];
buildHost = name: system: lib.nixosSystem {
inherit system;
modules = defaultModules ++ [
"${self}/hosts/nixos/${name}"
];
specialArgs = {
# Use my extended lib in NixOS configuration
inherit lib;
# Inject inputs to use them in global registry
inherit inputs;
};
};
in
2023-03-08 18:53:21 +01:00
{
flake.nixosConfigurations = lib.mapAttrs buildHost {
aramis = "x86_64-linux";
porthos = "x86_64-linux";
};
}