From d685ba3c45e92f40e089da9a92c3db5d76548440 Mon Sep 17 00:00:00 2001 From: iFargle Date: Fri, 9 Feb 2024 22:35:52 +0900 Subject: [PATCH] test --- lib/default.nix | 43 ++++++++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/lib/default.nix b/lib/default.nix index 709a568c..fda76108 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -32,19 +32,8 @@ ]; }; - # Helper function for generating host configs - mkHost = { - hostname, - username ? "albert", - desktop ? null, - gpu ? null, - system ? "x86_64-linux", - theme ? "stylix", - type ? "default", - repo ? "nixpkgs", - unfree ? false - }: inputs.${repo}.lib.nixosSystem { - specialArgs = { inherit inputs outputs desktop hostname username stateVersion gpu system theme nixpkgs-unstable; }; + + let pkgs = import inputs.${repo} { inherit system; config.allowUnfree = unfree; @@ -55,13 +44,29 @@ config.allowUnfree = unfree; hostPlatform = system; }; + in { + # Helper function for generating host configs + mkHost = { + hostname, + username ? "albert", + desktop ? null, + gpu ? null, + system ? "x86_64-linux", + theme ? "stylix", + type ? "default", + repo ? "nixpkgs", + unfree ? false + }: inputs.${repo}.lib.nixosSystem { + specialArgs = { inherit inputs outputs desktop hostname username stateVersion gpu system theme nixpkgs-unstable; }; - modules = [ - # Types are 'default', 'small', and 'minimal' - ../nixos/${type}.nix - inputs.sops-nix.nixosModules.sops - inputs.lanzaboote.nixosModules.lanzaboote - ]; + + modules = [ + # Types are 'default', 'small', and 'minimal' + ../nixos/${type}.nix + inputs.sops-nix.nixosModules.sops + inputs.lanzaboote.nixosModules.lanzaboote + ]; + }; }; # Combines mkHost and mkHome for image building