flake: add an empty nixvimConfiguration to the legacyPackages output

This commit is contained in:
Matt Sturgeon 2024-09-15 18:02:54 +01:00
parent ccc2469e4f
commit fcb782cd9c
No known key found for this signature in database
GPG key ID: 4F91844CED1A8299
4 changed files with 20 additions and 17 deletions

View file

@ -2,7 +2,7 @@
perSystem = perSystem =
{ {
pkgs, pkgs,
config, helpers,
makeNixvimWithModule, makeNixvimWithModule,
... ...
}: }:
@ -10,6 +10,13 @@
legacyPackages = rec { legacyPackages = rec {
inherit makeNixvimWithModule; inherit makeNixvimWithModule;
makeNixvim = module: makeNixvimWithModule { inherit module; }; makeNixvim = module: makeNixvimWithModule { inherit module; };
nixvimConfiguration = helpers.modules.evalNixvim {
extraSpecialArgs = {
defaultPkgs = pkgs;
};
check = false;
};
}; };
}; };
} }

View file

@ -7,15 +7,11 @@
system, system,
helpers, helpers,
makeNixvimWithModule, makeNixvimWithModule,
self',
... ...
}: }:
let let
evaluatedNixvim = helpers.modules.evalNixvim { inherit (self'.legacyPackages) nixvimConfiguration;
extraSpecialArgs = {
defaultPkgs = pkgs;
};
check = false;
};
in in
{ {
checks = { checks = {
@ -50,11 +46,11 @@
maintainers = import ../tests/maintainers.nix { inherit pkgs; }; maintainers = import ../tests/maintainers.nix { inherit pkgs; };
plugins-by-name = pkgs.callPackage ../tests/plugins-by-name.nix { inherit evaluatedNixvim; }; plugins-by-name = pkgs.callPackage ../tests/plugins-by-name.nix { inherit nixvimConfiguration; };
generated = pkgs.callPackage ../tests/generated.nix { }; generated = pkgs.callPackage ../tests/generated.nix { };
package-options = pkgs.callPackage ../tests/package-options.nix { inherit evaluatedNixvim; }; package-options = pkgs.callPackage ../tests/package-options.nix { inherit nixvimConfiguration; };
} // import ../tests { inherit pkgs pkgsUnfree helpers; }; } // import ../tests { inherit pkgs pkgsUnfree helpers; };
}; };
} }

View file

@ -1,7 +1,7 @@
# This test ensures "package" options use a "literalExpression" in their defaultText # This test ensures "package" options use a "literalExpression" in their defaultText
# I.e. it validates `lib.mkPackageOption` was used to build the package options. # I.e. it validates `lib.mkPackageOption` was used to build the package options.
{ {
evaluatedNixvim, nixvimConfiguration,
lib, lib,
runCommandNoCCLocal, runCommandNoCCLocal,
}: }:
@ -22,7 +22,7 @@ let
# This doesn't collect any submodule sub-options, # This doesn't collect any submodule sub-options,
# but that's fine since most of our "package" options are in the top level module eval # but that's fine since most of our "package" options are in the top level module eval
options = lib.collect isOption evaluatedNixvim.options; options = lib.collect isOption nixvimConfiguration.options;
# All visible non-sub options that default to a derivation # All visible non-sub options that default to a derivation
drvOptions = filter ( drvOptions = filter (
@ -51,7 +51,7 @@ runCommandNoCCLocal "validate-package-options"
# Passthroughs for debugging purposes # Passthroughs for debugging purposes
passthru = { passthru = {
inherit evaluatedNixvim drvOptions badOptions; inherit nixvimConfiguration drvOptions badOptions;
}; };
# Error strings to print # Error strings to print
@ -60,7 +60,7 @@ runCommandNoCCLocal "validate-package-options"
# A little hack to get the flake's source in the nix store # A little hack to get the flake's source in the nix store
# We will use this to make the option declaration sources more readable # We will use this to make the option declaration sources more readable
src = removeSuffix "modules/top-level/output.nix" ( src = removeSuffix "modules/top-level/output.nix" (
head evaluatedNixvim.options.package.declarations head nixvimConfiguration.options.package.declarations
); );
in in
map ( map (

View file

@ -1,12 +1,12 @@
{ {
lib, lib,
evaluatedNixvim, nixvimConfiguration,
linkFarmFromDrvs, linkFarmFromDrvs,
runCommandNoCCLocal, runCommandNoCCLocal,
}: }:
let let
by-name = ../plugins/by-name; by-name = ../plugins/by-name;
options = lib.collect lib.isOption evaluatedNixvim.options; options = lib.collect lib.isOption nixvimConfiguration.options;
# Option namespaces that we allow by-name plugins to declare # Option namespaces that we allow by-name plugins to declare
knownPluginNamespaces = [ knownPluginNamespaces = [
@ -137,7 +137,7 @@ linkFarmFromDrvs "plugins-by-name" [
]; ];
passthru = { passthru = {
inherit evaluatedNixvim; inherit nixvimConfiguration;
}; };
} }
'' ''
@ -172,7 +172,7 @@ linkFarmFromDrvs "plugins-by-name" [
]; ];
passthru = { passthru = {
inherit evaluatedNixvim; inherit nixvimConfiguration;
}; };
} }
'' ''