profiles/filesystem: add personal webstorage setup

This commit is contained in:
Gabriel Arazas 2023-07-24 15:18:28 +08:00
parent 8777fc06e8
commit cf92d4584c
No known key found for this signature in database
GPG Key ID: ADE0C41DAB221FCC

View File

@ -16,6 +16,7 @@ in
setups = { setups = {
archive.enable = lib.mkEnableOption "automounting offline archive"; archive.enable = lib.mkEnableOption "automounting offline archive";
external-hdd.enable = lib.mkEnableOption "automounting personal external hard drive"; external-hdd.enable = lib.mkEnableOption "automounting personal external hard drive";
personal-webstorage.enable = lib.mkEnableOption "automounting of personal WebDAV directory";
}; };
}; };
@ -60,5 +61,33 @@ in
]; ];
}; };
}) })
(lib.mkIf cfg.setups.personal-webstorage.enable {
assertions = [{
assertion = config.services.davfs2.enable;
message = ''
Mounting WebDAVs is not possible since davfs2 NixOS service is not
enabled.
'';
}];
# You have to set up the secrets for this somewhere.
fileSystems."/mnt/personal-webdav" = {
device = "https://dav.mailbox.org/servlet/webdav.infostore";
fsType = "davfs";
noCheck = true;
options = [
"rw"
"user"
"noauto"
"nofail"
"x-systemd.automount"
"x-systemd.idle-timeout=300"
"x-systemd.mount-timeout=20"
"x-systemd.wanted-by=multi-user.target"
];
};
})
]; ];
} }