22 Sep 2024 |
cafkafk | * The reason you can't just use import ./my-script.nix is because you're not specifying the pkgs attribute | 09:31:44 |
cafkafk | * The reason you can't just use import ./my-script.nix is because you're not specifying the pkgs attribute as an argument | 09:32:05 |
aos | What are the odds that we're both answering this question around the same time haha. Your answer is more thorough cafkafk thanks. I do want to add some links in case it's helpful: https://nix.dev/manual/nix/2.18/language/builtins.html?highlight=import#builtins-import and https://nixos.org/manual/nixos/stable/#sec-writing-modules | 09:33:19 |
cafkafk | In reply to @aos1:matrix.org What are the odds that we're both answering this question around the same time haha. Your answer is more thorough cafkafk thanks. I do want to add some links in case it's helpful: https://nix.dev/manual/nix/2.18/language/builtins.html?highlight=import#builtins-import and https://nixos.org/manual/nixos/stable/#sec-writing-modules Hehe, thanks :p | 09:33:35 |
cafkafk | Also if you do wanna evaluate something like it's a NixOS module instead of using import , I'm pretty sure you can use lib.evalModules to get something like imports | 09:34:40 |
cafkafk | ohh also, turns out import isn't technically a keyword, but a builtin ๐
nix-repl> import = x: x + 1
nix-repl> import 10
11
| 09:37:02 |
| @rayne:spooky.computer left the room. | 10:25:42 |
| caem changed their profile picture. | 19:34:01 |
23 Sep 2024 |
Kamilla 'ova | In reply to@cafkafk:gitter.im
ohh also, turns out import isn't technically a keyword, but a builtin ๐
nix-repl> import = x: x + 1
nix-repl> import 10
11
null = "definitely not null" moment | 02:48:22 |
cafkafk | I think it's a good argument for always using builtins.<thing> which I haven't managed to reassign (yet) | 02:50:10 |
cafkafk | okay well you can reassign builtins but | 02:50:22 |
cafkafk | * I think it's a good argument for always using builtins.<thing> which I haven't managed to reassign (yet) | 02:51:17 |
| RZ_MJ left the room. | 07:33:37 |
| Federico Damiรกn Schonborn joined the room. | 12:47:10 |
| elikoga joined the room. | 15:29:22 |
| BeLeap changed their profile picture. | 20:30:03 |
| BeLeap changed their display name from beleap to BeLeap. | 20:30:18 |
| BeLeap changed their profile picture. | 20:33:08 |
| caem changed their profile picture. | 21:57:51 |
24 Sep 2024 |
| kuznero joined the room. | 09:45:03 |
@memegames99:matrix.org | In reply to @cafkafk:gitter.im
ohh also, turns out import isn't technically a keyword, but a builtin ๐
nix-repl> import = x: x + 1
nix-repl> import 10
11
very cool | 10:14:22 |
| keithhub joined the room. | 18:04:56 |
| Mel joined the room. | 19:00:58 |
| mei ๐& changed their profile picture. | 23:24:59 |
25 Sep 2024 |
| luna-null changed their display name from luna-null to Autumn. | 06:39:15 |
Artturin | arch = builtins.getAttr stdenvNoCC.hostPlatform.system {
x86_64-linux = "x64";
x86-linux = "x86";
};
vs
arch =
{
x86_64-linux = "x64";
x86-linux = "x86";
}
."${stdenvNoCC.hostPlatform.system}";
| 20:55:59 |
Artturin | Any perf diff? | 20:56:31 |
emily | hm, function call vs. string interpolation maybe? | 20:57:37 |
Artturin | $ diff stats-simple-builtin.json stats-simple-interpolation.json
2c2
< "cpuTime": 0.011803999543190002,
---
> "cpuTime": 0.009681999683380127,
10c10
< "totalBytes": 10416
---
> "totalBytes": 10432
17,18c17,18
< "nrAvoided": 4,
< "nrExprs": 59,
---
> "nrAvoided": 3,
> "nrExprs": 58,
23,24c23,24
< "nrPrimOpCalls": 1,
< "nrThunks": 2,
---
> "nrPrimOpCalls": 0,
> "nrThunks": 1,
41,42c41,42
< "bytes": 3072,
< "number": 128
---
> "bytes": 3048,
> "number": 127
(ignore cpu time)
| 21:08:33 |
Artturin | Download image.png | 21:09:53 |