Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nixos/swraid: enable it by default #348134

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions nixos/doc/manual/release-notes/rl-2411.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,9 @@
Processes also now run as a dynamically allocated user by default instead of
root.

- Software raid is enabled by default now, and is controlled by `boot.swraid.enable`.
This was previously disabled in 23.11.

- The `mautrix-signal` module was adapted to incorporate the configuration rearrangement that resulted from the update to the mautrix bridgev2 architecture. Pre-0.7.0 configurations should continue to work.
In case you want to update your configuration make sure to check the NixOS manual.

Expand Down
7 changes: 2 additions & 5 deletions nixos/modules/tasks/swraid.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

mdadm_conf = config.environment.etc."mdadm.conf";

enable_implicitly_for_old_state_versions = lib.versionOlder config.system.stateVersion "23.11";

minimum_config_is_set = config_text:
(builtins.match ".*(MAILADDR|PROGRAM).*" mdadm_conf.text) != null;

Expand All @@ -31,7 +29,7 @@ in {
should detect it correctly in the standard installation
procedure.
'';
default = enable_implicitly_for_old_state_versions;
default = true;
defaultText = "`true` if stateVersion is older than 23.11";
};

Expand All @@ -43,8 +41,7 @@ in {
};

config = lib.mkIf cfg.enable {
warnings = lib.mkIf
( !enable_implicitly_for_old_state_versions && !minimum_config_is_set mdadm_conf)
warnings = lib.mkIf (!minimum_config_is_set mdadm_conf)
[ "mdadm: Neither MAILADDR nor PROGRAM has been set. This will cause the `mdmon` service to crash." ];

environment.systemPackages = [ pkgs.mdadm ];
Expand Down