!tDnwWRNkmmYtMXfaZl:nixos.org

Nix Language

1906 Members
Nix programming language353 Servers

Load older messages


SenderMessageTime
14 May 2026
@lumi:the-apothecary.club@lumi:the-apothecary.club changed their profile picture.20:29:13
15 May 2026
@pixie:kludgecs.comfaye left the room.10:10:12
@erents:dapperepoging.nlerents joined the room.13:32:28
@lumi:the-apothecary.club@lumi:the-apothecary.club changed their profile picture.18:57:03
@lumi:the-apothecary.club@lumi:the-apothecary.club changed their display name from Gabe to Hazel.19:37:42
@me:caem.devcaem changed their profile picture.20:14:48
@lveneris:kludgecs.comlveneris joined the room.22:33:57
16 May 2026
@lumi:the-apothecary.club@lumi:the-apothecary.club changed their profile picture.13:24:42
@ashk3000:matrix.orgashk3000 joined the room.19:19:32
17 May 2026
@mrvandalo:terranix.org@mrvandalo:terranix.org left the room.09:02:20
@fuguesoft:matrix.orgfugue joined the room.11:56:00
@tuto_:matrix.orgtuto joined the room.13:44:09
@trudwin:matrix.orgtrudwin Hi. While working on escaping for the Nix language (for injected language support in NixOS/nix-idea, I noticed that you cannot add escape sequences after a single quote (') in indented strings. For example if you add ${ after ', a naive implementation would generate '''${, which is invalid inside indented strings. 13:45:24
@trudwin:matrix.orgtrudwin * Hi. While working on escaping for the Nix language (for injected language support in NixOS/nix-idea), I noticed that you cannot add escape sequences after a single quote (') in indented strings. For example if you add ${ after ', a naive implementation would generate '''${, which is invalid inside indented strings. 13:45:39
@trudwin:matrix.orgtrudwin Is there an idiomatic why to escape '${? I currently consider '$''\{ as best solution, as it seems to require the least amount of characters. Any other opinions? 13:49:47
@hexa:lossy.networkhexa
13:50:40
@hexa:lossy.networkhexa`'$${foo}'13:51:03
@trudwin:matrix.orgtrudwin Unfortunately, this pattern doesn't work for other escape sequences. So I guess I have to use something like ''\'''\r for them? 13:51:05
@hexa:lossy.networkhexaRedacted or Malformed Event13:51:06
@hsjobeki:matrix.orghsjobekihttps://nix.dev/manual/nix/2.21/language/values#type-string13:51:38
@trudwin:matrix.orgtrudwin But that would result in a different string, right? The $$ is becomes $$, but the string I am encoding has only one dolla sign. 13:52:06
@hsjobeki:matrix.orghsjobekiIt gets stripped afaik13:52:52
@hexa:lossy.networkhexa
nix-repl> ''${foo}''
"bar"

nix-repl> ''$${foo}''
"$\${foo}"

nix-repl> "$${foo}"   
"$\${foo}"
13:53:02
@hexa:lossy.networkhexaso confusing 🤪13:53:07
@hexa:lossy.networkhexain my memory it does get stripped, too13:53:25
@hsjobeki:matrix.orghsjobekiYeah it's super confusing 13:54:45
@trudwin:matrix.orgtrudwinNot as far as I remember it. 😄13:55:16
@hexa:lossy.networkhexa oh, it was '''${foo}' instead 13:56:15
@trudwin:matrix.orgtrudwin * But that would result in a different string, right? The $$ becomes $$, but the string I am encoding has only one dolla sign. 13:56:20
@hexa:lossy.networkhexa and "$${foo}" 13:56:38

Show newer messages


Back to Room ListRoom Version: 6