diff options
| author | tv <tv@krebsco.de> | 2026-12-02 03:59:27 +0000 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-12-02 03:59:27 +0000 |
| commit | 6dbeee442a46469dca07e1b45c2f3ebe6b8e0c1a (patch) | |
| tree | 5f98442b659ec233fa2e4c7af652ba6170a776d1 | |
| parent | 3bcd7cfb246c84de600802b750157ae560a712c6 (diff) | |
lib.haskell.substitutePkgs: take attribute paths
{-pkg:flameshot-once.profiles.tv-} looked up an attribute named
flameshot-once.profiles.tv.
| -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 |
