1
0
Fork 0
mirror of https://github.com/nix-community/nixvim.git synced 2025-11-28 05:01:03 +01:00
nixvim/flake/wrappers.nix
Matt Sturgeon 6bd43bf321 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.
2025-11-24 21:35:55 +00:00

44 lines
1.2 KiB
Nix

{
self,
lib,
...
}:
let
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
{
perSystem =
{ config, system, ... }:
let
inherit (config.legacyPackages) makeNixvimWithModule;
in
{
legacyPackages = {
makeNixvimWithModule = import ../wrappers/standalone.nix {
inherit lib self;
defaultSystem = system;
};
makeNixvim = module: makeNixvimWithModule { inherit module; };
};
};
flake = {
nixosModules = {
nixvim = importApply ../wrappers/nixos.nix self;
default = self.nixosModules.nixvim;
};
# Alias for backward compatibility
homeManagerModules = lib.mapAttrs (_: lib.seq homeManagerModulesWarning) self.homeModules;
homeModules = {
nixvim = importApply ../wrappers/hm.nix self;
default = self.homeModules.nixvim;
};
nixDarwinModules = {
nixvim = importApply ../wrappers/darwin.nix self;
default = self.nixDarwinModules.nixvim;
};
};
}