From b77d166b175baebacb7998fe73f3ea4f0d5a7292 Mon Sep 17 00:00:00 2001 From: Luca Bruno Date: Mon, 10 Nov 2014 22:09:34 +0100 Subject: [PATCH] nixos: move bcache udev rule in a new bcache.nix module --- nixos/modules/module-list.nix | 1 + nixos/modules/system/boot/stage-1.nix | 1 - nixos/modules/tasks/bcache.nix | 11 +++++++++++ 3 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 nixos/modules/tasks/bcache.nix diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index a709ffa2e2e9..c6187125abbf 100755 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -360,6 +360,7 @@ ./system/boot/tmp.nix ./system/etc/etc.nix ./system/upstart/upstart.nix + ./tasks/bcache.nix ./tasks/cpu-freq.nix ./tasks/encrypted-devices.nix ./tasks/filesystems.nix diff --git a/nixos/modules/system/boot/stage-1.nix b/nixos/modules/system/boot/stage-1.nix index 2a0dd005e494..33c9a70eb1b2 100644 --- a/nixos/modules/system/boot/stage-1.nix +++ b/nixos/modules/system/boot/stage-1.nix @@ -127,7 +127,6 @@ let cp -v ${udev}/lib/udev/rules.d/60-persistent-storage.rules $out/ cp -v ${udev}/lib/udev/rules.d/80-drivers.rules $out/ cp -v ${pkgs.lvm2}/lib/udev/rules.d/*.rules $out/ - cp -v ${pkgs.bcache-tools}/lib/udev/rules.d/*.rules $out/ ${config.boot.initrd.extraUdevRulesCommands} for i in $out/*.rules; do diff --git a/nixos/modules/tasks/bcache.nix b/nixos/modules/tasks/bcache.nix new file mode 100644 index 000000000000..f988ec02af72 --- /dev/null +++ b/nixos/modules/tasks/bcache.nix @@ -0,0 +1,11 @@ +{ config, pkgs, ... }: + +{ + + environment.systemPackages = [ pkgs.bcache-tools ]; + + boot.initrd.extraUdevRulesCommands = '' + cp -v ${pkgs.bcache-tools}/lib/udev/rules.d/*.rules $out/ + ''; + +}