This commit is contained in:
iFargle 2023-09-19 08:03:21 +09:00
parent e77313d713
commit 5e08bde94e
2 changed files with 20 additions and 4 deletions

View file

@ -20,8 +20,6 @@
libx = import ./lib { inherit inputs outputs stateVersion hmStateVersion; };
in {
nixosConfigurations = {
# Generic Images / ISOs
nixos-rpi4-img = libx.mkHost { hostname = "nixos-rpi4-img"; platform = "aarch64-linux"; installer = nixpkgs + "/nixos/modules/installer/sd-card/sd-image-aarch64.nix"; };
# Virtual Machines
nixos-vm-01 = libx.mkHost { hostname = "nixos-vm-01"; };
# Physical Machines
@ -32,8 +30,6 @@
nixos-rpi4-03 = libx.mkHost { hostname = "nixos-rpi4-03"; platform = "aarch64-linux"; };
};
homeConfigurations = {
# Generic Images / ISOs
"albert@nixos-rpi4-img" = libx.mkHome { hostname = "nixos-rpi4-img"; platform = "aarch64-linux"; };
# Virtual Machines
"albert@nixos-vm-01" = libx.mkHome { hostname = "nixos-vm-01"; };
# Physical Machines
@ -43,5 +39,9 @@
"albert@nixos-rpi4-02" = libx.mkHome { hostname = "nixos-rpi4-02"; platform = "aarch64-linux"; };
"albert@nixos-rpi4-03" = libx.mkHome { hostname = "nixos-rpi4-03"; platform = "aarch64-linux"; };
};
imageConfigurations = {
# Raspberry Pi 4 Image
nixos-rpi4-img = libx.mkImage { hostname = "nixos-rpi4-img"; platform = "aarch64-linux"; installer = nixpkgs + "/nixos/modules/installer/sd-card/sd-image-aarch64.nix"; };
};
};
}

View file

@ -34,6 +34,22 @@
] ++ (inputs.nixpkgs.lib.optionals (installer != null) [ installer ]);
};
# Combines mkHost and mkHome for image building
mkImage = {
hostname,
username ? "albert",
desktop ? null,
platform ? "x86_64-linux",
theme ? "default",
installer ? null,
gpu ? null,
theme ? "default"
}: {
specialArgs = { inherit inputs outputs desktop hostname username stateVersion gpu platform theme; };
hostname = mkHost { hostname = hostname; platform = platform; installer = installer; };
"$username@$hostname" = mkHome { hostname = hostname; platform = platform; };
};
forAllSystems = inputs.nixpkgs.lib.genAttrs [
"aarch64-linux"
"i686-linux"