Skip to content

Commit 8195804

Browse files
authored
nixos/sftpgo: add extraReadWriteDirs option and fix docs links (#315619)
2 parents 0b9fce2 + e8885ab commit 8195804

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

nixos/modules/services/web-apps/sftpgo.nix

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,21 @@ in
3535
};
3636

3737
dataDir = mkOption {
38-
type = types.str;
38+
type = types.path;
3939
default = "/var/lib/sftpgo";
4040
description = ''
4141
The directory where SFTPGo stores its data files.
4242
'';
4343
};
4444

45+
extraReadWriteDirs = mkOption {
46+
type = types.listOf types.path;
47+
default = [];
48+
description = ''
49+
Extra directories where SFTPGo is allowed to write to.
50+
'';
51+
};
52+
4553
user = mkOption {
4654
type = types.str;
4755
default = defaultUser;
@@ -63,7 +71,7 @@ in
6371
type = with types; nullOr path;
6472
description = ''
6573
Path to a json file containing users and folders to load (or update) on startup.
66-
Check the [documentation](https://github.com/drakkan/sftpgo/blob/main/docs/full-configuration.md)
74+
Check the [documentation](https://sftpgo.github.io/latest/config-file/)
6775
for the `--loaddata-from` command line argument for more info.
6876
'';
6977
};
@@ -72,7 +80,7 @@ in
7280
default = {};
7381
description = ''
7482
The primary sftpgo configuration. See the
75-
[configuration reference](https://github.com/drakkan/sftpgo/blob/main/docs/full-configuration.md)
83+
[configuration reference](https://sftpgo.github.io/latest/config-file/)
7684
for possible values.
7785
'';
7886
type = with types; submodule {
@@ -324,7 +332,7 @@ in
324332
User = cfg.user;
325333
Group = cfg.group;
326334
WorkingDirectory = cfg.dataDir;
327-
ReadWritePaths = [ cfg.dataDir ];
335+
ReadWritePaths = [ cfg.dataDir ] ++ cfg.extraReadWriteDirs;
328336
LimitNOFILE = 8192; # taken from upstream
329337
KillMode = "mixed";
330338
ExecStart = "${cfg.package}/bin/sftpgo serve ${utils.escapeSystemdExecArgs cfg.extraArgs}";

0 commit comments

Comments
 (0)