2022-04-16 21:46:32 +02:00
|
|
|
{ config, lib, pkgs, ... }:
|
2014-11-10 22:09:34 +01:00
|
|
|
|
|
|
|
{
|
2022-08-29 19:33:50 +02:00
|
|
|
options.boot.initrd.services.bcache.enable = (lib.mkEnableOption (lib.mdDoc "bcache support in the initrd")) // {
|
2022-04-16 21:46:32 +02:00
|
|
|
visible = false; # only works with systemd stage 1
|
|
|
|
};
|
2014-11-10 22:09:34 +01:00
|
|
|
|
2022-04-16 21:46:32 +02:00
|
|
|
config = {
|
2014-11-10 22:09:34 +01:00
|
|
|
|
2022-04-16 21:46:32 +02:00
|
|
|
environment.systemPackages = [ pkgs.bcache-tools ];
|
2017-06-01 22:45:41 +02:00
|
|
|
|
2022-04-16 21:46:32 +02:00
|
|
|
services.udev.packages = [ pkgs.bcache-tools ];
|
2014-11-10 22:09:34 +01:00
|
|
|
|
2022-04-16 21:46:32 +02:00
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
};
|
2014-11-10 22:09:34 +01:00
|
|
|
}
|