flake: add config shorthand to mkHome

This allows for passing short chunks of ad-hoc config, for when a
user@host doesn't need an entire home.nix, and it's more concise than
specifying a modules array with one module.
This commit is contained in:
NullBite 2024-04-03 18:33:52 -04:00
parent 731fe5c2c8
commit f6c405bcd2
Signed by: nullbite
GPG Key ID: 6C4D545385D4925A

View File

@ -236,9 +236,10 @@
entrypoint ? ./home/standalone.nix, entrypoint ? ./home/standalone.nix,
modules ? [ ], modules ? [ ],
stateVersion ? null, stateVersion ? null,
config ? { },
system, system,
... }@args: let ... }@args: let
_modules = [ entrypoint ] ++ modules ++ [ _modules = [ entrypoint ] ++ modules ++ [ config ] ++ [
{ {
config = { config = {
home = { home = {
@ -262,7 +263,7 @@
osConfig = {}; osConfig = {};
}; };
} // builtins.removeAttrs args } // builtins.removeAttrs args
[ "system" "nixpkgs" "home-manager" "modules" "username" "homeDirectory" "stateVersion" "entrypoint" ]); [ "system" "nixpkgs" "home-manager" "modules" "username" "homeDirectory" "stateVersion" "entrypoint" "config" ]);
in { in {
# for repl debugging via :lf . # for repl debugging via :lf .
@ -319,9 +320,10 @@
"nullbite@rpi4" = mkHome { "nullbite@rpi4" = mkHome {
system = "aarch64-linux"; system = "aarch64-linux";
stateVersion = "23.11"; stateVersion = "23.11";
modules = [ config.programs = {
{ programs.zsh.enable = false; } zsh.enable = false;
]; keychain.enable = false;
};
nixpkgs = inputs.nixpkgs-unstable; nixpkgs = inputs.nixpkgs-unstable;
home-manager = inputs.home-manager-unstable; home-manager = inputs.home-manager-unstable;
}; };
@ -329,6 +331,7 @@
system = "x86_64-linux"; system = "x86_64-linux";
stateVersion = "23.11"; stateVersion = "23.11";
username = "deck"; username = "deck";
config.programs.keychain.enable = false;
nixpkgs = inputs.nixpkgs-unstable; nixpkgs = inputs.nixpkgs-unstable;
home-manager = inputs.home-manager-unstable; home-manager = inputs.home-manager-unstable;
}; };