!tDnwWRNkmmYtMXfaZl:nixos.org

Nix Language

1688 Members
Nix programming language295 Servers

Load older messages


SenderMessageTime
18 Oct 2025
@turbio:matrix.orgturbio joined the room.00:22:00
@kevincox:matrix.org@kevincox:matrix.org left the room.10:22:56
@uvla:matrix.orguvla changed their display name from Uv La to uvla.13:51:48
@belligerent_engine:matrix.orgBelligerent Engine joined the room.17:32:07
@novedevo:matrix.orgDevon joined the room.22:57:11
19 Oct 2025
@cedricgc:matrix.orgcedricgc joined the room.03:36:39
@azahi:azahi.cc@azahi:azahi.cc left the room.15:47:15
20 Oct 2025
@flacks:matrix.orgflax changed their profile picture.04:36:57
@perpetrator1:matrix.org@perpetrator1:matrix.org changed their profile picture.11:19:01
@vlmutolo:matrix.org@vlmutolo:matrix.org left the room.15:54:23
21 Oct 2025
@perpetrator1:matrix.org@perpetrator1:matrix.org left the room.03:20:00
@xx0a_q:matrix.orgadam (moved to @adam:matrix.system72.dev) joined the room.11:47:17
22 Oct 2025
@0xcafca:matrix.org0xcafca changed their profile picture.10:21:40
@0xcafca:matrix.org0xcafca changed their profile picture.10:23:21
@emilazy:matrix.orgemilyis there a practical way to enumerate what builtins are available at the top-level scope?15:09:44
@emilazy:matrix.orgemily i.e. something that detects true but not tryEval 15:09:55
@emilazy:matrix.orgemily (preferably within-language, otherwise just… nix eval --expr foo works) 15:10:06
@emilazy:matrix.orgemilyI guess the list is small enough to special-case15:10:30
@sebaguardian:matrix.orgsebaguardian joined the room.15:52:28
@ramram.ink:matrix.orgramram.ink joined the room.15:57:02
@philiptaron:matrix.orgPhilip Taron (UTC-8) When I did this, @emily, I did it like this:

$ for n in $(nix-instantiate --strict --eval --json --expr 'builtins.attrNames builtins' | jq -r '.[]'); do nix-instantiate --parse --expr "$n" 2>/dev/null; done
abort
baseNameOf
break
builtins
derivation
derivationStrict
dirOf
false
fetchGit
fetchMercurial
fetchTarball
fetchTree
fromTOML
import
isNull
map
null
placeholder
removeAttrs
scopedImport
throw
toString
true
16:49:20
@philiptaron:matrix.orgPhilip Taron (UTC-8) When I did this, @emily , I did it like this:

$ for n in $(nix-instantiate --strict --eval --json --expr 'builtins.attrNames builtins' | jq -r '.[]'); do nix-instantiate --parse --expr "$n" 2>/dev/null; done
abort
baseNameOf
break
builtins
derivation
derivationStrict
dirOf
false
fetchGit
fetchMercurial
fetchTarball
fetchTree
fromTOML
import
isNull
map
null
placeholder
removeAttrs
scopedImport
throw
toString
true
16:49:33
@emilazy:matrix.orgemily it turns out you can use :env in the debugger 16:49:39
@emilazy:matrix.orgemilythough it's not very nice structured output16:49:45
@philiptaron:matrix.orgPhilip Taron (UTC-8) Yeah, I wanted to get something that I could run across Nix versions, so I biased towards "knowing" that builtins was the source of the top-level names. 16:50:56
@philiptaron:matrix.orgPhilip Taron (UTC-8) Yeah, I wanted to get something that I could run across Nix versions, so I biased towards "knowing" that builtins was the source of the top-level names. And definitely didn't need a pseudo-terminal, etc. 16:51:15
@philiptaron:matrix.orgPhilip Taron (UTC-8)
$ echo ':env' | nix eval --debugger --expr 'break 1'
info: breakpoint reached

Nix 2.31.2 debugger
Type :? for help.
Env level 0
builtins true false null fromTOML fetchTree fetchTarball fetchGit fetchMercurial scopedImport import isNull break abort throw derivationStrict placeholder baseNameOf dirOf removeAttrs map toString derivation



error:
       … while calling the 'break' builtin
         at «string»:1:1:
            1| break 1
             | ^

       error: breakpoint reached
huh
16:53:09
@philiptaron:matrix.orgPhilip Taron (UTC-8)
$ echo ':env' | nix eval --debugger --expr 'break 1' 2>/dev/null | rg 'Env level 0' -A1 | tail -1
builtins true false null fromTOML fetchTree fetchTarball fetchGit fetchMercurial scopedImport import isNull break abort throw derivationStrict placeholder baseNameOf dirOf removeAttrs map toString derivation
16:53:58
@emilazy:matrix.orgemily now can you explain why break isn't in there? 😆 19:15:19
@emilazy:matrix.orgemilyoh it is19:15:23

Show newer messages


Back to Room ListRoom Version: 6