1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-03-31 04:04:32 +00:00
This commit is contained in:
Weathercold 2025-03-28 10:00:50 +07:00 committed by GitHub
commit 55c3a1a46d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -16,10 +16,11 @@ in {
type = lib.types.nullOr lib.types.singleLineStr;
default = null;
description = ''
The path that will be used for the {env}`FLAKE` environment variable.
The path that will be used for the {env}`NH_FLAKE`
({env}`FLAKE` if < 4.0.0-beta.1) environment variable.
{env}`FLAKE` is used by nh as the default flake for performing actions,
like {command}`nh os switch`.
{env}`NH_FLAKE` and {env}`FLAKE` are used by nh as the default flake for
performing actions, like {command}`nh os switch`.
'';
};
@ -60,7 +61,15 @@ in {
home = lib.mkIf cfg.enable {
packages = [ cfg.package ];
sessionVariables = lib.mkIf (cfg.flake != null) { FLAKE = cfg.flake; };
sessionVariables = lib.mkIf (cfg.flake != null) {
# Includes 4.0.0 beta versions
${
if lib.versionAtLeast cfg.package.version "4.0.0" then
"NH_FLAKE"
else
"FLAKE"
} = cfg.flake;
};
};
systemd.user = lib.mkIf cfg.clean.enable {