nixos/clan: rename setDefaults to enableRecommendedDefaults

This commit is contained in:
Michael Hoang
2025-03-03 17:59:24 +09:00
committed by clan-bot
parent a08453ae7d
commit 35455afeb8
4 changed files with 14 additions and 5 deletions

View File

@@ -8,5 +8,5 @@
(modulesPath + "/profiles/minimal.nix")
];
clan.core.setDefaults = false;
clan.core.enableRecommendedDefaults = false;
}

View File

@@ -5,12 +5,21 @@
...
}:
{
options.clan.core.setDefaults = (lib.mkEnableOption "Clan defaults") // {
options.clan.core.enableRecommendedDefaults = lib.mkOption {
type = lib.types.bool;
description = ''
Whether to enable recommended default settings for NixOS by Clan.
These settings are entirely optional and are not necessary for using Clan.
This enables the new systemd in stage-1, disables some options that increase the closure size
and adds some extra packages for debugging like `tcpdump` and `dnsutils`.
'';
default = true;
example = false;
};
config = lib.mkIf config.clan.core.setDefaults {
config = lib.mkIf config.clan.core.enableRecommendedDefaults {
# Use systemd during boot as well except:
# - systems with raids as this currently require manual configuration: https://github.com/NixOS/nixpkgs/issues/210210
# - for containers we currently rely on the `stage-2` init script that sets up our /etc

View File

@@ -91,7 +91,7 @@
]
)
];
config = lib.mkIf config.clan.core.setDefaults {
config = lib.mkIf config.clan.core.enableRecommendedDefaults {
# conflicts with systemd-resolved
networking.useHostResolvConf = false;

View File

@@ -1,7 +1,7 @@
{ lib, config, ... }:
# Taken from:
# https://github.com/nix-community/srvos/blob/main/nixos/common/nix.nix
lib.mkIf config.clan.core.setDefaults {
lib.mkIf config.clan.core.enableRecommendedDefaults {
# Fallback quickly if substituters are not available.
nix.settings.connect-timeout = 5;