Something went wrong. Try again.
What happens if I push all of nixpkgs
Something went wrong. Try again.
1.9 kB · 79 lines
Nix
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980{ lib, buildPlatform, callPackage, kaem, mescc-tools-extra, checkMeta,}:rec { derivationWithMeta = attrs: let passthru = attrs.passthru or { }; validity = checkMeta.assertValidity { inherit meta attrs; }; meta = checkMeta.commonMeta { inherit validity attrs; }; baseDrv = derivation ( { inherit (buildPlatform) system; inherit (meta) name; } // (builtins.removeAttrs attrs [ "meta" "passthru" ]) ); passthru' = passthru // lib.optionalAttrs (passthru ? tests) { tests = lib.mapAttrs (_: f: f baseDrv) passthru.tests; }; in lib.extendDerivation validity.handled ( { inherit meta; passthru = passthru'; } // passthru' ) baseDrv;
writeTextFile = { name, # the name of the derivation text, executable ? false, # run chmod +x ? destination ? "", # relative path appended to $out eg "/bin/foo" }: derivationWithMeta { inherit name text; passAsFile = [ "text" ];
builder = "${kaem}/bin/kaem"; args = [ "--verbose" "--strict" "--file" (builtins.toFile "write-text-file.kaem" ( '' target=''${out}''${destination} '' + lib.optionalString (builtins.dirOf destination == ".") '' mkdir -p ''${out}''${destinationDir} '' + '' cp ''${textPath} ''${target} '' + lib.optionalString executable '' chmod 555 ''${target} '' )) ];
PATH = lib.makeBinPath [ mescc-tools-extra ]; destinationDir = builtins.dirOf destination; inherit destination; };
writeText = name: text: writeTextFile { inherit name text; };
}