From 23160383e3d499fea96ff0feeb918e3c65a44d44 Mon Sep 17 00:00:00 2001 From: aszlig Date: Wed, 22 Oct 2014 01:50:15 +0200 Subject: [PATCH] nixos: Add a filesystem module for JFS. I'm not using JFS, but this is to mainly make jfsutils available if you have defined a JFS filesystem in your configuration. Signed-off-by: aszlig --- nixos/modules/module-list.nix | 1 + nixos/modules/tasks/filesystems/jfs.nix | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 nixos/modules/tasks/filesystems/jfs.nix diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index 17d3140b087..d65691c4379 100755 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -364,6 +364,7 @@ ./tasks/filesystems/cifs.nix ./tasks/filesystems/ext.nix ./tasks/filesystems/f2fs.nix + ./tasks/filesystems/jfs.nix ./tasks/filesystems/nfs.nix ./tasks/filesystems/reiserfs.nix ./tasks/filesystems/unionfs-fuse.nix diff --git a/nixos/modules/tasks/filesystems/jfs.nix b/nixos/modules/tasks/filesystems/jfs.nix new file mode 100644 index 00000000000..b7091ce9b18 --- /dev/null +++ b/nixos/modules/tasks/filesystems/jfs.nix @@ -0,0 +1,19 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let + inInitrd = any (fs: fs == "jfs") config.boot.initrd.supportedFilesystems; +in +{ + config = mkIf (any (fs: fs == "jfs") config.boot.supportedFilesystems) { + + system.fsPackages = [ pkgs.jfsutils ]; + + boot.initrd.kernelModules = mkIf inInitrd [ "jfs" ]; + + boot.initrd.extraUtilsCommands = mkIf inInitrd '' + cp -v ${pkgs.jfsutils}/sbin/fsck.jfs "$out/bin/" + ''; + }; +}