diff --git a/nixos/doc/manual/configuration/sshfs-file-systems.section.md b/nixos/doc/manual/configuration/sshfs-file-systems.section.md index d8c9dea6c337..e2e37454b7ea 100644 --- a/nixos/doc/manual/configuration/sshfs-file-systems.section.md +++ b/nixos/doc/manual/configuration/sshfs-file-systems.section.md @@ -38,8 +38,6 @@ The file system can be configured in NixOS via the usual [fileSystems](#opt-file Here's a typical setup: ```nix { - system.fsPackages = [ pkgs.sshfs ]; - fileSystems."/mnt/my-dir" = { device = "my-user@example.com:/my-dir/"; fsType = "sshfs"; diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index 041169f0b052..815061639c69 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -1519,6 +1519,7 @@ ./tasks/filesystems/nfs.nix ./tasks/filesystems/ntfs.nix ./tasks/filesystems/reiserfs.nix + ./tasks/filesystems/sshfs.nix ./tasks/filesystems/squashfs.nix ./tasks/filesystems/unionfs-fuse.nix ./tasks/filesystems/vboxsf.nix diff --git a/nixos/modules/tasks/filesystems/sshfs.nix b/nixos/modules/tasks/filesystems/sshfs.nix new file mode 100644 index 000000000000..cd71dda16d8b --- /dev/null +++ b/nixos/modules/tasks/filesystems/sshfs.nix @@ -0,0 +1,7 @@ +{ config, lib, pkgs, ... }: + +{ + config = lib.mkIf (lib.any (fs: fs == "sshfs" || fs == "fuse.sshfs") config.boot.supportedFilesystems) { + system.fsPackages = [ pkgs.sshfs ]; + }; +}