- weird behaviour of my terminal getting blocked cus sshfs can't connect to my server
32 lines
937 B
Nix
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";
|
|
};
|
|
};
|
|
}
|