nix-community / nix-on-droid

Nix-enabled environment for your Android device. [maintainers=@t184256,@Gerschtli]
https://nix-on-droid.unboiled.info
MIT License
1.15k stars 65 forks source link

modules/nix: use structural `settings` (Nix RFC 42) #270

Open ShamrockLee opened 1 year ago

ShamrockLee commented 1 year ago

This patch ports the structural settings from nixos/nix-daemon (https://github.com/NixOS/nixpkgs/pull/139075) and adjust the description based on those from previous options and the Home Manager nix.settings option (https://github.com/nix-community/home-manager/pull/2718).

If applied, users could specify their nix.conf configuration in a structural way, using attribute names identical to the official documentation of Nix, and merge the corresponding attributes from different modules. We don't have to add or change any of the attributes manually when nix.conf configuration options are added / changed upstream given that the configuration format is kept consistent.

The specified configurations are automatically checked using the specified Nix package. The checks can be partially or fully opt out with the checkAllError and checkConfig options.

t184256 commented 11 months ago

Seems to function fine, please address the comments from the previous review.

ShamrockLee commented 11 months ago

Sorry, for late respond. I'm working on an oral presentation for a conference about Nix, and will not be responsive until August.

t184256 commented 11 months ago

Oh, sure, no rush, take your time (and consider sharing the talk =).

t184256 commented 4 months ago

Are you still interested in mainlining this?

ShamrockLee commented 4 months ago

Oh! I almost forgot about this one.

ShamrockLee commented 4 months ago

Since then, things like the Nix settings and Nix flake registries have been splitted from nix-daemon.nix to their own module file (nix.nix and nix-flakes.nix). It would be great to reuse them.

ShamrockLee commented 4 months ago

329 demonstrates the possible strategy to reuse the upstream macro files.