mirror of
https://github.com/nix-community/home-manager.git
synced 2025-12-06 09:01:04 +01:00
nh: support 4.0 for flake option (#6818)
Recently switched from FLAKE to NH_FLAKE in 4.0
This commit is contained in:
parent
ac3c1f4fa4
commit
e980d0e0e2
1 changed files with 7 additions and 1 deletions
|
|
@ -69,7 +69,13 @@ in
|
|||
|
||||
home = lib.mkIf cfg.enable {
|
||||
packages = [ cfg.package ];
|
||||
sessionVariables = lib.mkIf (cfg.flake != null) { FLAKE = cfg.flake; };
|
||||
sessionVariables = lib.mkIf (cfg.flake != null) (
|
||||
let
|
||||
packageVersion = lib.getVersion cfg.package;
|
||||
isVersion4OrHigher = lib.versionAtLeast packageVersion "4.0.0";
|
||||
in
|
||||
if isVersion4OrHigher then { NH_FLAKE = cfg.flake; } else { FLAKE = cfg.flake; }
|
||||
);
|
||||
};
|
||||
|
||||
systemd.user = lib.mkIf cfg.clean.enable {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue