dotfiles/modules/services/diskstation/default.nix

86 lines
2.3 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 = ''
[/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/
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
};
2021-10-06 15:34:59 +02:00
environment.etc."davfs2/certs/home-boehmies-de.pem" = {
text = builtins.readFile ./home-boehmies-de.pem;
2021-09-14 23:04:13 +02:00
};
2021-10-03 18:39:08 +02:00
fileSystems."/media/media" = {
device = "//192.168.0.2/media";
fsType = "cifs";
options = let
# this line prevents hanging on network split
automount_opts =
"x-systemd.automount,noauto,x-systemd.idle-timeout=60,x-systemd.device-timeout=5s,x-systemd.mount-timeout=5s";
in [
"${automount_opts},credentials=/run/secrets/smbMedia,uid=1000,gid=100"
];
};
fileSystems."/media/diskstation" = {
device = "//192.168.0.2/home/Drive";
fsType = "cifs";
options = let
# this line prevents hanging on network split
automount_opts =
"x-systemd.automount,noauto,x-systemd.idle-timeout=60,x-systemd.device-timeout=5s,x-systemd.mount-timeout=5s";
in [
"${automount_opts},credentials=/run/secrets/smbMoritz,uid=1000,gid=100"
];
2021-09-21 17:48:34 +02:00
};
2021-09-14 23:01:04 +02:00
2021-10-17 18:54:21 +02:00
# home-manager.users.moritz = {
# services.unison = {
# enable = true;
# pairs = {
# keepass = {
# roots = [ "/home/moritz/Keepass" "/auto/keepass" ];
# commandOptions = {
# auto = "true";
# batch = "true";
# log = "false";
# repeat = "watch";
# sshcmd = "\${pkgs.openssh}/bin/ssh";
# ui = "text";
# ignore = "Name {lost+found}";
# };
# };
# diskstation = {
# roots = [ "/home/moritz/Documents" "/media/diskstation" ];
# commandOptions = {
# auto = "true";
# batch = "true";
# log = "false";
# repeat = "watch";
# sshcmd = "\${pkgs.openssh}/bin/ssh";
# ui = "text";
# fastcheck = "true";
# # debug = "verbose";
# perms = "0o1666";
# ignore = "Name {.direnv}";
# };
# };
# };
# };
# };
2021-09-14 23:01:04 +02:00
}