dotfiles/hosts/thinkpad/configs/sshfs.nix
Barna Máté 186fe4e713 thinkpad: sshfs add connection timeout to 8s
- weird behaviour of my terminal getting blocked cus sshfs can't connect to my server
2025-02-03 07:01:45 +01:00

32 lines
937 B
Nix

{
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
# FIXME there are some problems with this, for example if i'm unable to mount it
# I get an error when tryna run ls or anything that tries to interact with my disk.
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 -o ConnectionTimeout=8 ${remote_user}@${remote_ip}:${remote_path} /home/${user}/Music";
ExecStop = "${pkgs.fuse}/bin/fusermount -u /home/${user}/Music";
Restart = "always";
};
};
}