uboot: (firmwareOdroidC2/C4) don't invoke patch tool, use patches = [] instead
https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L948 this can do it nicely. Signed-off-by: Anton Arapov <anton@deadbeef.mx>
This commit is contained in:
commit
56de2bcd43
30691 changed files with 3076956 additions and 0 deletions
43
nixos/modules/tasks/swraid.nix
Normal file
43
nixos/modules/tasks/swraid.nix
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
{ config, pkgs, lib, ... }: let
|
||||
|
||||
cfg = config.boot.initrd.services.swraid;
|
||||
|
||||
in {
|
||||
|
||||
options.boot.initrd.services.swraid = {
|
||||
enable = (lib.mkEnableOption "swraid support using mdadm") // {
|
||||
visible = false; # only has effect when the new stage 1 is in place
|
||||
};
|
||||
|
||||
mdadmConf = lib.mkOption {
|
||||
description = "Contents of <filename>/etc/mdadm.conf</filename> in initrd.";
|
||||
type = lib.types.lines;
|
||||
default = "";
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
environment.systemPackages = [ pkgs.mdadm ];
|
||||
|
||||
services.udev.packages = [ pkgs.mdadm ];
|
||||
|
||||
systemd.packages = [ pkgs.mdadm ];
|
||||
|
||||
boot.initrd.availableKernelModules = lib.mkIf (config.boot.initrd.systemd.enable -> cfg.enable) [ "md_mod" "raid0" "raid1" "raid10" "raid456" ];
|
||||
|
||||
boot.initrd.extraUdevRulesCommands = lib.mkIf (!config.boot.initrd.systemd.enable) ''
|
||||
cp -v ${pkgs.mdadm}/lib/udev/rules.d/*.rules $out/
|
||||
'';
|
||||
|
||||
boot.initrd.systemd = lib.mkIf cfg.enable {
|
||||
contents."/etc/mdadm.conf" = lib.mkIf (cfg.mdadmConf != "") {
|
||||
text = cfg.mdadmConf;
|
||||
};
|
||||
|
||||
packages = [ pkgs.mdadm ];
|
||||
initrdBin = [ pkgs.mdadm ];
|
||||
};
|
||||
|
||||
boot.initrd.services.udev.packages = lib.mkIf cfg.enable [ pkgs.mdadm ];
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue