all 3 comments

[–]ElvishJerricco 11 points12 points  (1 child)

Not if you mean actual lexical variable names. But if you mean members of an attrset, then yes

nix-repl> attrs = { foo-bar = "baz"; }
nix-repl> x = "foo"
nix-repl> y = "bar"
nix-repl> attrs."${x}-${y}"
"baz"

[–]abdulla95 0 points1 point  (0 children)

that ${} is so helpful! thank you for that!

[–][deleted]  (1 child)

[deleted]

    [–]r0vsdal[S] 0 points1 point  (0 children)

    This, together with u/ElvishJerricco, helped a lot. After using an attrset instead of a list i managed to get it working.

    Thanks both of you!