nixos-config/modules/media-mount.nix
2022-05-14 17:50:11 +02:00

31 lines
699 B
Nix

{ config, lib, pkgs, ... }:
let
mkMount = remote: {
device = remote;
fsType = "sshfs";
options = [
"ro"
"allow_other"
"_netdev"
"x-systemd.idle-timeout=5min"
"x-systemd.automount"
"reconnect"
"ServerAliveInterval=15"
"ServerAliveCountMax=1"
"IdentityFile=${config.sops.secrets.media-ssh-key.path}"
];
};
in
lib.mkIf config.sbruder.gui.enable {
sops.secrets.media-ssh-key = { };
system.fsPackages = with pkgs; [ sshfs ];
fileSystems = {
"/home/simon/mounts/media" = mkMount "media@fuuko.home.sbruder.de:/data/media";
"/home/simon/mounts/torrent" = mkMount "media@fuuko.home.sbruder.de:/data/torrent";
};
}