From 6dbeee442a46469dca07e1b45c2f3ebe6b8e0c1a Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 2 Dec 2026 03:59:27 +0000 Subject: lib.haskell.substitutePkgs: take attribute paths {-pkg:flameshot-once.profiles.tv-} looked up an attribute named flameshot-once.profiles.tv. --- lib/haskell.nix | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'lib/haskell.nix') 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 -- cgit v1.3.1