[Nix-dev] How to traverse "/nix-support/propagated-native-build-inputs" in nix ?

Volth volth at volth.com
Sun May 14 17:16:45 CEST 2017


Hi

I would like to get list of all propagated build inputs in nix

But the code like

```
      get-propagated-derivations = s:
        if (lib.isStorePath s) then
          if (builtins.pathExists
"${s}/nix-support/propagated-native-build-inputs") then
            lib.concatMap get-propagated-derivations (lib.splitString
" " (lib.fileContents
"${s}/nix-support/propagated-native-build-inputs"))
          else
            [s]
        else
          [s];

```

does not work becase builtins.pathExists throws with "cannot refer to
other paths".
lib.fileContents has no such problem but it throws unless the file exists.


More information about the nix-dev mailing list