dotfiles/modules/services/diskstation/default.nix

59 lines
1.5 KiB
Nix
Raw Normal View History

2021-09-14 23:01:04 +02:00
{ config, lib, pkgs, ... }:
{
services.davfs2 = {
enable = true;
2021-09-21 17:48:34 +02:00
extraConfig = ''
2021-10-03 16:31:01 +02:00
buf_size 32
use_compression 1
table_size 4096
2021-09-21 17:48:34 +02:00
[/auto/diskstation]
trust_server_cert diskstation.pem
2021-10-03 16:31:01 +02:00
[/auto/media]
trust_server_cert diskstation.pem
2021-09-21 17:48:34 +02:00
[/auto/keepass]
trust_server_cert home-boehmies-de.pem
'';
2021-09-14 23:01:04 +02:00
};
services.autofs = {
enable = true;
2021-09-21 17:48:34 +02:00
autoMaster = let
mapConf = pkgs.writeText "auto" ''
keepass -fstype=davfs,uid=1000 :https\://davs.home.boehmies.de/home/Drive/
diskstation -fstype=davfs,uid=1000 :https\://192.168.0.2\:5006/home/Drive/
2021-10-03 16:31:01 +02:00
media -fstype=davfs,uid=1000 :https\://192.168.0.2\:5006/media
2021-09-15 00:41:46 +02:00
'';
2021-09-21 17:48:34 +02:00
in ''
/auto file:${mapConf}
'';
2021-09-14 23:01:04 +02:00
debug = true;
};
2021-09-14 23:04:13 +02:00
environment.etc."davfs2/certs/diskstation.pem" = {
text = builtins.readFile ./diskstation.pem;
};
2021-09-21 17:48:34 +02:00
environment.etc."davfs2/certs/home-boehmies-de.pem" = {
text = builtins.readFile ./home-boehmies-de.pem;
};
2021-09-14 23:01:04 +02:00
home-manager.users.moritz = {
services.unison = {
enable = true;
pairs = {
2021-09-21 17:48:34 +02:00
keepass.roots = [ "/home/moritz/Keepass" "/auto/keepass" ];
2021-10-03 16:31:01 +02:00
diskstation = {
roots = [ "/home/moritz/Documents" "/auto/diskstation" ];
commandOptions = {
auto = "true";
batch = "true";
log = "false";
repeat = "watch";
sshcmd = "\${pkgs.openssh}/bin/ssh";
ui = "text";
fastcheck = "true";
};
};
2021-09-14 23:01:04 +02:00
};
};
};
}