Merge pull request #207652 from Artturin/splicenixfmt
This commit is contained in:
commit
f56de234bb
|
@ -1,31 +1,17 @@
|
||||||
{ config
|
{ config
|
||||||
, lib
|
, lib
|
||||||
, pkgs
|
, pkgs
|
||||||
, splicePackages
|
, generateSplicesForMkScope
|
||||||
, newScope
|
, makeScopeWithSplicing
|
||||||
, pkgsBuildBuild
|
|
||||||
, pkgsBuildHost
|
|
||||||
, pkgsBuildTarget
|
|
||||||
, pkgsHostHost
|
|
||||||
, pkgsTargetTarget
|
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
otherSplices = {
|
|
||||||
selfBuildBuild = pkgsBuildBuild.xfce;
|
|
||||||
selfBuildHost = pkgsBuildHost.xfce;
|
|
||||||
selfBuildTarget = pkgsBuildTarget.xfce;
|
|
||||||
selfHostHost = pkgsHostHost.xfce;
|
|
||||||
selfTargetTarget = pkgsTargetTarget.xfce or { };
|
|
||||||
};
|
|
||||||
keep = _self: { };
|
keep = _self: { };
|
||||||
extra = _spliced0: { };
|
extra = _spliced0: { };
|
||||||
|
|
||||||
in
|
in
|
||||||
lib.makeScopeWithSplicing
|
makeScopeWithSplicing
|
||||||
splicePackages
|
(generateSplicesForMkScope "xfce")
|
||||||
newScope
|
|
||||||
otherSplices
|
|
||||||
keep
|
keep
|
||||||
extra
|
extra
|
||||||
(self:
|
(self:
|
||||||
|
|
|
@ -23,7 +23,7 @@ let
|
||||||
# - imports lua-packages.nix
|
# - imports lua-packages.nix
|
||||||
# - adds spliced package sets to the package set
|
# - adds spliced package sets to the package set
|
||||||
# - applies overrides from `packageOverrides`
|
# - applies overrides from `packageOverrides`
|
||||||
({ lua, overrides, callPackage, splicePackages, newScope }: let
|
({ lua, overrides, callPackage, makeScopeWithSplicing }: let
|
||||||
luaPackagesFun = callPackage ../../../top-level/lua-packages.nix {
|
luaPackagesFun = callPackage ../../../top-level/lua-packages.nix {
|
||||||
lua = self;
|
lua = self;
|
||||||
};
|
};
|
||||||
|
@ -46,9 +46,7 @@ let
|
||||||
overriddenPackages
|
overriddenPackages
|
||||||
overrides
|
overrides
|
||||||
];
|
];
|
||||||
in lib.makeScopeWithSplicing
|
in makeScopeWithSplicing
|
||||||
splicePackages
|
|
||||||
newScope
|
|
||||||
otherSplices
|
otherSplices
|
||||||
keep
|
keep
|
||||||
extra
|
extra
|
||||||
|
|
|
@ -5,9 +5,8 @@
|
||||||
, db
|
, db
|
||||||
, lib
|
, lib
|
||||||
, libffiBoot
|
, libffiBoot
|
||||||
, newScope
|
, makeScopeWithSplicing
|
||||||
, pythonPackagesExtensions
|
, pythonPackagesExtensions
|
||||||
, splicePackages
|
|
||||||
, stdenv
|
, stdenv
|
||||||
}:
|
}:
|
||||||
|
|
||||||
|
@ -71,9 +70,7 @@
|
||||||
overrides
|
overrides
|
||||||
]);
|
]);
|
||||||
aliases = self: super: lib.optionalAttrs config.allowAliases (import ../../../top-level/python-aliases.nix lib self super);
|
aliases = self: super: lib.optionalAttrs config.allowAliases (import ../../../top-level/python-aliases.nix lib self super);
|
||||||
in lib.makeScopeWithSplicing
|
in makeScopeWithSplicing
|
||||||
splicePackages
|
|
||||||
newScope
|
|
||||||
otherSplices
|
otherSplices
|
||||||
keep
|
keep
|
||||||
extra
|
extra
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
{ lib, newScope, splicePackages, steamPackagesAttr ? "steamPackages"
|
{ makeScopeWithSplicing, generateSplicesForMkScope
|
||||||
, pkgsBuildBuild, pkgsBuildHost, pkgsBuildTarget, pkgsHostHost, pkgsTargetTarget
|
|
||||||
, stdenv, buildFHSUserEnv, pkgsi686Linux
|
, stdenv, buildFHSUserEnv, pkgsi686Linux
|
||||||
}:
|
}:
|
||||||
|
|
||||||
|
@ -18,19 +17,12 @@ let
|
||||||
glxinfo-i686 = pkgsi686Linux.glxinfo;
|
glxinfo-i686 = pkgsi686Linux.glxinfo;
|
||||||
steam-runtime-wrapped-i686 =
|
steam-runtime-wrapped-i686 =
|
||||||
if self.steamArch == "amd64"
|
if self.steamArch == "amd64"
|
||||||
then pkgsi686Linux.${steamPackagesAttr}.steam-runtime-wrapped
|
then pkgsi686Linux.steamPackages.steam-runtime-wrapped
|
||||||
else null;
|
else null;
|
||||||
inherit buildFHSUserEnv;
|
inherit buildFHSUserEnv;
|
||||||
};
|
};
|
||||||
steamcmd = callPackage ./steamcmd.nix { };
|
steamcmd = callPackage ./steamcmd.nix { };
|
||||||
};
|
};
|
||||||
otherSplices = {
|
|
||||||
selfBuildBuild = pkgsBuildBuild.${steamPackagesAttr};
|
|
||||||
selfBuildHost = pkgsBuildHost.${steamPackagesAttr};
|
|
||||||
selfBuildTarget = pkgsBuildTarget.${steamPackagesAttr};
|
|
||||||
selfHostHost = pkgsHostHost.${steamPackagesAttr};
|
|
||||||
selfTargetTarget = pkgsTargetTarget.${steamPackagesAttr} or {}; # might be missing;
|
|
||||||
};
|
|
||||||
keep = self: { };
|
keep = self: { };
|
||||||
extra = spliced0: { };
|
extra = spliced0: { };
|
||||||
in lib.makeScopeWithSplicing splicePackages newScope otherSplices keep extra steamPackagesFun
|
in makeScopeWithSplicing (generateSplicesForMkScope "steamPackages") keep extra steamPackagesFun
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{ stdenv, lib, stdenvNoCC
|
{ stdenv, lib, stdenvNoCC
|
||||||
, pkgsBuildBuild, pkgsBuildHost, pkgsBuildTarget, pkgsHostHost, pkgsTargetTarget
|
, makeScopeWithSplicing, generateSplicesForMkScope
|
||||||
, buildPackages, splicePackages, newScope
|
, buildPackages
|
||||||
, bsdSetupHook, makeSetupHook
|
, bsdSetupHook, makeSetupHook
|
||||||
, fetchgit, fetchurl, coreutils, groff, mandoc, byacc, flex, which, m4, gawk, substituteAll, runtimeShell
|
, fetchgit, fetchurl, coreutils, groff, mandoc, byacc, flex, which, m4, gawk, substituteAll, runtimeShell
|
||||||
, zlib, expat, libmd
|
, zlib, expat, libmd
|
||||||
|
@ -24,14 +24,6 @@ let
|
||||||
name = "freebsd-setup-hook";
|
name = "freebsd-setup-hook";
|
||||||
} ./setup-hook.sh;
|
} ./setup-hook.sh;
|
||||||
|
|
||||||
otherSplices = {
|
|
||||||
selfBuildBuild = pkgsBuildBuild.freebsd;
|
|
||||||
selfBuildHost = pkgsBuildHost.freebsd;
|
|
||||||
selfBuildTarget = pkgsBuildTarget.freebsd;
|
|
||||||
selfHostHost = pkgsHostHost.freebsd;
|
|
||||||
selfTargetTarget = pkgsTargetTarget.freebsd or {}; # might be missing
|
|
||||||
};
|
|
||||||
|
|
||||||
mkBsdArch = stdenv': {
|
mkBsdArch = stdenv': {
|
||||||
x86_64 = "amd64";
|
x86_64 = "amd64";
|
||||||
aarch64 = "arm64";
|
aarch64 = "arm64";
|
||||||
|
@ -74,10 +66,8 @@ let
|
||||||
done
|
done
|
||||||
'';
|
'';
|
||||||
|
|
||||||
in lib.makeScopeWithSplicing
|
in makeScopeWithSplicing
|
||||||
splicePackages
|
(generateSplicesForMkScope "freebsd")
|
||||||
newScope
|
|
||||||
otherSplices
|
|
||||||
(_: {})
|
(_: {})
|
||||||
(_: {})
|
(_: {})
|
||||||
(self: let
|
(self: let
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{ stdenv, lib, stdenvNoCC
|
{ stdenv, lib, stdenvNoCC
|
||||||
, pkgsBuildBuild, pkgsBuildHost, pkgsBuildTarget, pkgsHostHost, pkgsTargetTarget
|
, makeScopeWithSplicing, generateSplicesForMkScope
|
||||||
, buildPackages, splicePackages, newScope
|
, buildPackages
|
||||||
, bsdSetupHook, makeSetupHook, fetchcvs, groff, mandoc, byacc, flex
|
, bsdSetupHook, makeSetupHook, fetchcvs, groff, mandoc, byacc, flex
|
||||||
, zlib
|
, zlib
|
||||||
, writeShellScript, writeText, runtimeShell, symlinkJoin
|
, writeShellScript, writeText, runtimeShell, symlinkJoin
|
||||||
|
@ -20,24 +20,14 @@ let
|
||||||
name = "netbsd-setup-hook";
|
name = "netbsd-setup-hook";
|
||||||
} ./setup-hook.sh;
|
} ./setup-hook.sh;
|
||||||
|
|
||||||
otherSplices = {
|
|
||||||
selfBuildBuild = pkgsBuildBuild.netbsd;
|
|
||||||
selfBuildHost = pkgsBuildHost.netbsd;
|
|
||||||
selfBuildTarget = pkgsBuildTarget.netbsd;
|
|
||||||
selfHostHost = pkgsHostHost.netbsd;
|
|
||||||
selfTargetTarget = pkgsTargetTarget.netbsd or {}; # might be missing
|
|
||||||
};
|
|
||||||
|
|
||||||
defaultMakeFlags = [
|
defaultMakeFlags = [
|
||||||
"MKSOFTFLOAT=${if stdenv.hostPlatform.gcc.float or (stdenv.hostPlatform.parsed.abi.float or "hard") == "soft"
|
"MKSOFTFLOAT=${if stdenv.hostPlatform.gcc.float or (stdenv.hostPlatform.parsed.abi.float or "hard") == "soft"
|
||||||
then "yes"
|
then "yes"
|
||||||
else "no"}"
|
else "no"}"
|
||||||
];
|
];
|
||||||
|
|
||||||
in lib.makeScopeWithSplicing
|
in makeScopeWithSplicing
|
||||||
splicePackages
|
(generateSplicesForMkScope "netbsd")
|
||||||
newScope
|
|
||||||
otherSplices
|
|
||||||
(_: {})
|
(_: {})
|
||||||
(_: {})
|
(_: {})
|
||||||
(self: let
|
(self: let
|
||||||
|
@ -46,7 +36,7 @@ in lib.makeScopeWithSplicing
|
||||||
|
|
||||||
# Why do we have splicing and yet do `nativeBuildInputs = with self; ...`?
|
# Why do we have splicing and yet do `nativeBuildInputs = with self; ...`?
|
||||||
#
|
#
|
||||||
# We use `lib.makeScopeWithSplicing` because this should be used for all
|
# We use `makeScopeWithSplicing` because this should be used for all
|
||||||
# nested package sets which support cross, so the inner `callPackage` works
|
# nested package sets which support cross, so the inner `callPackage` works
|
||||||
# correctly. But for the inline packages we don't bother to use
|
# correctly. But for the inline packages we don't bother to use
|
||||||
# `callPackage`.
|
# `callPackage`.
|
||||||
|
|
|
@ -24997,13 +24997,6 @@ with pkgs;
|
||||||
};
|
};
|
||||||
|
|
||||||
xorg = let
|
xorg = let
|
||||||
otherSplices = {
|
|
||||||
selfBuildBuild = pkgsBuildBuild.xorg;
|
|
||||||
selfBuildHost = pkgsBuildHost.xorg;
|
|
||||||
selfBuildTarget = pkgsBuildTarget.xorg;
|
|
||||||
selfHostHost = pkgsHostHost.xorg;
|
|
||||||
selfTargetTarget = pkgsTargetTarget.xorg or { };
|
|
||||||
};
|
|
||||||
keep = _self: { };
|
keep = _self: { };
|
||||||
extra = _spliced0: { };
|
extra = _spliced0: { };
|
||||||
|
|
||||||
|
@ -25022,10 +25015,8 @@ with pkgs;
|
||||||
|
|
||||||
generatedPackages = lib.callPackageWith __splicedPackages ../servers/x11/xorg/default.nix {};
|
generatedPackages = lib.callPackageWith __splicedPackages ../servers/x11/xorg/default.nix {};
|
||||||
|
|
||||||
xorgPackages = lib.makeScopeWithSplicing
|
xorgPackages = makeScopeWithSplicing
|
||||||
splicePackages
|
(generateSplicesForMkScope "xorg")
|
||||||
newScope
|
|
||||||
otherSplices
|
|
||||||
keep
|
keep
|
||||||
extra
|
extra
|
||||||
(lib.extends overrides generatedPackages);
|
(lib.extends overrides generatedPackages);
|
||||||
|
|
|
@ -1,19 +1,11 @@
|
||||||
{ lib
|
{ lib
|
||||||
, buildPackages, pkgs, targetPackages
|
, buildPackages, pkgs, targetPackages
|
||||||
, pkgsBuildBuild, pkgsBuildHost, pkgsBuildTarget, pkgsHostHost, pkgsTargetTarget
|
, generateSplicesForMkScope, makeScopeWithSplicing
|
||||||
, stdenv, splicePackages, newScope
|
, stdenv
|
||||||
, preLibcCrossHeaders
|
, preLibcCrossHeaders
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
otherSplices = {
|
|
||||||
selfBuildBuild = pkgsBuildBuild.darwin;
|
|
||||||
selfBuildHost = pkgsBuildHost.darwin;
|
|
||||||
selfBuildTarget = pkgsBuildTarget.darwin;
|
|
||||||
selfHostHost = pkgsHostHost.darwin;
|
|
||||||
selfTargetTarget = pkgsTargetTarget.darwin or {}; # might be missing
|
|
||||||
};
|
|
||||||
|
|
||||||
# Prefix for binaries. Customarily ends with a dash separator.
|
# Prefix for binaries. Customarily ends with a dash separator.
|
||||||
#
|
#
|
||||||
# TODO(@Ericson2314) Make unconditional, or optional but always true by
|
# TODO(@Ericson2314) Make unconditional, or optional but always true by
|
||||||
|
@ -22,7 +14,7 @@ let
|
||||||
(stdenv.targetPlatform.config + "-");
|
(stdenv.targetPlatform.config + "-");
|
||||||
in
|
in
|
||||||
|
|
||||||
lib.makeScopeWithSplicing splicePackages newScope otherSplices (_: {}) (spliced: spliced.apple_sdk.frameworks) (self: let
|
makeScopeWithSplicing (generateSplicesForMkScope "darwin") (_: {}) (spliced: spliced.apple_sdk.frameworks) (self: let
|
||||||
inherit (self) mkDerivation callPackage;
|
inherit (self) mkDerivation callPackage;
|
||||||
|
|
||||||
# Must use pkgs.callPackage to avoid infinite recursion.
|
# Must use pkgs.callPackage to avoid infinite recursion.
|
||||||
|
|
|
@ -18,86 +18,103 @@ lib: pkgs: actuallySplice:
|
||||||
|
|
||||||
let
|
let
|
||||||
|
|
||||||
spliceReal = { pkgsBuildBuild, pkgsBuildHost, pkgsBuildTarget
|
spliceReal =
|
||||||
, pkgsHostHost, pkgsHostTarget
|
{ pkgsBuildBuild
|
||||||
, pkgsTargetTarget
|
, pkgsBuildHost
|
||||||
}: let
|
, pkgsBuildTarget
|
||||||
mash =
|
, pkgsHostHost
|
||||||
# Other pkgs sets
|
, pkgsHostTarget
|
||||||
pkgsBuildBuild // pkgsBuildTarget // pkgsHostHost // pkgsTargetTarget
|
, pkgsTargetTarget
|
||||||
# The same pkgs sets one probably intends
|
}:
|
||||||
// pkgsBuildHost // pkgsHostTarget;
|
let
|
||||||
merge = name: {
|
mash =
|
||||||
inherit name;
|
# Other pkgs sets
|
||||||
value = let
|
pkgsBuildBuild // pkgsBuildTarget // pkgsHostHost // pkgsTargetTarget
|
||||||
defaultValue = mash.${name};
|
# The same pkgs sets one probably intends
|
||||||
# `or {}` is for the non-derivation attsert splicing case, where `{}` is the identity.
|
// pkgsBuildHost // pkgsHostTarget;
|
||||||
valueBuildBuild = pkgsBuildBuild.${name} or {};
|
merge = name: {
|
||||||
valueBuildHost = pkgsBuildHost.${name} or {};
|
inherit name;
|
||||||
valueBuildTarget = pkgsBuildTarget.${name} or {};
|
value =
|
||||||
valueHostHost = pkgsHostHost.${name} or {};
|
let
|
||||||
valueHostTarget = pkgsHostTarget.${name} or {};
|
defaultValue = mash.${name};
|
||||||
valueTargetTarget = pkgsTargetTarget.${name} or {};
|
# `or {}` is for the non-derivation attsert splicing case, where `{}` is the identity.
|
||||||
augmentedValue = defaultValue
|
valueBuildBuild = pkgsBuildBuild.${name} or { };
|
||||||
# TODO(@Artturin): remove before release 23.05 and only have __spliced.
|
valueBuildHost = pkgsBuildHost.${name} or { };
|
||||||
// (lib.optionalAttrs (pkgsBuildHost ? ${name}) { nativeDrv = lib.warn "use ${name}.__spliced.buildHost instead of ${name}.nativeDrv" valueBuildHost; })
|
valueBuildTarget = pkgsBuildTarget.${name} or { };
|
||||||
// (lib.optionalAttrs (pkgsHostTarget ? ${name}) { crossDrv = lib.warn "use ${name}.__spliced.hostTarget instead of ${name}.crossDrv" valueHostTarget; })
|
valueHostHost = pkgsHostHost.${name} or { };
|
||||||
// {
|
valueHostTarget = pkgsHostTarget.${name} or { };
|
||||||
__spliced =
|
valueTargetTarget = pkgsTargetTarget.${name} or { };
|
||||||
(lib.optionalAttrs (pkgsBuildBuild ? ${name}) { buildBuild = valueBuildBuild; })
|
augmentedValue = defaultValue
|
||||||
// (lib.optionalAttrs (pkgsBuildHost ? ${name}) { buildHost = valueBuildHost; })
|
# TODO(@Artturin): remove before release 23.05 and only have __spliced.
|
||||||
// (lib.optionalAttrs (pkgsBuildTarget ? ${name}) { buildTarget = valueBuildTarget; })
|
// (lib.optionalAttrs (pkgsBuildHost ? ${name}) { nativeDrv = lib.warn "use ${name}.__spliced.buildHost instead of ${name}.nativeDrv" valueBuildHost; })
|
||||||
// (lib.optionalAttrs (pkgsHostHost ? ${name}) { hostHost = valueHostHost; })
|
// (lib.optionalAttrs (pkgsHostTarget ? ${name}) { crossDrv = lib.warn "use ${name}.__spliced.hostTarget instead of ${name}.crossDrv" valueHostTarget; })
|
||||||
// (lib.optionalAttrs (pkgsHostTarget ? ${name}) { hostTarget = valueHostTarget; })
|
// {
|
||||||
// (lib.optionalAttrs (pkgsTargetTarget ? ${name}) { targetTarget = valueTargetTarget;
|
__spliced =
|
||||||
});
|
(lib.optionalAttrs (pkgsBuildBuild ? ${name}) { buildBuild = valueBuildBuild; })
|
||||||
};
|
// (lib.optionalAttrs (pkgsBuildHost ? ${name}) { buildHost = valueBuildHost; })
|
||||||
# Get the set of outputs of a derivation. If one derivation fails to
|
// (lib.optionalAttrs (pkgsBuildTarget ? ${name}) { buildTarget = valueBuildTarget; })
|
||||||
# evaluate we don't want to diverge the entire splice, so we fall back
|
// (lib.optionalAttrs (pkgsHostHost ? ${name}) { hostHost = valueHostHost; })
|
||||||
# on {}
|
// (lib.optionalAttrs (pkgsHostTarget ? ${name}) { hostTarget = valueHostTarget; })
|
||||||
tryGetOutputs = value0: let
|
// (lib.optionalAttrs (pkgsTargetTarget ? ${name}) {
|
||||||
inherit (builtins.tryEval value0) success value;
|
targetTarget = valueTargetTarget;
|
||||||
in getOutputs (lib.optionalAttrs success value);
|
});
|
||||||
getOutputs = value: lib.genAttrs
|
};
|
||||||
(value.outputs or (lib.optional (value ? out) "out"))
|
# Get the set of outputs of a derivation. If one derivation fails to
|
||||||
(output: value.${output});
|
# evaluate we don't want to diverge the entire splice, so we fall back
|
||||||
in
|
# on {}
|
||||||
# The derivation along with its outputs, which we recur
|
tryGetOutputs = value0:
|
||||||
# on to splice them together.
|
let
|
||||||
if lib.isDerivation defaultValue then augmentedValue // spliceReal {
|
inherit (builtins.tryEval value0) success value;
|
||||||
pkgsBuildBuild = tryGetOutputs valueBuildBuild;
|
in
|
||||||
pkgsBuildHost = tryGetOutputs valueBuildHost;
|
getOutputs (lib.optionalAttrs success value);
|
||||||
pkgsBuildTarget = tryGetOutputs valueBuildTarget;
|
getOutputs = value: lib.genAttrs
|
||||||
pkgsHostHost = tryGetOutputs valueHostHost;
|
(value.outputs or (lib.optional (value ? out) "out"))
|
||||||
pkgsHostTarget = getOutputs valueHostTarget;
|
(output: value.${output});
|
||||||
pkgsTargetTarget = tryGetOutputs valueTargetTarget;
|
in
|
||||||
# Just recur on plain attrsets
|
# The derivation along with its outputs, which we recur
|
||||||
} else if lib.isAttrs defaultValue then spliceReal {
|
# on to splice them together.
|
||||||
pkgsBuildBuild = valueBuildBuild;
|
if lib.isDerivation defaultValue then augmentedValue // spliceReal {
|
||||||
pkgsBuildHost = valueBuildHost;
|
pkgsBuildBuild = tryGetOutputs valueBuildBuild;
|
||||||
pkgsBuildTarget = valueBuildTarget;
|
pkgsBuildHost = tryGetOutputs valueBuildHost;
|
||||||
pkgsHostHost = valueHostHost;
|
pkgsBuildTarget = tryGetOutputs valueBuildTarget;
|
||||||
pkgsHostTarget = valueHostTarget;
|
pkgsHostHost = tryGetOutputs valueHostHost;
|
||||||
pkgsTargetTarget = valueTargetTarget;
|
pkgsHostTarget = getOutputs valueHostTarget;
|
||||||
# Don't be fancy about non-derivations. But we could have used used
|
pkgsTargetTarget = tryGetOutputs valueTargetTarget;
|
||||||
# `__functor__` for functions instead.
|
# Just recur on plain attrsets
|
||||||
} else defaultValue;
|
} else if lib.isAttrs defaultValue then
|
||||||
};
|
spliceReal
|
||||||
in lib.listToAttrs (map merge (lib.attrNames mash));
|
{
|
||||||
|
pkgsBuildBuild = valueBuildBuild;
|
||||||
|
pkgsBuildHost = valueBuildHost;
|
||||||
|
pkgsBuildTarget = valueBuildTarget;
|
||||||
|
pkgsHostHost = valueHostHost;
|
||||||
|
pkgsHostTarget = valueHostTarget;
|
||||||
|
pkgsTargetTarget = valueTargetTarget;
|
||||||
|
# Don't be fancy about non-derivations. But we could have used used
|
||||||
|
# `__functor__` for functions instead.
|
||||||
|
} else defaultValue;
|
||||||
|
};
|
||||||
|
in
|
||||||
|
lib.listToAttrs (map merge (lib.attrNames mash));
|
||||||
|
|
||||||
splicePackages = { pkgsBuildBuild, pkgsBuildHost, pkgsBuildTarget
|
splicePackages =
|
||||||
, pkgsHostHost, pkgsHostTarget
|
{ pkgsBuildBuild
|
||||||
, pkgsTargetTarget
|
, pkgsBuildHost
|
||||||
} @ args:
|
, pkgsBuildTarget
|
||||||
|
, pkgsHostHost
|
||||||
|
, pkgsHostTarget
|
||||||
|
, pkgsTargetTarget
|
||||||
|
} @ args:
|
||||||
if actuallySplice then spliceReal args else pkgsHostTarget;
|
if actuallySplice then spliceReal args else pkgsHostTarget;
|
||||||
|
|
||||||
splicedPackages = splicePackages {
|
splicedPackages = splicePackages
|
||||||
inherit (pkgs)
|
{
|
||||||
pkgsBuildBuild pkgsBuildHost pkgsBuildTarget
|
inherit (pkgs)
|
||||||
pkgsHostHost pkgsHostTarget
|
pkgsBuildBuild pkgsBuildHost pkgsBuildTarget
|
||||||
pkgsTargetTarget
|
pkgsHostHost pkgsHostTarget
|
||||||
;
|
pkgsTargetTarget
|
||||||
} // {
|
;
|
||||||
|
} // {
|
||||||
# These should never be spliced under any circumstances
|
# These should never be spliced under any circumstances
|
||||||
inherit (pkgs)
|
inherit (pkgs)
|
||||||
pkgsBuildBuild pkgsBuildHost pkgsBuildTarget
|
pkgsBuildBuild pkgsBuildHost pkgsBuildTarget
|
||||||
|
@ -109,7 +126,10 @@ let
|
||||||
};
|
};
|
||||||
|
|
||||||
splicedPackagesWithXorg = splicedPackages // builtins.removeAttrs splicedPackages.xorg [
|
splicedPackagesWithXorg = splicedPackages // builtins.removeAttrs splicedPackages.xorg [
|
||||||
"callPackage" "newScope" "overrideScope" "packages"
|
"callPackage"
|
||||||
|
"newScope"
|
||||||
|
"overrideScope"
|
||||||
|
"packages"
|
||||||
];
|
];
|
||||||
|
|
||||||
in
|
in
|
||||||
|
@ -120,12 +140,30 @@ in
|
||||||
# We use `callPackage' to be able to omit function arguments that can be
|
# We use `callPackage' to be able to omit function arguments that can be
|
||||||
# obtained `pkgs` or `buildPackages` and their `xorg` package sets. Use
|
# obtained `pkgs` or `buildPackages` and their `xorg` package sets. Use
|
||||||
# `newScope' for sets of packages in `pkgs' (see e.g. `gnome' below).
|
# `newScope' for sets of packages in `pkgs' (see e.g. `gnome' below).
|
||||||
callPackage = pkgs.newScope {};
|
callPackage = pkgs.newScope { };
|
||||||
|
|
||||||
callPackages = lib.callPackagesWith splicedPackagesWithXorg;
|
callPackages = lib.callPackagesWith splicedPackagesWithXorg;
|
||||||
|
|
||||||
newScope = extra: lib.callPackageWith (splicedPackagesWithXorg // extra);
|
newScope = extra: lib.callPackageWith (splicedPackagesWithXorg // extra);
|
||||||
|
|
||||||
|
# prefill 2 fields of the function for convenience
|
||||||
|
makeScopeWithSplicing = lib.makeScopeWithSplicing splicePackages pkgs.newScope;
|
||||||
|
|
||||||
|
# generate 'otherSplices' for 'makeScopeWithSplicing'
|
||||||
|
generateSplicesForMkScope = attr:
|
||||||
|
let
|
||||||
|
split = X: lib.splitString "." "${X}.${attr}";
|
||||||
|
in
|
||||||
|
{
|
||||||
|
# nulls should never be reached
|
||||||
|
selfBuildBuild = lib.attrByPath (split "pkgsBuildBuild") null pkgs;
|
||||||
|
selfBuildHost = lib.attrByPath (split "pkgsBuildHost") null pkgs;
|
||||||
|
selfBuildTarget = lib.attrByPath (split "pkgsBuildTarget") null pkgs;
|
||||||
|
selfHostHost = lib.attrByPath (split "pkgsHostHost") null pkgs;
|
||||||
|
selfHostTarget = lib.attrByPath (split "pkgsHostTarget") null pkgs;
|
||||||
|
selfTargetTarget = lib.attrByPath (split "pkgsTargetTarget") { } pkgs;
|
||||||
|
};
|
||||||
|
|
||||||
# Haskell package sets need this because they reimplement their own
|
# Haskell package sets need this because they reimplement their own
|
||||||
# `newScope`.
|
# `newScope`.
|
||||||
__splicedPackages = splicedPackages // { recurseForDerivations = false; };
|
__splicedPackages = splicedPackages // { recurseForDerivations = false; };
|
||||||
|
|
Loading…
Reference in a new issue