!9IQChSjwSHXPPWTa:lix.systems

Lix

1125 Members
Lix user channel. Feel free to discuss on-topic issues here and give each other help. For matrix.to links to the rest of the Lix channels, see: https://wiki.lix.systems/books/lix-organisation/page/matrix-rooms305 Servers

Load older messages


SenderMessageTime
2 Feb 2026
@k900:0upti.meK900 Generally I'd say you probably just want to avoid doing that 12:18:46
@psentee:matrix.orgPsentee Yeah, I gave up flakes some time ago and I'm happier for that. Now I'm writing some tools on top of nix to remove some pain points / add some convenience in a non-flake workflow 12:20:10
@k900:0upti.meK900 Then you're not doing pure eval 12:21:28
@k900:0upti.meK900Technically12:21:35
@psentee:matrix.orgPsentee One feature of flakes I want to imitate is nix run flake#output injects system into the attribute path. I want this, but (1) more generalized (e.g. I'd want to read current system when loading npins to use its new nixpkgs-based fetching), (2) without having to enumerate all supported systems in my attrsets (which was a pain in flakes as well) 12:22:36
@raitobezarius:matrix.orgraitobezarius builtins.currentSystem returns that with non-flakes 12:24:09
@raitobezarius:matrix.orgraitobezarius(2) you can simply use a cross-compilation mechanism12:24:21
@psentee:matrix.orgPsentee Why nix eval --expr 'import ./. { system="aarch64-linux"; }' is pure (which means nix eval --expr "import ./. { system="$(nix config show system)"; }"is also pure), butnix eval --expr 'import ./.' --argstr system "$(nix config show system)"` is not? 12:25:09
@psentee:matrix.orgPsenteethis requires non-pure evaluation12:25:25
@k900:0upti.meK900 Do you care about that? 12:25:43
@psentee:matrix.orgPsentee * Why nix eval --expr 'import ./. { system="aarch64-linux"; }' is pure (which means nix eval --expr "import ./. { system="$(nix config show system)"; }"is also pure), butnix eval --expr 'import ./.' --argstr system "$(nix config show system)"\ is not? 12:25:43
@k900:0upti.meK900 There's no practical difference 12:25:49
@raitobezarius:matrix.orgraitobezariusIf you are using pure evaluation to prevent a set of exprs to access non-locked inputs or something, restricted-eval is a thing12:26:08
@raitobezarius:matrix.orgraitobezarius and you can control things with allowed-uris 12:26:13
@k900:0upti.meK900In most cases12:26:18
@psentee:matrix.orgPsentee Yes, I don't want the entire dep tree to be able to call builtins.getEnv and bake it into derivations. I want to specify the entry point, and have everything underneath pure eval 12:26:40
@k900:0upti.meK900 That's currently achievable with restricted-eval and I hope to eventually make it less jank 12:27:12
@raitobezarius:matrix.orgraitobezarius https://docs.lix.systems/manual/lix/2.90/command-ref/conf-file.html#conf-restrict-eval 12:27:42
@psentee:matrix.orgPsentee(Also, my understanding is that impure eval allows unpredictable results, AFAIR fetching without a hash was allowed?)12:27:45
@raitobezarius:matrix.orgraitobezariuseval-time fetching without pinning is possible, yes12:28:24
@psentee:matrix.orgPsenteeSo I want to have a parameterized entry point, but fully predictable evaluation afterwards (no env access, no unpinned fetching, etc). I just want to easily inject parameters into the top level. Hopefully without templating an entire Nix expression as a string12:30:57
@psentee:matrix.orgPsentee (Speaking of which, is ./${"/path/with/spaces and other \${funny characters"}"} the best way to write a path literal that will reliably escape anything that might occur in a path?) 12:39:43
@k900:0upti.meK900 Yeah that's something we want to eventually have a good way of doing in some capacity 12:41:24
@psentee:matrix.orgPsentee It's good there is a way, took me a while to figure out this trick;) 12:42:16
@psentee:matrix.orgPsenteeAnyway, thanks for the help – looks like currently the best approach to get what I want is to stitch together a call expression. Not great, but I can live with that. Looking forward to that future CLI!12:46:44
@k900:0upti.meK900I personally want something pledge-shaped for eval at some point in the future12:48:46
@psentee:matrix.orgPsentee(I'd offer to help if it only wasn't C++, Lix isn't exactly a beginner friendly project)12:49:03
@psentee:matrix.orgPsentee* (I'd offer to help if it only wasn't C++, Lix isn't exactly a beginner friendly codebase)12:49:21
@522_:catgirl.cloud0x4fbb09 it/its ⛯✇ΘΔpledge shaped in the cli or in nix code?12:50:16
@k900:0upti.meK900In Nix code12:50:27

Show newer messages


Back to Room ListRoom Version: 10