mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-24 16:03:23 +00:00
160fb93fdc
This includes disabling some features in the initrd by default, this is only done when the new initrd is used. Namely, ext and bcache are disabled by default. bcache gets an own enable option while ext is detected like any other filesystem.
24 lines
665 B
Nix
24 lines
665 B
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
{
|
|
options.boot.initrd.services.bcache.enable = (lib.mkEnableOption "bcache support in the initrd") // {
|
|
visible = false; # only works with systemd stage 1
|
|
};
|
|
|
|
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 ];
|
|
};
|
|
};
|
|
}
|