forked from rarias/jungle
Add nix-support/private to unfree derivation outputs
This commit is contained in:
parent
2c15bfd5b9
commit
7e31ecd4d7
26
overlay.nix
26
overlay.nix
@ -7,6 +7,32 @@ let
|
||||
callPackage = final.callPackage;
|
||||
|
||||
bscPkgs = {
|
||||
|
||||
# override stdenv to add a sentinel to know if a derivation comes
|
||||
# from unfree sources.
|
||||
stdenv = prev.stdenv // {
|
||||
mkDerivation =
|
||||
args:
|
||||
let
|
||||
originalDrv = prev.stdenv.mkDerivation args;
|
||||
checkLicense = l: if builtins.isAttrs l then !(l.free or true) else false;
|
||||
|
||||
licenses = if builtins.isList args.meta.license then args.meta.license else [ args.meta.license ];
|
||||
|
||||
hasUnfreeLicense =
|
||||
if args ? meta && args.meta ? license then builtins.any checkLicense licenses else false;
|
||||
in
|
||||
if hasUnfreeLicense then
|
||||
originalDrv.overrideAttrs (old: {
|
||||
postInstall = (old.postInstall or "") + ''
|
||||
mkdir -p $out/nix-support
|
||||
touch $out/nix-support/private
|
||||
'';
|
||||
})
|
||||
else
|
||||
originalDrv;
|
||||
};
|
||||
|
||||
amd-uprof = prev.callPackage ./pkgs/amd-uprof/default.nix { };
|
||||
bench6 = callPackage ./pkgs/bench6/default.nix { };
|
||||
bigotes = callPackage ./pkgs/bigotes/default.nix { };
|
||||
|
Loading…
x
Reference in New Issue
Block a user