This commit is contained in:
Kenryu Shibata
2026-01-07 01:42:09 +09:00
parent a743f2c943
commit d471aa77f9
8 changed files with 151 additions and 17 deletions

View File

@@ -3,22 +3,24 @@ let
inherit (self) inputs;
common-intel = inputs.nixos-hardware.nixosModules.common-cpu-intel;
common-nvidia = inputs.nixos-hardware.nixosModules.common-gpu-nvidia-nonprime;
framework16 = inputs.nixos-hardware.nixosModules.framework-16-7040-amd;
# mkHost - String -> Boolean -> Attr -> Attr - Create nixos system attributes
# mkHost - String -> Boolean -> [Attr] -> Attr - Create nixos system attribute set
# @param name - String - Name of the system
# @param isDesktop - Boolean - If set true, adds xlibre overlays to modules
# @param machine - Attr - Attribute from nixos-hardware nixos Module for setting machine's preset
mkHost = name: isDesktop: machine:
# @param useXLibre - Boolean - If set true, adds xlibre overlays to modules
# @param machine - [Attr] - Array of attribute sets from nixos-hardware nixos Module for setting machine's preset
# @return - An attribute set that describes NixOS system configurations
mkHost = name: useXLibre: machine:
nixpkgs.lib.nixosSystem {
modules = [
./${name}
../overlays
machine
] ++ builtins.attrValues self.nixosModules ++ (if isDesktop then [
] ++ builtins.attrValues self.nixosModules ++ (if useXLibre then [
inputs.xlibre-overlay.nixosModules.overlay-xlibre-xserver
inputs.xlibre-overlay.nixosModules.overlay-all-xlibre-drivers
] else []);
] else []) ++ machine;
specialArgs = {
inherit inputs;
@@ -26,5 +28,7 @@ let
};
in
{
"virtual-bird" = mkHost "virtual-bird" true common-intel;
"virtual-bird" = mkHost "virtual-bird" true [ common-intel ];
"alanturing" = mkHost "alanturing" true [ common-intel common-nvidia ];
"waku" = mkHost "waku" true [ framework16 ];
}