From b781a9f492482c6d3178545b5bc22c0689d8c776 Mon Sep 17 00:00:00 2001 From: Jonas Hahn Date: Sun, 31 Aug 2025 17:47:38 +0200 Subject: [PATCH] Cleanup webdavmounting Maybe the problem is the filesystem I use I will test this on my laptop soon. --- modules/services/webdav.nix | 27 +++++---------------------- 1 file changed, 5 insertions(+), 22 deletions(-) diff --git a/modules/services/webdav.nix b/modules/services/webdav.nix index bbd7d5a..1a36867 100644 --- a/modules/services/webdav.nix +++ b/modules/services/webdav.nix @@ -1,31 +1,20 @@ -{ inputs, config, ... }: +{ inputs, ... }: { imports = [ inputs.sops-nix.nixosModules.sops ]; + # For web mounting services.davfs2.enable = true; + # Maybe the failed encryption is due to the btrfs system please remove this in the future sops = { defaultSopsFile = ./../../secrets.yaml; - defaultSopsFormat = "yaml"; age.keyFile = "/home/jonas/.config/sops/age/keys.txt"; - templates = { - "davtemp" = { - owner = "root"; - content = "${config.sops.placeholder.webdav_secret}"; - mode = "0600"; - path = "/etc/davfs2/secrets"; - }; - }; - secrets = { webdav_secret = { owner = "jonas"; }; }; + secrets = { webdav_secret = { path = "/etc/davfs2/secrets"; }; }; }; - # Ensure the mountpoint directory exists - systemd.tmpfiles.rules = [ "d /mnt/webdav 0755 jonas users -" ]; - - # Just works systemd.mounts = [{ - description = "Webdav mount point"; + description = "WebDAV mount point"; wants = [ "network-online.target" ]; what = "https://dav.hahn1.one"; where = "/mnt/webdav"; @@ -33,10 +22,4 @@ options = "uid=1000,gid=1000,file_mode=0664,dir_mode=2775,_netdev"; mountConfig.TimeoutSec = "5s"; }]; - - systemd.automounts = [{ - where = "/mnt/webdav"; - wantedBy = [ "multi-user.target" ]; - automountConfig = { TimeoutIdleSec = "20m"; }; - }]; }