mirror of
https://github.com/nix-community/home-manager.git
synced 2024-12-14 11:57:55 +00:00
home-environment: Add force flake profile override
Added a new option home.forceNixProfiles to force the usage of 'nix profile' and not 'nix-env' Fixes #4928 as nix profiles do not require the presence of .drvs
This commit is contained in:
parent
2064348e55
commit
ad2f4c786c
1 changed files with 5 additions and 1 deletions
|
@ -445,6 +445,10 @@ in
|
|||
'';
|
||||
};
|
||||
|
||||
home.forceNixProfiles = mkEnableOption ''
|
||||
forcing home-manager to use `nix profile` instead of
|
||||
`nix-env` for activating the environment.'';
|
||||
|
||||
home.enableNixpkgsReleaseCheck = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
|
@ -597,7 +601,7 @@ in
|
|||
$DRY_RUN_CMD $oldNix profile install $1
|
||||
}
|
||||
|
||||
if [[ -e ${cfg.profileDirectory}/manifest.json ]] ; then
|
||||
if [[ ${if config.home.forceNixProfiles then "true" else "false"} = true || -e ${cfg.profileDirectory}/manifest.json ]] ; then
|
||||
INSTALL_CMD="nix profile install"
|
||||
INSTALL_CMD_ACTUAL="nixReplaceProfile"
|
||||
LIST_CMD="nix profile list"
|
||||
|
|
Loading…
Reference in a new issue