00:25
rajivr has quit [Quit: Connection closed for inactivity]
00:38
<
Profpatsch >
puck: how are you so cursed
00:59
rajivr has joined #nix-lang
05:22
ddellacosta has quit [Ping timeout: 246 seconds]
08:36
kalbasit_ has quit [Ping timeout: 240 seconds]
08:53
cfinch has joined #nix-lang
09:04
<
puck >
Profpatsch: built in fuzzer
09:04
<
puck >
it's how i am so soft
09:05
<
puck >
and also good at finding weird edge cases
09:37
cfinch has quit [Read error: Connection reset by peer]
09:37
cfinch has joined #nix-lang
10:02
qyliss has quit [Quit: bye]
10:10
<
infinisil >
Hah nice
10:14
qyliss has joined #nix-lang
10:34
<
Profpatsch >
fuzzy llama funny llama llama in pyjama llama llama llama duck
12:43
__monty__ has joined #nix-lang
13:39
WilliButz has quit [Remote host closed the connection]
13:39
WilliButz has joined #nix-lang
13:51
cfinch has quit [Ping timeout: 256 seconds]
13:55
Dotz0cat has quit [Ping timeout: 264 seconds]
14:44
ddellacosta has joined #nix-lang
14:45
tilpner has joined #nix-lang
15:06
<
Profpatsch >
infinisil: What’s the best way to compare if two attrsets have the same keys?
15:07
<
infinisil >
Probably == on attrNames
15:08
<
Profpatsch >
infinisil: Ah, right, wrong question
15:09
<
Profpatsch >
I have one list of keys (not generated by attrNames) and an attrs
15:09
<
Profpatsch >
And I want to check if attrs has exactly these keys
15:09
<
infinisil >
Then I guess == between the list you have and the attrNames of the attrset :)
15:09
<
Profpatsch >
but I don’t know the sort order of attrNames
15:09
<
Profpatsch >
So I need to sort both first?
15:10
<
infinisil >
Ah attrNames is always sorted
15:10
<
infinisil >
(so if your list comes from somewhere other than attrNames you need to sort it first)
15:11
<
Profpatsch >
infinisil: is `builtins.sort lessThan` the same sorting?
15:11
<
Profpatsch >
oki, thx
15:12
<
Profpatsch >
mapIfAttrs = attrKeys: f: attrs:
15:12
<
Profpatsch >
# lib.attrNames is always sorted like (lib.sort lib.lessThan)
15:12
<
Profpatsch >
if (lib.sort lib.lessThan attrKeys) == (lib.attrNames attrs)
15:13
<
Profpatsch >
then f attrs
15:13
<
Profpatsch >
else attrs;
15:14
<
Profpatsch >
helpful for recursive mapping
15:14
<
Profpatsch >
lib.mapAttrsRecursive
15:14
<
Profpatsch >
(_path: attrs: mapIfAttrs [ "_configVariable" ] transformConfigVariable attrs)
16:09
ddellacosta has quit [Ping timeout: 256 seconds]
16:33
kalbasit has joined #nix-lang
16:51
<
Profpatsch >
I forgot again, is there a way to go from a "./foo.nix" string to an absolute path object?
16:52
<
lukegb >
like the (./. + "/" + "./foo.nix") magic
16:52
<
lukegb >
with more parens or something
16:53
<
Profpatsch >
lukegb: yeah, but holy hell
16:53
<
Profpatsch >
nix-repl> ./. + "/" + "./default.nix"
16:53
<
Profpatsch >
/home/philip/vuizvui./default.nix
16:53
<
Profpatsch >
nix-repl> ./. + ("/" + "./default.nix")
16:53
<
Profpatsch >
/home/philip/vuizvui/default.nix
16:57
<
infinisil >
> /. + "/default.nix"
16:57
<
{^_^} >
/default.nix
16:58
<
infinisil >
> ./. + "/default.nix"
16:58
<
{^_^} >
/var/lib/nixbot/state/nixpkgs/default.nix
16:58
<
infinisil >
> ./. + "./default.nix"
16:58
<
{^_^} >
/var/lib/nixbot/state/nixpkgs./default.nix
17:06
<
Profpatsch >
> (x: x) ? foo
17:06
<
Profpatsch >
trivially true!
17:06
<
Profpatsch >
But completely unhelpful
17:24
Dotz0cat has joined #nix-lang
17:45
rajivr has quit [Quit: Connection closed for inactivity]
17:55
<
puck >
> import (builtins.toFile "./default.nix")
17:55
<
{^_^} >
cannot coerce the partially applied built-in function 'toFile' to a string, at (string):460:1
17:55
<
puck >
> import (builtins.toFile "foo.nix" "./default.nix")
17:55
<
{^_^} >
cannot import '/nix/store/80pw7ps5py3bj1cl683pgcc5y9yar65b-foo.nix', since path '/nix/store/80pw7ps5py3bj1cl683pgcc5y9yar65b-foo.nix' is not valid, at (string):460:1
17:55
<
puck >
oh, huh, that doesn't quite work, lmao
17:55
<
puck >
(outputs /nix/store/default.nix)
18:39
ddellacosta has joined #nix-lang
20:40
ddellacosta has quit [Quit: WeeChat 2.8]
20:43
ddellacosta has joined #nix-lang
22:28
tilpner_ has joined #nix-lang
22:28
tilpner has quit [Remote host closed the connection]
22:28
tilpner_ is now known as tilpner
22:51
__monty__ has quit [Quit: leaving]
23:25
ddellacosta has quit [Ping timeout: 260 seconds]