dotfiles/hosts/thinkpad/configs/sshfs.nix

30 lines
745 B
Nix
Raw Normal View History

{
user,
pkgs,
...
}:
let
remote_user = "root";
remote_ip = "32.54.31.180";
remote_path = "/home/jellyfin/music/Music";
in
{
environment.systemPackages = with pkgs; [
sshfs
];
# This took so fucking many tries
systemd.services.mount-music = {
description = "Mount remote Music directory using sshfs";
after = [ "network-online.target" ];
wantedBy = [ "multi-user.target" ];
serviceConfig = {
User = user;
Group = "users";
ExecStart = "${pkgs.sshfs}/bin/sshfs -o IdentityFile=/home/${user}/.ssh/id_ed25519,debug ${remote_user}@${remote_ip}:${remote_path} /home/${user}/Music";
ExecStop = "${pkgs.fuse}/bin/fusermount -u /home/${user}/Music";
Restart = "always";
};
};
}