!tDnwWRNkmmYtMXfaZl:nixos.org

Nix Language

1874 Members
Nix programming language346 Servers

You have reached the beginning of time (for this room).


SenderMessageTime
19 Feb 2026
@shmwot:matrix.orgcatsarecute joined the room.19:04:50
@mattsturg:matrix.orgMatt Sturgeon
In reply to @tumble1999:matrix.org
Does custom type casting exist or is it just set to string with outPath attribute?

Generally speaking, nix doesn't have type casting. For interpolating values into strings ("${expr}" syntax), different types follow different rules:

  1. String values are interpolated as-is
  2. Path values are copied-to-store, and the resulting store path is interpolated (with context)
  3. Attrsets with a __toString function call that function and interpolate the result
  4. Attrsets with an outPath attribute interpolate that string.
  5. Other types typically raise an error

Examples in the wild: nixos options have a __toString function, which uses lib.showOption opt.loc internally; deprivations have an outPath, which is the store path the derivation will be installed to, once built.

20:23:54
@justinlime:matrix.justin-li.me@justinlime:matrix.justin-li.me joined the room.21:27:44
@justinlime:matrix.justin-li.me@justinlime:matrix.justin-li.me left the room.21:32:51
20 Feb 2026
@theonesock:matrix.ourplace.isTheOneSock joined the room.00:09:31
@phozzy:tchncs.dephozzy Are you looking for https://nickel-lang.org/ maybe? 07:17:02
@tumble1999:matrix.orgTumble
In reply to @phozzy:tchncs.de
Are you looking for https://nickel-lang.org/ maybe?
I wasn't looking for anything specific, I was just wondering if there was more than just outPath
08:28:40
@tumble1999:matrix.orgTumbleAlso is there nothing special about _type is that just a cosmetic thing that scrips can deal with however they want to?08:29:55
@sigmasquadron:matrix.orgFernando Rodrigues pretty sure the only attribute name that has special handling is outPath, and maybe pos? 09:57:27

Show newer messages


Back to Room ListRoom Version: 6