| 16 Nov 2023 |
@olafklingt:matrix.org | In reply to @artturin:matrix.org
nix-shell --expr "with (import <nixpkgs> {}); (nixos { services.xserver.enable = true; }).config.system.build.nixos-install" -I nixpkgs=channel:nixos-unstable
however that only contains nixos-install
pkgs.nixos-install-tools aggregates all the install tools https://github.com/NixOS/nixpkgs/blob/master/pkgs/tools/nix/nixos-install-tools/default.nix
Instead of re-implement what the package is doing it would be better to add a argument to the package which will then be passed to the nixos call here https://github.com/NixOS/nixpkgs/blob/d6400c8a2a27e8ba20971d72c76793b7c684f9ec/pkgs/tools/nix/nixos-install-tools/default.nix#L13
thank you Artturin | 22:08:58 |
Artturin | It's possible to override the nixos argument of the package with a function and then discarding the {} part of nixos {}
$ nix-shell --expr "with (import <nixpkgs> {}); nixos-install-tools.override (old: { nixos = _: old.nixos { services.xserver.enable = true; }; })" -I nixpkgs=channel:nixos-unstable
| 22:10:00 |
Artturin | * It's possible to override the nixos argument of the package with a function and then discarding(not using) the {} part of nixos {}
$ nix-shell --expr "with (import <nixpkgs> {}); nixos-install-tools.override (old: { nixos = _: old.nixos { services.xserver.enable = true; }; })" -I nixpkgs=channel:nixos-unstable
| 22:10:42 |
Artturin | So a adding a new argument isn't needed if you're okay with that trick | 22:12:28 |
@olafklingt:matrix.org | what is the _: syntax? in nixos = _: old | 22:16:36 |
Alex | In reply to @olafklingt:matrix.org what is the _: syntax? in nixos = _: old _: old is a function that ignores its argument and returns old | 22:17:10 |
Artturin | In reply to @olafklingt:matrix.org what is the _: syntax? in nixos = _: old (the _ can be anything) | 22:17:30 |
@olafklingt:matrix.org | to avoid the need to merge options? | 22:17:53 |
Artturin | No
nix-repl> nixos1 = _: nixos { services.xserver.enable = true; }
nix-repl> nixos2 = nixos { services.xserver.enable = true; }
nix-repl> nixos1 {}
<...works>
nix-repl> nixos2 {}
error: attempt to call something which is not a function but a set
at «string»:1:1:
1| nixos2 {}
| ^
| 22:19:58 |
Artturin | in https://github.com/NixOS/nixpkgs/blob/d6400c8a2a27e8ba20971d72c76793b7c684f9ec/pkgs/tools/nix/nixos-install-tools/default.nix#L13 the package will call the argument nixos with {} which would fail if the argument wasn't a function | 22:20:55 |
Artturin | by adding _: we pretend it's still the original nixos argument which would not error when called with a argument({}) | 22:21:57 |
Artturin | * by adding _: we pretend it's still the original nixos argument which would not error when called with a argument({}) | 22:22:04 |
Artturin | the _ is just a convention for the naming of arguments which will not be used | 22:22:45 |
Artturin | https://nixos.org/manual/nix/stable/language/constructs.html#functions if you need more info on functions | 22:23:31 |
@olafklingt:matrix.org | thank you but we should move this elsewhere | 22:25:14 |
Artturin | In reply to @ryantm:matrix.org Yeah, haven't had a chance to address those comments. The inotify stuff is something I'm not particularly familiar with. Posted a inotify suggestion https://github.com/NixOS/nixpkgs/pull/108063#discussion_r1396461303 | 22:50:17 |
| 17 Nov 2023 |
asymmetric | In reply to @infinisil:matrix.org asymmetric: Ping regarding the transfer of nixdoc done, sorry for the delay. i've added you as one of the admins, i can demote myself in a few days | 15:09:05 |
asymmetric | has anyone had a chance to look at this? https://github.com/NixOS/nix.dev/pull/797 | 16:23:05 |
infinisil | asymmetric: No worries, thanks! | 16:46:22 |
fricklerhandwerk | In reply to @asymmetric:matrix.dapp.org.uk has anyone had a chance to look at this? https://github.com/NixOS/nix.dev/pull/797 Ah yes thanks for the ping. I had an unsent review… | 17:47:28 |
| 18 Nov 2023 |
| danielsidhion joined the room. | 04:05:50 |
| danielsidhion changed their display name from Daniel Sidhion to danielsidhion. | 04:08:31 |
danielsidhion | Hey folks, I've been meaning to join one of the documentation meetings and finally had time to join last thursday, but couldn't because I wasn't let in the room. Not sure if I got the time wrong or something else. Meetings happen at 15:00 UTC, is that correct? If so, anything else I should do/ask to be able to join another meeting in the future? | 04:25:45 |
infinisil | danielsidhion: Which meeting link did you try to join? | 04:50:35 |
infinisil | danielsidhion: Make sure it's the current one, linked in this room's topic, and the calendar | 04:51:03 |
danielsidhion | In reply to @infinisil:matrix.org danielsidhion: Which meeting link did you try to join? I followed the link from here: https://github.com/NixOS/nix.dev/tree/master/maintainers which points to https://meet.jit.si/nix-documentation Looks like it's a different link from this room's topic, so I'm glad I joined matrix at least 🥲 | 14:12:22 |
infinisil | danielsidhion: Oh damn, that should be fixed, nice catch! | 14:33:17 |
danielsidhion | https://github.com/NixOS/nix.dev/pull/801 | 15:45:11 |
infinisil | asymmetric: Would you still want to review nixdoc PRs? | 22:05:59 |
infinisil | If so, I'm doing a few: https://github.com/nix-community/nixdoc/pulls/infinisil | 22:06:22 |