diff --git a/nixos/doc/manual/release-notes/rl-2611.section.md b/nixos/doc/manual/release-notes/rl-2611.section.md index 57de71d88285..e1b596104618 100644 --- a/nixos/doc/manual/release-notes/rl-2611.section.md +++ b/nixos/doc/manual/release-notes/rl-2611.section.md @@ -121,6 +121,8 @@ - `security.polkit.settings` added for RFC42 style configuration of the polkitd daemon. +- `boot.supportedFilesystems.ntfs` installs `ntfsprogs-plus` instead of `ntfs3g` on kernel version 7.1 and later, unless `boot.supportedFilesystems.ntfs-3g` is explicitly enabled. + - The `programs.fuse` module, which provides the `fusermount3` executable and the `/etc/fuse.conf` config file, is now opt-in. The obligation to enable it has been shifted to its various consumers (e.g. gvfs, flatpak, appimage, sshfs). This can break fuse consumers at runtime, that don't explicitly declare that dependency with a module, e.g the mounting functionality in various backup tools (borg, restic, rclone, ...). - `services.plausible` can now again seed an initial admin user declaratively via [`services.plausible.adminUser.email`](#opt-services.plausible.adminUser.email). diff --git a/nixos/modules/tasks/filesystems/ntfs.nix b/nixos/modules/tasks/filesystems/ntfs.nix index 8ec839fed7eb..271680b56074 100644 --- a/nixos/modules/tasks/filesystems/ntfs.nix +++ b/nixos/modules/tasks/filesystems/ntfs.nix @@ -4,15 +4,24 @@ pkgs, ... }: - -with lib; - +let + ntfsEnabled = config.boot.supportedFilesystems.ntfs or false; + ntfs3gEnabled = config.boot.supportedFilesystems.ntfs-3g or false; + ntfsPlusSupported = config.boot.kernelPackages.kernelAtLeast "7.1"; + initrdSupport = config.boot.initrd.supportedFilesystems.ntfs or false; +in { - config = - mkIf (config.boot.supportedFilesystems.ntfs or config.boot.supportedFilesystems.ntfs-3g or false) - { + config = lib.mkMerge [ + (lib.mkIf (ntfsEnabled && ntfsPlusSupported && !ntfs3gEnabled) { + system.fsPackages = [ pkgs.ntfsprogs-plus ]; - system.fsPackages = [ pkgs.ntfs3g ]; + boot.initrd.availableKernelModules = lib.optionals initrdSupport [ "ntfs" ]; + }) - }; + (lib.mkIf (ntfs3gEnabled || (ntfsEnabled && !ntfsPlusSupported)) { + system.fsPackages = [ pkgs.ntfs3g ]; + + boot.initrd.availableKernelModules = lib.optionals initrdSupport [ "ntfs3" ]; + }) + ]; }