nixos/bcache: add a `boot.bcache.enable` kill switch

My system does not use `bcache` and I sould prever my `systemPackages`
not to have bcache tools.

The change does not change the default but proviced usual `enable` knob.

Changed files
+10 -4
nixos
doc
manual
release-notes
modules
tasks
+2
nixos/doc/manual/release-notes/rl-2311.section.md
···
- Certificate generation via the `security.acme` now limits the concurrent number of running certificate renewals and generation jobs, to avoid spiking resource usage when processing many certificates at once. The limit defaults to *5* and can be adjusted via `maxConcurrentRenewals`. Setting it to *0* disables the limits altogether.
+
- New `boot.bcache.enable` (default enabled) allows completely removing `bcache` mount support.
+
## Nixpkgs internals {#sec-release-23.11-nixpkgs-internals}
- The use of `sourceRoot = "source";`, `sourceRoot = "source/subdir";`, and similar lines in package derivations using the default `unpackPhase` is deprecated as it requires `unpackPhase` to always produce a directory named "source". Use `sourceRoot = src.name`, `sourceRoot = "${src.name}/subdir";`, or `setSourceRoot = "sourceRoot=$(echo */subdir)";` or similar instead.
+8 -4
nixos/modules/tasks/bcache.nix
···
-
{ config, lib, pkgs, ... }:
-
-
{
+
{ config, lib, pkgs, ... }: let
+
cfg = config.boot.bcache;
+
in {
+
options.boot.bcache.enable = lib.mkEnableOption (lib.mdDoc "bcache mount support") // {
+
default = true;
+
example = false;
+
};
options.boot.initrd.services.bcache.enable = lib.mkEnableOption (lib.mdDoc "bcache support in the initrd") // {
description = lib.mdDoc ''
*This will only be used when systemd is used in stage 1.*
···
'';
};
-
config = {
+
config = lib.mkIf cfg.enable {
environment.systemPackages = [ pkgs.bcache-tools ];