1
0
Fork 0
mirror of https://github.com/nix-community/nixvim.git synced 2025-11-28 05:01:03 +01:00

flake: push down homeManagerModules warning

Push the rename warning down to the actual attributes, to avoid printing
it too early. Additionally, bind the warning to top-level static value,
to avoid printing it multiple times.

Simplify `oldestSupportedReleaseIsAtLeast 2505` to `true`, assuming this
will not be backported.
This commit is contained in:
Matt Sturgeon 2025-11-24 10:06:54 +00:00
parent 3dc952d69c
commit 6bd43bf321

View file

@ -5,6 +5,9 @@
}: }:
let let
inherit (lib.modules) importApply; inherit (lib.modules) importApply;
# Added 2025-05-25; warning shown since 2025-08-01 (25.11)
# NOTE: top-level binding of a fully resolved value, to avoid printing multiple times
homeManagerModulesWarning = lib.warn "nixvim: flake output `homeManagerModules` has been renamed to `homeModules`." null;
in in
{ {
perSystem = perSystem =
@ -28,13 +31,7 @@ in
default = self.nixosModules.nixvim; default = self.nixosModules.nixvim;
}; };
# Alias for backward compatibility # Alias for backward compatibility
# Added 2025-05-25 in https://github.com/nix-community/nixvim/pull/3387 homeManagerModules = lib.mapAttrs (_: lib.seq homeManagerModulesWarning) self.homeModules;
homeManagerModules =
let
cond = lib.trivial.oldestSupportedReleaseIsAtLeast 2505;
msg = "nixvim: flake output `homeManagerModules` has been renamed to `homeModules`.";
in
lib.warnIf cond msg self.homeModules;
homeModules = { homeModules = {
nixvim = importApply ../wrappers/hm.nix self; nixvim = importApply ../wrappers/hm.nix self;
default = self.homeModules.nixvim; default = self.homeModules.nixvim;