9c6ee729d6
GitOrigin-RevId: 6cee3b5893090b0f5f0a06b4cf42ca4e60e5d222
27 lines
778 B
Nix
27 lines
778 B
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
{
|
|
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.*
|
|
|
|
Whether to enable bcache support in the initrd.
|
|
'';
|
|
};
|
|
|
|
config = {
|
|
|
|
environment.systemPackages = [ pkgs.bcache-tools ];
|
|
|
|
services.udev.packages = [ pkgs.bcache-tools ];
|
|
|
|
boot.initrd.extraUdevRulesCommands = lib.mkIf (!config.boot.initrd.systemd.enable) ''
|
|
cp -v ${pkgs.bcache-tools}/lib/udev/rules.d/*.rules $out/
|
|
'';
|
|
|
|
boot.initrd.services.udev = lib.mkIf config.boot.initrd.services.bcache.enable {
|
|
packages = [ pkgs.bcache-tools ];
|
|
binPackages = [ pkgs.bcache-tools ];
|
|
};
|
|
};
|
|
}
|