always use internal overrides

This commit is contained in:
DavHau 2021-12-08 23:17:38 +07:00
parent 12c9f565aa
commit 1358e1a303
2 changed files with 14 additions and 15 deletions

View File

@ -110,7 +110,7 @@
# Similar to drem2nixFor but will require 'system(s)' or 'pkgs' as an argument.
# Produces flake-like output schema.
lib = (import ./src/lib.nix {
inherit externalPaths externalSources lib;
inherit externalPaths externalSources overridesDirs lib;
nixpkgsSrc = "${nixpkgs}";
})
# system specific dream2nix library
@ -172,9 +172,6 @@
export dream2nixWithExternals=${./src}
echo -e "\nManually execute 'export dream2nixWithExternals={path to your dream2nix checkout}'"
fi
'';
});

View File

@ -6,8 +6,8 @@
nixpkgsSrc ? <nixpkgs>,
lib ? (import nixpkgsSrc {}).lib,
overridesDirs,
externalSources,
externalPaths,
}@args:
@ -39,7 +39,7 @@ let
# fail if pkgs and systems are both defined
else if pkgsList != null && systems != [] then
throw "Define either `systems` or `pkgs`, not both"
# only pkgs is specified
else if pkgsList != null then
if b.isList pkgsList then
@ -48,13 +48,13 @@ let
pkgsList
else
{ "${makePkgsKey pkgsList}" = pkgsList; }
# only systems is specified
else
lib.genAttrs systems
(system: import nixpkgsSrc { inherit system; });
flakifyBuilderOutputs = system: outputs:
(lib.optionalAttrs (outputs ? "defaultPackage") {
defaultPackage."${system}" = outputs.defaultPackage;
@ -76,9 +76,11 @@ let
}@argsInit:
let
config = (import ./utils/config.nix).loadConfig argsInit.config or {};
config' = (import ./utils/config.nix).loadConfig argsInit.config or {};
overridesDirs' = config.overridesDirs;
config = config' // {
overridesDirs = args.overridesDirs ++ config'.overridesDirs;
};
allPkgs = makeNixpkgs pkgs systems;
@ -111,15 +113,15 @@ let
forAllSystems
(system: pkgs:
dream2nixFor."${system}".apps.flakeApps);
defaultApp =
forAllSystems
(system: pkgs:
dream2nixFor."${system}".apps.flakeApps.dream2nix);
};
riseAndShine =
riseAndShine =
{
pkgs ? null,
systems ? [],
@ -144,7 +146,7 @@ let
lib.mapAttrsToList
(system: outputs: flakifyBuilderOutputs system outputs)
allBuilderOutputs;
in
b.foldl'
(allOutputs: output: lib.recursiveUpdate allOutputs output)
@ -154,4 +156,4 @@ let
in
{
inherit init riseAndShine;
}
}