1
0

Allow specifying umask for borgbackup repos

This commit is contained in:
clerie 2021-04-10 14:59:32 +02:00
parent 5e5a3ad869
commit cc38f3aa65

View File

@ -156,10 +156,11 @@ let
let
# Because of the following line, clients do not need to specify an absolute repo path
cdCommand = "cd ${escapeShellArg cfg.path}";
umaskArg = optionalString (cfg.umask != null) "--umask ${cfg.umask}";
restrictedArg = "--restrict-to-${if cfg.allowSubRepos then "path" else "repository"} .";
appendOnlyArg = optionalString appendOnly "--append-only";
quotaArg = optionalString (cfg.quota != null) "--storage-quota ${cfg.quota}";
serveCommand = "borg serve ${restrictedArg} ${appendOnlyArg} ${quotaArg}";
serveCommand = "borg ${umaskArg} serve ${restrictedArg} ${appendOnlyArg} ${quotaArg}";
in
''command="${cdCommand} && ${serveCommand}",restrict ${key}'';
@ -646,6 +647,15 @@ in {
example = "100G";
};
umask = mkOption {
type = with types; nullOr str;
description = ''
Permissions applied to newly created files and directories.
'';
default = null;
example = "0027";
};
};
}
));