Use packagesFromDirectoryRecursive to improve package building
This commit is contained in:
parent
57dafbe7e1
commit
8aa578123c
10 changed files with 27 additions and 33 deletions
|
|
@ -16,7 +16,7 @@ update:
|
||||||
nix flake update --log-format internal-json 2>&1 | nom --json
|
nix flake update --log-format internal-json 2>&1 | nom --json
|
||||||
|
|
||||||
updatePkgs:
|
updatePkgs:
|
||||||
cd pkgs && nvfetcher
|
nvfetcher
|
||||||
|
|
||||||
build specialisation=DEFAULT_SPECIALISATION:
|
build specialisation=DEFAULT_SPECIALISATION:
|
||||||
nh os build {{ FLAKE_HOME }} {{ if specialisation == DEFAULT_SPECIALISATION { "-S" } else { "-s " + specialisation } }}
|
nh os build {{ FLAKE_HOME }} {{ if specialisation == DEFAULT_SPECIALISATION { "-S" } else { "-s " + specialisation } }}
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,6 @@
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (inputs) nixpkgs;
|
inherit (inputs) nixpkgs;
|
||||||
callPackages = lib.callPackagesWith (pkgs // {inherit callPackages inputs rootPath lib;});
|
|
||||||
in {
|
in {
|
||||||
_module.args.pkgs = import nixpkgs {
|
_module.args.pkgs = import nixpkgs {
|
||||||
inherit system;
|
inherit system;
|
||||||
|
|
@ -33,7 +32,31 @@
|
||||||
nvfetcher
|
nvfetcher
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
packages = callPackages (rootPath + "/pkgs") {};
|
legacyPackages = let
|
||||||
checks = self'.packages;
|
inputsScope = lib.makeScope pkgs.newScope (self: {
|
||||||
|
inherit inputs rootPath;
|
||||||
|
srcs = self.callPackage (rootPath + "/_sources/generated.nix") {};
|
||||||
|
});
|
||||||
|
in
|
||||||
|
lib.packagesFromDirectoryRecursive {
|
||||||
|
inherit (inputsScope) callPackage;
|
||||||
|
directory = rootPath + "/pkgs";
|
||||||
|
};
|
||||||
|
packages = let
|
||||||
|
flattenPkgs = path: value:
|
||||||
|
if lib.isDerivation value
|
||||||
|
then {
|
||||||
|
${lib.concatStringsSep "/" path} = value;
|
||||||
|
}
|
||||||
|
else if lib.isAttrs value
|
||||||
|
then lib.concatMapAttrs (name: flattenPkgs (path ++ [name])) value
|
||||||
|
else {};
|
||||||
|
in
|
||||||
|
flattenPkgs [] self'.legacyPackages;
|
||||||
|
checks =
|
||||||
|
lib.concatMapAttrs (name: value: {
|
||||||
|
"package-${name}" = value;
|
||||||
|
})
|
||||||
|
self'.packages;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,29 +0,0 @@
|
||||||
{
|
|
||||||
inputs,
|
|
||||||
rootPath,
|
|
||||||
callPackages,
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
srcs = callPackages ./_sources/generated.nix {};
|
|
||||||
callPackage = lib.callPackageWith (pkgs // {inherit inputs srcs callPackage rootPath;});
|
|
||||||
in {
|
|
||||||
pinentry-selector = callPackage ./pinentry-selector.nix {};
|
|
||||||
helix = callPackage ./helix {};
|
|
||||||
juicity = callPackage ./juicity.nix {};
|
|
||||||
spotifyx = callPackage ./spotifyx.nix {};
|
|
||||||
radicle-explorer = callPackage ./radicle-explorer.nix {};
|
|
||||||
TrackersListCollection = callPackage ./TrackersListCollection.nix {};
|
|
||||||
wshowkeys-mao = callPackage ./wshowkeys-mao.nix {};
|
|
||||||
OuterWildsTextAdventure = callPackage ./OuterWildsTextAdventure.nix {};
|
|
||||||
QQ = callPackage ./QQ.nix {};
|
|
||||||
editor-runtime = callPackage ./editor-runtime.nix {};
|
|
||||||
cliphist = callPackage ./cliphist.nix {};
|
|
||||||
radicle-ci-broker = callPackage ./radicle-ci-broker.nix {};
|
|
||||||
rime-yuhaostar = callPackage ./rime-yuhaostar {};
|
|
||||||
|
|
||||||
noto-serif-cjk = callPackage ./noto-serif-cjk.nix {};
|
|
||||||
noto-sans-cjk = callPackage ./noto-sans-cjk.nix {};
|
|
||||||
wallpapers = callPackage ./wallpapers.nix {};
|
|
||||||
}
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue