diff options
Diffstat (limited to 'lib/haskell.nix')
| -rw-r--r-- | lib/haskell.nix | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/haskell.nix b/lib/haskell.nix index f87cfa76..09302a0c 100644 --- a/lib/haskell.nix +++ b/lib/haskell.nix @@ -5,8 +5,9 @@ with builtins; rec { # Derive a file by substituting - # "${pkgs.foo}/bin/foo" for each {-pkg-}"foo", and - # "${pkgs.bar}/bin/foo" for each {-pkg:bar-}"foo". + # "${pkgs.foo}/bin/foo" for each {-pkg-}"foo", + # "${pkgs.bar}/bin/foo" for each {-pkg:bar-}"foo", and + # "${pkgs.bar.baz}/bin/foo" for each {-pkg:bar.baz-}"foo". # If a package doesn't exist, a warning gets printed. substitutePkgs = name: { callsite ? null, pkgs, path }: let @@ -23,7 +24,7 @@ rec { pname = if elemAt parse 3 != null then elemAt parse 3 else exename; exename = elemAt parse 4; suffix = elemAt parse 5; - pkg = pkgs.${pname} or null; + pkg = lib.attrByPath (lib.splitString "." pname) null pkgs; substitute = if pkg != null then |
