From 39f7f83c777c8e73dcb9597e4d6fa861ac72f304 Mon Sep 17 00:00:00 2001 From: iFargle Date: Sun, 26 Nov 2023 11:51:14 +0900 Subject: [PATCH] Update helpers --- flake.nix | 2 +- lib/default.nix | 22 ++++------------------ 2 files changed, 5 insertions(+), 19 deletions(-) diff --git a/flake.nix b/flake.nix index d6c0334d..fc09811c 100644 --- a/flake.nix +++ b/flake.nix @@ -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"; }; diff --git a/lib/default.nix b/lib/default.nix index 88e907c9..b9178802 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -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 ,