1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-27 05:29:46 +01:00
home-manager/tests/modules/misc
polykernel 32e433d07d
nix: add structural settings (#2718)
Nix permits user level configurations through ~/.config/nix/nix.conf that allow
customization of system-wide settings and behavior. This is beneficial in chroot
environments and for per-user configurations. System level Nix configurations in the
form of /etc/nix/nix.conf can be specified declaratively via the NixOS nix module but as
of currently no counter part exists in home-manager.

This PR is a port of the RFC42 implementation for the NixOS nix module[1]
to home-manager. Non-applicable options have been excluded and the config generation
backends have been tweaked to the backends offered by home-manager. A notable change
from the NixOS module is a mandatory option to specify the Nix binary corresponding
to the version "nix.conf" should be generated against. This is necessary because
the validation phase is dependent on the `nix show-config` subcommand on the host platform.
While it is possible to avoid validation entirely, the lack of type checking was deemed too significant.
In NixOs, the version information can be retrieved from the `package` option itself which
declares the Nix binary system-wide. However in home-manager, there is no pure way to
detect the system Nix version and what state version the "nix.conf" should be generated
against. Thus an option is used to overcome this limitation by forcing the user to
specify the Nix package. Note this interaction can still be automated by forwarding
the system-wide Nix package to the home-manager module if needed.

Three unit tests were added to test the module behavior for the empty settings, the example
settings and the example registry configurations respectively.

[1] - NixOS/nixpkgs#139075
2022-03-17 22:47:32 -04:00
..
debug tests: make enableBig an option 2022-01-02 10:36:52 +01:00
fontconfig fontconfig: disable multiple font packages test 2020-07-31 17:30:57 +02:00
gtk gtk: add cursor theme configuration (#2481) 2022-03-17 15:30:48 -04:00
nix nix: add structural settings (#2718) 2022-03-17 22:47:32 -04:00
numlock tests: add option test.stubs 2021-09-26 23:26:38 +02:00
pam pam: add yubico option 2021-12-16 19:46:47 +01:00
qt tests: add option test.stubs 2021-09-26 23:26:38 +02:00
xdg xdg: add XDG_*_HOME variables to systemd.user.sessionVariables (#2790) 2022-03-17 22:22:53 -04:00
xsession setxkbmap: reset options before setting new ones (#2160) 2021-07-11 21:15:18 -04:00