diff --git a/modules/home-environment.nix b/modules/home-environment.nix index d0d44472..d28f8c45 100644 --- a/modules/home-environment.nix +++ b/modules/home-environment.nix @@ -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"