Configure nix settings (#257)

Only manage /etc/nix/nix.conf options based on nixpkgs options.
We cannot control nix-gc / nix-daemon services yet as they rely on users.
This commit is contained in:
Jean-François Roche 2025-08-21 00:24:02 +02:00 committed by GitHub
parent ba09b781b1
commit 3219a927e1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 42 additions and 1 deletions

View file

@ -7,6 +7,7 @@
imports =
[
./nginx.nix
./nix.nix
]
++
# List of imported NixOS modules
@ -15,6 +16,8 @@
"/misc/meta.nix"
"/security/acme/"
"/services/web-servers/nginx/"
# nix settings
"/config/nix.nix"
];
options =

View file

@ -0,0 +1,25 @@
{ lib, pkgs, ... }:
{
options = {
# options coming from modules/services/system/nix-daemon.nix that we cannot import just yet because it
# depends on users. These are the minimum options we need to be able to configure Nix using system-manager.
nix = {
enable = lib.mkOption {
type = lib.types.bool;
default = true;
description = ''
Whether to enable Nix.
Disabling Nix makes the system hard to modify and the Nix programs and configuration will not be made available by NixOS itself.
'';
};
package = lib.mkOption {
type = lib.types.package;
default = pkgs.nix;
defaultText = lib.literalExpression "pkgs.nix";
description = ''
This option specifies the Nix package instance to use throughout the system.
'';
};
};
};
}