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 | 4a9590e4816199b7586a6351cd3dd4d1b2e64754 (patch) | |
| tree | 00c77cc9a29801417381f9f41d1c82c970c61c11 /lib | |
| parent | ee7741a9a3cef6c391856ce704d576ff16f9cb79 (diff) | |
lib.haskell.substitutePkgs: take attribute paths
{-pkg:flameshot-once.profiles.tv-} looked up an attribute named
flameshot-once.profiles.tv.
Diffstat (limited to 'lib')
| -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 |
