fix scripts/update to not fail because of linuxPackages
This commit is contained in:
14
impure.nix
14
impure.nix
@@ -63,8 +63,20 @@ let
|
||||
|
||||
pkgs = mkPkgs {};
|
||||
|
||||
subAttrs = attrs: lib.filterAttrs (name: value: builtins.isAttrs value) attrs;
|
||||
# subAttrNames :: AttrSet -> [ String ]
|
||||
# returns the names of all items in `attrs` which are themselves attrsets.
|
||||
# presumably, this is the list of items which we may wish to descend into.
|
||||
subAttrNames = attrs: builtins.attrNames (subAttrs attrs);
|
||||
subAttrs = attrs: lib.filterAttrs
|
||||
(name: value:
|
||||
let
|
||||
# many attributes in the `pkgs` set do not evaluate (even `pkgs.sane`, thanks to e.g. linuxPackages).
|
||||
# wrap in `tryEval` to deal with that, and not descend into such attributes.
|
||||
isAttrs = builtins.tryEval (builtins.isAttrs value);
|
||||
in
|
||||
isAttrs.success && isAttrs.value
|
||||
)
|
||||
attrs;
|
||||
|
||||
# given the path to a package, and that package, returns a list of all attr-paths (stringified)
|
||||
# which should be updated as part of that package (including the package in question).
|
||||
|
Reference in New Issue
Block a user