mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-15 22:36:23 +01:00
e9207b0501
These options were missed in NixOS/nixpkgs#226237, but they all were specifically added for systemd stage-1.
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 ];
|
|
};
|
|
};
|
|
}
|