!avYyleMexqjFHoqrME:nixos.org

Nix Documentation

398 Members
This is the official channel for documentation in the Nix ecosystem. The documentation team meets here. More information: https://nixos.org/community/teams/documentation Video conference: https://jitsi.lassul.us/nix-documentation Meeting notes scratch pad: https://pad.lassul.us/p-Y8MjU2SdSD5qO1fnpCPA Past meeting notes: https://discourse.nixos.org/search?q=documentation%20team%20meeting%20order%3Alatest 75 Servers

You have reached the beginning of time (for this room).


SenderMessageTime
16 Nov 2023
@artturin:matrix.orgArtturin
In reply to @olafklingt:matrix.org

i am trying to react to fricklerhandwerk comment in a pr.

but i am stuck.

I am wondering how one could pass a configuration option to

$ nix-shell -p nixos-install-tools -I nixpkgs=channel:nixos-21.05

so that xserverEnabled is true independent from the host configuration. so that it is passed to the script here or rather here to be more precise.

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

22:06:20
@olafklingt:matrix.org@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:matrix.orgArtturin

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:matrix.orgArtturin *

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:matrix.orgArtturinSo a adding a new argument isn't needed if you're okay with that trick22:12:28
@olafklingt:matrix.org@olafklingt:matrix.org what is the _: syntax? in nixos = _: old 22:16:36
@alex:tunstall.xyzAlex
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

Show newer messages


Back to Room ListRoom Version: 6