summaryrefslogtreecommitdiffstats
path: root/lib/haskell.nix
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-12-02 03:59:27 +0000
committertv <tv@krebsco.de>2026-12-02 03:59:27 +0000
commit6dbeee442a46469dca07e1b45c2f3ebe6b8e0c1a (patch)
tree5f98442b659ec233fa2e4c7af652ba6170a776d1 /lib/haskell.nix
parent3bcd7cfb246c84de600802b750157ae560a712c6 (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/haskell.nix')
-rw-r--r--lib/haskell.nix7
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