diff options
author | Robert Helgesson <robert@rycee.net> | 2017-12-19 15:43:40 +0100 |
---|---|---|
committer | Robert Helgesson <robert@rycee.net> | 2019-02-16 21:42:47 +0100 |
commit | ef168979bf88310459464e5fe3fbcf2d3cbe49b5 (patch) | |
tree | f9325ae5a5262e681b79c3858935e085cdba22c2 /modules/misc/submodule-support.nix | |
parent | 2093cf425ff6af786a2effc776d3ac89b6787c0a (diff) |
nixos module: support NixOS user packages install
When using the NixOS module we cannot guarantee that the Nix store
will be writable during startup. Installing the user packages through
`nix-env -i` will fail in these cases.
This commit adds a NixOS option `home-manager.useUserPackages` that,
when enabled, installs user packages through the NixOS
users.users.<name?>.packages
option.
Note, when submodule support and external package install is enabled
then the installed packages are not available in `~/.nix-profile`. We
therefore set `home.profileDirectory` directly to the HM profile
packages.
Diffstat (limited to 'modules/misc/submodule-support.nix')
-rw-r--r-- | modules/misc/submodule-support.nix | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/modules/misc/submodule-support.nix b/modules/misc/submodule-support.nix index cffdcb9e95c..d6138c7ccd8 100644 --- a/modules/misc/submodule-support.nix +++ b/modules/misc/submodule-support.nix @@ -15,5 +15,18 @@ with lib; in, for example, NixOS or nix-darwin. ''; }; + + externalPackageInstall = mkOption { + type = types.bool; + default = false; + internal = true; + description = '' + Whether the packages of <option>home.packages</option> are + installed separately from the Home Manager activation script. + In NixOS, for example, this may be accomplished by installing + the packages through + <option>users.users.<name?>.packages</option>. + ''; + }; }; } |