Update helpers

This commit is contained in:
iFargle 2023-11-26 11:51:14 +09:00
parent ed96bc284a
commit 39f7f83c77
2 changed files with 5 additions and 19 deletions

View file

@ -37,7 +37,7 @@
in {
nixosConfigurations = {
# Virtual
osaka-vultr-01 = libx.mkSmallHost { hostname = "osaka-vultr-01"; };
osaka-vultr-01 = libx.mkHost { hostname = "osaka-vultr-01"; type = "small";};
nixos-vm-01 = libx.mkHost { hostname = "nixos-vm-01"; };
# Physical
framework-server = libx.mkHost { hostname = "framework-server"; };

View file

@ -22,32 +22,18 @@
desktop ? null,
gpu ? null,
platform ? "x86_64-linux",
theme ? "default"
theme ? "default",
type ? "default"
}: inputs.nixpkgs.lib.nixosSystem {
specialArgs = { inherit inputs outputs desktop hostname username stateVersion gpu platform theme; };
modules = [
../nixos
# Types are 'default', 'small', and 'minimal'
../nixos/${type}.nix
inputs.sops-nix.nixosModules.sops
inputs.lanzaboote.nixosModules.lanzaboote
];
};
# Helper function for generating host configs
mkSmallHost = {
hostname,
username ? "albert",
desktop ? null,
gpu ? null,
platform ? "x86_64-linux",
theme ? "default"
}: inputs.nixpkgs.lib.nixosSystem {
specialArgs = { inherit inputs outputs desktop hostname username stateVersion gpu platform theme; };
modules = [
../nixos/small.nix
inputs.sops-nix.nixosModules.sops
];
};
# Combines mkHost and mkHome for image building
mkImage = {
hostname ,