feat: Improve legacyPackage function

This commit is contained in:
ulic-youthlic 2025-11-02 07:21:08 +08:00
parent 5de4c827d8
commit 7be2edee33
Signed by: youthlic
GPG key ID: 63E86C3C14A0D721
7 changed files with 29 additions and 11 deletions

View file

@ -47,14 +47,16 @@
inherit inputs rootPath;
srcs = self.callPackage (rootPath + "/_sources/generated.nix") { };
inherit (inputs'.nixvim.legacyPackages) makeNixvim makeNixvimWithModule;
inherit (self'.legacyPackages) nixvimPlugins editor-runtime;
neovim_git = inputs'.neovim-nightly.packages.default;
});
in
inputsScope.overrideScope (
final: _prev:
lib.packagesFromDirectoryRecursive {
inherit (inputsScope) callPackage;
inherit (final) callPackage;
directory = rootPath + "/pkgs";
};
}
);
packages =
let
flattenPkgs =
@ -68,7 +70,23 @@
else
{ };
in
flattenPkgs [ ] self'.legacyPackages;
flattenPkgs [ ] (
lib.removeAttrs self'.legacyPackages [
"inputs"
"srcs"
"rootPath"
"makeNixvim"
"makeNixvimWithModule"
"newScope"
"overrideScope"
"packages"
"callPackage"
]
);
checks = lib.concatMapAttrs (name: value: {
"package-${name}" = value;
}) self'.packages;

View file

@ -4,5 +4,5 @@ let
inherit (prev.stdenv.hostPlatform) system;
in
{
inherit (outputs.packages."${system}") cliphist;
inherit (outputs.packages."${system}") cliphist';
}

View file

@ -4,5 +4,5 @@ let
inherit (prev.stdenv.hostPlatform) system;
in
{
radicle-explorer = outputs.packages."${system}".radicle-explorer;
radicle-explorer = outputs.packages."${system}".radicle-explorer';
}

View file

@ -4,5 +4,5 @@ let
inherit (prev.stdenv.hostPlatform) system;
in
{
spotifyd = outputs.packages."${system}".spotifyd;
spotifyd = outputs.packages.${system}.spotifyd';
}

View file

@ -8,7 +8,7 @@ let
inherit (srcs.spotifyd) src date version;
in
spotifyd.overrideAttrs (
final: prev: {
_final: prev: {
inherit src;
version =
if prev.version != "0.4.1" then
@ -18,7 +18,7 @@ spotifyd.overrideAttrs (
else
"0-unstable-${date}-git${version}";
cargoDeps = rustPlatform.fetchCargoVendor {
inherit (final)
inherit (prev)
src
;
hash = "sha256-WwShp1ebk89cBqRXqKDgbwGZraCDjQAOxoL4uEIq2aw=";