about summary refs log tree commit diff
path: root/nixpkgs/nixos/modules/tasks/filesystems/jfs.nix
blob: b5132b4caa3340bf9aebf1b45b9dd36aa96930f6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
{ 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 && !config.boot.initrd.systemd.enable) ''
      copy_bin_and_libs ${pkgs.jfsutils}/sbin/fsck.jfs
    '';

    boot.initrd.systemd.initrdBin = mkIf inInitrd [ pkgs.jfsutils ];
  };
}