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 { in {
nixosConfigurations = { nixosConfigurations = {
# Virtual # 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"; }; nixos-vm-01 = libx.mkHost { hostname = "nixos-vm-01"; };
# Physical # Physical
framework-server = libx.mkHost { hostname = "framework-server"; }; framework-server = libx.mkHost { hostname = "framework-server"; };

View file

@ -22,32 +22,18 @@
desktop ? null, desktop ? null,
gpu ? null, gpu ? null,
platform ? "x86_64-linux", platform ? "x86_64-linux",
theme ? "default" theme ? "default",
type ? "default"
}: inputs.nixpkgs.lib.nixosSystem { }: inputs.nixpkgs.lib.nixosSystem {
specialArgs = { inherit inputs outputs desktop hostname username stateVersion gpu platform theme; }; specialArgs = { inherit inputs outputs desktop hostname username stateVersion gpu platform theme; };
modules = [ modules = [
../nixos # Types are 'default', 'small', and 'minimal'
../nixos/${type}.nix
inputs.sops-nix.nixosModules.sops inputs.sops-nix.nixosModules.sops
inputs.lanzaboote.nixosModules.lanzaboote 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 # Combines mkHost and mkHome for image building
mkImage = { mkImage = {
hostname , hostname ,