summary refs log tree commit diff
path: root/modules/tasks
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2012-03-09 16:17:37 +0000
committerEelco Dolstra <eelco.dolstra@logicblox.com>2012-03-09 16:17:37 +0000
commit9d89ca0c03a669a81f4e98aa6fbf2606cea15ff7 (patch)
treefa81249a04d6d7b11936f168cc09c69f9d95bdbf /modules/tasks
parent03ebb883d18fb438de0bc27f4a209383adfa3419 (diff)
downloadnixpkgs-9d89ca0c03a669a81f4e98aa6fbf2606cea15ff7.tar
nixpkgs-9d89ca0c03a669a81f4e98aa6fbf2606cea15ff7.tar.gz
nixpkgs-9d89ca0c03a669a81f4e98aa6fbf2606cea15ff7.tar.bz2
nixpkgs-9d89ca0c03a669a81f4e98aa6fbf2606cea15ff7.tar.lz
nixpkgs-9d89ca0c03a669a81f4e98aa6fbf2606cea15ff7.tar.xz
nixpkgs-9d89ca0c03a669a81f4e98aa6fbf2606cea15ff7.tar.zst
nixpkgs-9d89ca0c03a669a81f4e98aa6fbf2606cea15ff7.zip
* Modularise vfat support. Also add fsck.vfat to the initrd. This
  prevents errors when booting from VFAT (e.g. an ISO image converted
  using unetbootin).

svn path=/nixos/trunk/; revision=32956
Diffstat (limited to 'modules/tasks')
-rw-r--r--modules/tasks/filesystems/vfat.nix25
1 files changed, 25 insertions, 0 deletions
diff --git a/modules/tasks/filesystems/vfat.nix b/modules/tasks/filesystems/vfat.nix
new file mode 100644
index 00000000000..5ca72f142b7
--- /dev/null
+++ b/modules/tasks/filesystems/vfat.nix
@@ -0,0 +1,25 @@
+{ config, pkgs, ... }:
+
+with pkgs.lib;
+
+let
+
+  inInitrd = any (fs: fs == "vfat") config.boot.initrd.supportedFilesystems;
+
+in
+
+{
+  config = mkIf (any (fs: fs == "vfat") config.boot.supportedFilesystems) {
+
+    system.fsPackages = [ pkgs.dosfstools ];
+
+    boot.initrd.kernelModules = mkIf inInitrd [ "vfat" "nls_cp437" "nls_iso8859-1" ];
+
+    boot.initrd.extraUtilsCommands = mkIf inInitrd
+      ''
+        cp -v ${pkgs.dosfstools}/sbin/dosfsck $out/bin
+        ln -sv dosfsck $out/bin/fsck.vfat
+      '';
+
+  };
+}