From a1161a601c5e31bb72515d08059bd621c8c50a20 Mon Sep 17 00:00:00 2001 From: John Titor <50095635+JohnRTitor@users.noreply.github.com> Date: Fri, 3 Jul 2026 12:50:27 +0530 Subject: [PATCH] nixos/ntfs: install userspace utils for the new NTFS (NTFSPLUS) driver Co-authored-by: ccicnce113424 --- .../manual/release-notes/rl-2611.section.md | 2 ++ nixos/modules/tasks/filesystems/ntfs.nix | 25 +++++++++++++------ 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/nixos/doc/manual/release-notes/rl-2611.section.md b/nixos/doc/manual/release-notes/rl-2611.section.md index 3fbd21ee4f1d..fde120a2dc42 100644 --- a/nixos/doc/manual/release-notes/rl-2611.section.md +++ b/nixos/doc/manual/release-notes/rl-2611.section.md @@ -85,6 +85,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" ]; + }) + ]; }