!avYyleMexqjFHoqrME:nixos.org

Nix Documentation

425 Members
Discussion about documentation improvements around the Nix ecosystem84 Servers

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


SenderMessageTime
4 Dec 2023
@ibizaman:matrix.orgibizaman joined the room.17:42:34
5 Dec 2023
@federicodschonborn:matrix.org@federicodschonborn:matrix.org changed their profile picture.00:38:12
@bzzm3r:matrix.org@bzzm3r:matrix.org hey docs team, i'm continuing to dig deep. currently just finished making my own mkShell implementation that isn't "bash focused" ([this SO answer]((per: https://stackoverflow.com/a/71112117/3486684)) partially gave me the hint, but also motivated by wanting to not use direnv) 05:15:44
@bzzm3r:matrix.org@bzzm3r:matrix.orgI've been collating various little fixes/clarifications to the stdenv chapter as i did this, so i'll probably PR them all for consideration too05:16:25
@bzzm3r:matrix.org@bzzm3r:matrix.org one question I am left with, ultimately, however is: why env vars? why do we end up storing stuff like builder, shellHook, *Phase as environment variables for shells? 05:17:04
@bzzm3r:matrix.org@bzzm3r:matrix.orgwhy not something less volatile/touchy? for example: files. files in the store? 05:17:48
@bzzm3r:matrix.org@bzzm3r:matrix.org * hey docs team, i'm continuing to dig deep. currently just finished making my own mkShell implementation that isn't "bash focused" (this SO answer partially gave me the hint, but also motivated by wanting to not use direnv) 05:25:09
@bzzm3r:matrix.org@bzzm3r:matrix.org

if we had a suitable "arithmetic" for "environment variable files", would we be able to replace env vars with such files? such an "arithmetic" i suppose would consist of operations like:

  • merging two environment variables: most of the times, this will be an 'override' operation depending on the "type" of the environment variable (much like what happens in attribute sets, heh...oh wait...
05:26:19
@bzzm3r:matrix.org@bzzm3r:matrix.org sorry, instead of files, why not store "environment variables" in a nix expression (which i guess is stored in a file) which produces an attribute set, whose attributes are the environment variables in a given attribute? 05:27:09
@bzzm3r:matrix.org@bzzm3r:matrix.org

okay, so with depending on the type of the environment variable (perhaps set by the user?) we'd have operations such as:

  • overriding (i.e. where envVarA * envVarB == envVarB)
  • concatenating (i.e. where envVarA * envVarB == envVarA + envVarB)
  • structural(?) merging, i.e. where envVarA * envVarB == { A = envVarA; B = envVarB }
  • list(?) merging, i.e. where envVarA * envVarB == [ envVarA envVarB ]

and these operations would help us "join" environments (attribute sets whose attributes are environment variables)?

05:33:31
@bzzm3r:matrix.org@bzzm3r:matrix.org *

okay, so with on the type of the environment variables (perhaps set by the user?) involved we'd have operations such as:

  • overriding (i.e. where envVarA * envVarB == envVarB)
  • concatenating (i.e. where envVarA * envVarB == envVarA + envVarB)
  • structural(?) merging, i.e. where envVarA * envVarB == { A = envVarA; B = envVarB }
  • list(?) merging, i.e. where envVarA * envVarB == [ envVarA envVarB ]

and these operations would help us "join" environments (attribute sets whose attributes are environment variables)?

05:33:57
@bzzm3r:matrix.org@bzzm3r:matrix.org *

okay, so with on the type of the environment variables (perhaps set by the user?) involved we'd have operations such as:

  • overriding (i.e. where envVarA * envVarB == envVarB)
  • string concatenation (i.e. where envVarA * envVarB == envVarA + envVarB)
  • attribute set union, i.e. where envVarA * envVarB == { A = envVarA; B = envVarB }
  • list concatenation, i.e. where envVarA * envVarB == [ envVarA envVarB ]

and these operations would help us "join" environments (attribute sets whose attributes are environment variables)?

05:35:33

Show newer messages


Back to Room ListRoom Version: 6