rpi image

This commit is contained in:
iFargle 2023-12-14 20:19:34 +09:00
parent 628fc1d42d
commit c36a9c88e3
2 changed files with 27 additions and 1 deletions

View file

@ -79,7 +79,7 @@
}; };
imageConfigurations = { imageConfigurations = {
nixos-linode-img = libx.mkMinImage { hostname = "nixos-linode-img"; format = "linode"; }; nixos-linode-img = libx.mkMinImage { hostname = "nixos-linode-img"; format = "linode"; };
nixos-rpi4-img = libx.mkMinImage { hostname = "nixos-rpi4-img"; format = "sd-aarch64"; }; nixos-rpi4-img = libx.mkRpiImage { hostname = "nixos-rpi4-img"; format = "sd-aarch64"; };
nixos-iso-console = libx.mkImage { hostname = "nixos-iso-console"; format = "iso"; }; nixos-iso-console = libx.mkImage { hostname = "nixos-iso-console"; format = "iso"; };
nixos-iso-desktop = libx.mkImage { hostname = "nixos-iso-desktop"; format = "iso"; desktop = "gnome"; }; nixos-iso-desktop = libx.mkImage { hostname = "nixos-iso-desktop"; format = "iso"; desktop = "gnome"; };
}; };

View file

@ -77,6 +77,32 @@
]; ];
}; };
# Combines mkHost and mkHome for image building
mkRpiImage = {
hostname ,
username ? "albert",
desktop ? null,
platform ? "x86_64-linux",
gpu ? null,
theme ? "default",
format
}: inputs.nixpkgs.lib.nixosSystem {
specialArgs = { inherit inputs outputs desktop hostname username stateVersion hmStateVersion gpu platform theme format; };
system = platform;
format = format;
modules = [
"${nixpkgs}/nixos/modules/installer/sd-card/sd-image-raspberrypi.nix"
../nixos
../nixos/common/modules/installer.nix
inputs.sops-nix.nixosModules.sops
inputs.home-manager.nixosModules.home-manager {
home-manager.extraSpecialArgs = { inherit inputs outputs desktop hostname username hmStateVersion stateVersion gpu platform theme format; };
home-manager.users."${username}" = import ../home-manager;
}
];
};
# Small version # Small version
mkMinImage = { mkMinImage = {
hostname , hostname ,