weilite/webdav: init
This commit is contained in:
parent
ea47988011
commit
d6d2f01c09
5 changed files with 52 additions and 14 deletions
37
machines/weilite/services/webdav.nix
Normal file
37
machines/weilite/services/webdav.nix
Normal file
|
@ -0,0 +1,37 @@
|
|||
{ config, ... }:
|
||||
{
|
||||
|
||||
sops.secrets = {
|
||||
"webdav/photosync/password" = { };
|
||||
};
|
||||
|
||||
sops.templates."webdav.env" = {
|
||||
content = ''
|
||||
PHOTOSYNC_PASSWORD=${config.sops.placeholder."webdav/photosync/password"}
|
||||
'';
|
||||
};
|
||||
|
||||
services.webdav = {
|
||||
enable = true;
|
||||
settings = {
|
||||
permissions = "RC";
|
||||
behindProxy = true;
|
||||
users = [
|
||||
{
|
||||
username = "photosync";
|
||||
password = "{ENV}PHOTOSYNC_PASSWORD";
|
||||
}
|
||||
];
|
||||
};
|
||||
environmentFile = config.sops.templates."webdav.env".path;
|
||||
};
|
||||
|
||||
systemd.services.webdav.serviceConfig = {
|
||||
BindReadOnlyPaths = [
|
||||
"/mnt/photos/xin/originals:%t/webdav/photosync"
|
||||
];
|
||||
RuntimeDirectory = "webdav";
|
||||
WorkingDirectory = "%t/webdav";
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue