nixos-lib/lib/derivations.nix
Antoine Viallon 8f4c49f955
[Lib/Derivations] init with isBroken helper
Returns true if the parameter is not a derivation or if trying to
evaluate the derivation would fail.
2024-05-02 16:16:52 +02:00

15 lines
263 B
Nix

{lib, myLib, ...}:
with lib;
rec {
isBroken = x:
let
tryX = builtins.tryEval x;
in
if
tryX.success && (isDerivation tryX.value)
then
tryX.value.meta.insecure || tryX.value.meta.broken
else
true
;
}