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