!9IQChSjwSHXPPWTa:lix.systems

Lix

1087 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-rooms290 Servers

Load older messages


SenderMessageTime
28 Oct 2025
@somasis:matrix.orgsomasis didn't know that flag existed, but same result, builtins.currentSystem gives "x86_64-linux" :/ 14:23:49
@jappie:jappie.devjappie
$> nix repl --pure-eval
Lix 2.93.3
Type :? for help.
nix-repl> builtins.currentSystem
error: attribute 'currentSystem' missing
       at «string»:1:10:
            1| builtins.currentSystem
             |          ^

nix-repl>
14:24:21
@somasis:matrix.orgsomasis huh... 14:24:32
@somasis:matrix.orgsomasis hmm okay that's not good 14:24:39
@somasis:matrix.orgsomasis hmm okay that's not good lol 14:24:41
@somasis:matrix.orgsomasis I didn't think nix repl -f . would cause that to differ, yet it does 14:25:17
@somasis:matrix.orgsomasis I didn't think nix repl -f . while in my config directory would cause that to differ, yet it does 14:25:24
@hexa:lossy.networkhexaI suppose accessing the filesystem like that is impure, that's why nix copies flake repos to the store before evaling 😄 14:26:44
@hexa:lossy.networkhexa* I suppose accessing the filesystem like that is impure, and that's why nix copies flake repos to the store before evaling 😄 14:26:54
@somasis:matrix.orgsomasis ah, yeah I guess it would have to do with that 14:27:15
@hexa:lossy.networkhexacan you say why you need a pure repl?14:27:37
@ekler:feel-co.orgekler
•  --file ⟨#opt-file⟩ / -f file Interpret installables ⟨../../command-ref/new-cli/nix.md#installables⟩ as attribute paths relative to the Nix expression stored in file. If file is the character -, then a Nix expression will be read from standard input. Implies --impure.
14:27:41
@hexa:lossy.networkhexa

Implies --impure.

14:27:56
@hexa:lossy.networkhexaright at the very end14:28:01
@ekler:feel-co.orgekler

yes, that's my point

14:28:14
@somasis:matrix.orgsomasis oops :) 14:28:35
@somasis:matrix.orgsomasis today I've been playing around with trying to eliminate impurities from my config without using flakes. I've gotten there by trying nix flake check into doing its thing with a minimal flake.nix ({ outputs = import ./ {}; } and a well-written default.nix), but I wanted to poke around at it some more in nix repl 14:29:47
@somasis:matrix.orgsomasis today I've been playing around with trying to eliminate impurities from my config without using flakes. I've gotten there and eliminated impurities by tricking nix flake check into doing its thing with a minimal flake.nix ({ outputs = import ./ {}; } and a well-written default.nix), but I wanted to poke around at it some more in nix repl 14:30:04
@somasis:matrix.orgsomasis I guess there's still not reallly a way to actually do pure evaluation on a path from within the repl without flakes then... doing nix store add-path ~/src/puter and trying nix repl --pure-eval and import /nix/store/jldwja0ddd64hawb7qahhgknws11i1iy-puter, despite being a store path, gives the "access to absolute path ... is forbidden in pure eval mode" error 14:52:11
@somasis:matrix.orgsomasis I guess there's still not reallly a way to actually do pure evaluation on a path from within the repl without flakes then... doing nix store add-path ~/src/puter and trying nix repl --pure-eval and :l /nix/store/jldwja0ddd64hawb7qahhgknws11i1iy-puter, despite being a store path, gives the "access to absolute path ... is forbidden in pure eval mode" error 14:52:33
@yuka:yuka.devYureka (she/her)you can do builtins.fetchGit15:05:24
@yuka:yuka.devYureka (she/her)with a rev15:05:26
@yuka:yuka.devYureka (she/her)on a local repo15:05:47
@somasis:matrix.orgsomasis aha, that does work :) 15:07:41
@yuka:yuka.devYureka (she/her)

for example:

nix repl --pure-eval --expr "import (builtins.fetchGit { url = ./.; rev = \"$(git rev-parse HEAD)\"; } + "/flake.nix")"
15:09:43
@yuka:yuka.devYureka (she/her) *

for example:

nix repl --pure-eval --expr "import (builtins.fetchGit { url = ./.; rev = \"$(git rev-parse HEAD)\"; } + \"/flake.nix\")"
15:10:02
@yuka:yuka.devYureka (she/her) *

for example:

nix repl --pure-eval --expr "import (builtins.fetchGit { url = ./.; rev = \"$(git rev-parse HEAD)\"; } + \"/flake.nix\")"
15:10:07
@yuka:yuka.devYureka (she/her) *

for example:

nix repl --pure-eval --expr "import (builtins.fetchGit { url = ./.; rev = \"$(git rev-parse HEAD)\"; } + \"/flake.nix\")"
15:10:10
@yuka:yuka.devYureka (she/her) *

for example:

nix repl --pure-eval \
  --expr "import (builtins.fetchGit { url = ./.; rev = \"$(git rev-parse HEAD)\"; } + \"/flake.nix\")"
15:10:19
@raitobezarius:matrix.orgraitobezariusanother advice is that restricted eval is probably a better start than pure eval15:16:40

Show newer messages


Back to Room ListRoom Version: 10