|
|
|
@ -41,16 +41,18 @@ rec { |
|
|
|
|
let x = builtins.parseDrvName name; in "${x.name}-${suffix}-${x.version}"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Apply a function to each derivation and only to derivations in an attrset |
|
|
|
|
/* Apply a function to each derivation and only to derivations in an attrset. |
|
|
|
|
*/ |
|
|
|
|
mapDerivationAttrset = f: set: lib.mapAttrs (name: pkg: if lib.isDerivation pkg then (f pkg) else pkg) set; |
|
|
|
|
|
|
|
|
|
/* Set the nix-env priority of the package. |
|
|
|
|
*/ |
|
|
|
|
setPrio = priority: addMetaAttrs { inherit priority; }; |
|
|
|
|
|
|
|
|
|
/* Decrease the nix-env priority of the package, i.e., other |
|
|
|
|
versions/variants of the package will be preferred. |
|
|
|
|
*/ |
|
|
|
|
lowPrio = drv: addMetaAttrs { priority = 10; } drv; |
|
|
|
|
|
|
|
|
|
lowPrio = setPrio 10; |
|
|
|
|
|
|
|
|
|
/* Apply lowPrio to an attrset with derivations |
|
|
|
|
*/ |
|
|
|
@ -60,8 +62,7 @@ rec { |
|
|
|
|
/* Increase the nix-env priority of the package, i.e., this |
|
|
|
|
version/variant of the package will be preferred. |
|
|
|
|
*/ |
|
|
|
|
hiPrio = drv: addMetaAttrs { priority = -10; } drv; |
|
|
|
|
|
|
|
|
|
hiPrio = setPrio (-10); |
|
|
|
|
|
|
|
|
|
/* Apply hiPrio to an attrset with derivations |
|
|
|
|
*/ |
|
|
|
|