home-manager/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
..
dconf.nix dconf: remove gnidorah from maintainers/CODEOWNERS (#2586) 2021-12-25 00:28:37 -07:00
debug.nix debug: add module 2020-03-07 15:03:44 +01:00
fontconfig.nix fontconfig: only remove directory if it exists 2021-10-06 15:02:34 +02:00
gtk.nix gtk: add cursor theme configuration (#2481) 2022-03-17 15:30:48 -04:00
lib.nix Apply nixfmt on many files 2020-02-02 01:07:28 +01:00
news.nix fusuma: add module 2022-03-13 22:17:55 +01:00
nix.nix nix: add structural settings (#2718) 2022-03-17 22:47:32 -04:00
nixpkgs-disabled.nix nixpkgs-disabled: add module 2021-10-13 23:46:38 +02:00
nixpkgs.nix Replace usage of literalExample 2021-10-13 00:16:10 +02:00
numlock.nix Move platform check into modules 2021-07-18 20:43:22 +02:00
pam.nix pam: add yubico option 2021-12-16 19:46:47 +01:00
qt.nix Replace usage of literalExample 2021-10-13 00:16:10 +02:00
submodule-support.nix doc: surround name? with fancier characters 2019-09-01 21:28:40 +02:00
tmpfiles.nix Move platform check into modules 2021-07-18 20:43:22 +02:00
version.nix Switch to 22.05 as current development release 2021-11-25 22:29:49 +01:00
vte.nix vte: add module 2020-06-14 12:20:12 +02:00
xdg-desktop-entries.nix xdg-desktop-entries: adjust to API changes 2022-03-04 01:08:00 +01:00
xdg-mime-apps.nix Replace usage of literalExample 2021-10-13 00:16:10 +02:00
xdg-mime.nix Replace pkgs.hostPlatform by pkgs.stdenv.hostPlatform 2021-12-03 23:36:50 +01:00
xdg-system-dirs.nix Replace usage of literalExample 2021-10-13 00:16:10 +02:00
xdg-user-dirs.nix Move platform check into modules 2021-07-18 20:43:22 +02:00
xdg.nix xdg: add XDG_*_HOME variables to systemd.user.sessionVariables (#2790) 2022-03-17 22:22:53 -04:00