mirror of
https://github.com/nix-community/nix-on-droid.git
synced 2025-11-08 19:46:07 +01:00
home-manager: add extraSpecialArgs and sharedModules options
This commit is contained in:
parent
38241f6363
commit
b5ffc6d7df
1 changed files with 28 additions and 2 deletions
|
|
@ -10,7 +10,7 @@ let
|
||||||
extendedLib = import (home-manager-path + "/modules/lib/stdlib-extended.nix") pkgs.lib;
|
extendedLib = import (home-manager-path + "/modules/lib/stdlib-extended.nix") pkgs.lib;
|
||||||
|
|
||||||
hmModule = types.submoduleWith {
|
hmModule = types.submoduleWith {
|
||||||
specialArgs = { lib = extendedLib; };
|
specialArgs = { lib = extendedLib; } // cfg.extraSpecialArgs;
|
||||||
modules = [
|
modules = [
|
||||||
({ name, ... }: {
|
({ name, ... }: {
|
||||||
imports = import (home-manager-path + "/modules/modules.nix") {
|
imports = import (home-manager-path + "/modules/modules.nix") {
|
||||||
|
|
@ -27,7 +27,7 @@ let
|
||||||
home.homeDirectory = config.user.home;
|
home.homeDirectory = config.user.home;
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
];
|
] ++ cfg.sharedModules;
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
|
|
||||||
|
|
@ -54,6 +54,32 @@ in
|
||||||
description = "Home Manager configuration.";
|
description = "Home Manager configuration.";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
extraSpecialArgs = mkOption {
|
||||||
|
type = types.attrs;
|
||||||
|
default = { };
|
||||||
|
example = literalExpression "{ inherit emacs-overlay; }";
|
||||||
|
description = ''
|
||||||
|
Extra <literal>specialArgs</literal> passed to Home Manager. This
|
||||||
|
option can be used to pass additional arguments to all modules.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
sharedModules = mkOption {
|
||||||
|
type = with types;
|
||||||
|
# TODO: use types.raw once this PR is merged: https://github.com/NixOS/nixpkgs/pull/132448
|
||||||
|
listOf (mkOptionType {
|
||||||
|
name = "submodule";
|
||||||
|
inherit (submodule { }) check;
|
||||||
|
merge = lib.options.mergeOneOption;
|
||||||
|
description = "Home Manager modules";
|
||||||
|
});
|
||||||
|
default = [ ];
|
||||||
|
example = literalExpression "[ { home.packages = [ nixpkgs-fmt ]; } ]";
|
||||||
|
description = ''
|
||||||
|
Extra modules.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
useGlobalPkgs = mkEnableOption ''
|
useGlobalPkgs = mkEnableOption ''
|
||||||
using the system configuration's <literal>pkgs</literal>
|
using the system configuration's <literal>pkgs</literal>
|
||||||
argument in Home Manager. This disables the Home Manager
|
argument in Home Manager. This disables the Home Manager
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue