This commit is contained in:
iFargle 2024-02-09 22:35:52 +09:00
parent bb6a69d377
commit d685ba3c45

View file

@ -32,19 +32,8 @@
]; ];
}; };
# Helper function for generating host configs
mkHost = { let
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; };
pkgs = import inputs.${repo} { pkgs = import inputs.${repo} {
inherit system; inherit system;
config.allowUnfree = unfree; config.allowUnfree = unfree;
@ -55,13 +44,29 @@
config.allowUnfree = unfree; config.allowUnfree = unfree;
hostPlatform = system; 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' modules = [
../nixos/${type}.nix # Types are 'default', 'small', and 'minimal'
inputs.sops-nix.nixosModules.sops ../nixos/${type}.nix
inputs.lanzaboote.nixosModules.lanzaboote inputs.sops-nix.nixosModules.sops
]; inputs.lanzaboote.nixosModules.lanzaboote
];
};
}; };
# Combines mkHost and mkHome for image building # Combines mkHost and mkHome for image building