Files
nixos/modules/services/webdav.nix

36 lines
789 B
Nix

{ ... }:
{
# For web mounting
services.davfs2.enable = true;
# Load the secret
sops = {
secrets = {
webdav_authstring = {
mode = "0600";
path = "/etc/davfs2/secrets";
};
};
};
systemd.mounts = [{
description = "Webdav mount point";
after = [ "network-online.target" ];
wants = [ "network-online.target" ];
what = "https://dav.hahn1.one";
where = "/mnt/webdav";
type = "davfs";
options = "uid=1000,gid=1000,file_mode=0664,dir_mode=2775,_netdev";
mountConfig.TimeoutSec = "5s";
}];
# Is this too much power drain?
systemd.automounts = [{
description = "Webdav automount";
where = "/mnt/webdav";
wantedBy = [ "multi-user.target" ];
automountConfig = { TimeoutIdleSec = "2m"; };
}];
}