refactor nixos configs

This commit is contained in:
2025-02-16 14:52:54 +01:00
parent 1b53d3f2fa
commit 898113b5fb

View File

@@ -12,49 +12,42 @@
self, self,
... ...
}: }:
{ let
nixosConfigurations = { inherit (nixpkgs) lib;
hosts = {
# VivoBook laptop # VivoBook laptop
haze = nixpkgs.lib.nixosSystem { haze = {
specialArgs = {
inherit inputs;
inherit (import ./parts) keys;
};
system = "x86_64-linux"; system = "x86_64-linux";
modules = [
./hosts/haze
./system
];
}; };
# Hetzner VPS # Hetzner VPS
crocus = nixpkgs.lib.nixosSystem { crocus = {
specialArgs = {
inherit inputs;
inherit (import ./parts) keys;
};
system = "x86_64-linux"; system = "x86_64-linux";
modules = [
./hosts/crocus
./system
];
}; };
# Raspberry Pi 4 # Raspberry Pi 4
genepi = nixpkgs.lib.nixosSystem { genepi = {
specialArgs = {
inherit inputs self;
inherit (import ./parts) keys;
};
system = "aarch64-linux"; system = "aarch64-linux";
modules = [
./hosts/genepi
./system
];
}; };
}; };
in
{
nixosConfigurations =
let
mkNixosConfig =
hostname:
{ system }:
lib.nixosSystem {
inherit system;
specialArgs = {
inherit inputs self;
inherit (import ./parts) keys;
};
modules = [
./hosts/${hostname}
./system
];
};
in
builtins.mapAttrs mkNixosConfig hosts;
# Raspberry Pi 4 installer ISO. # Raspberry Pi 4 installer ISO.
packages.aarch64-linux.installer-sd-image = nixos-generators.nixosGenerate { packages.aarch64-linux.installer-sd-image = nixos-generators.nixosGenerate {