From 57461fa37be19886889fabd5c604e215b5ee2104 Mon Sep 17 00:00:00 2001 From: 4o1x5 <4o1x5@4o1x5.dev> Date: Fri, 24 Jan 2025 21:06:15 +0100 Subject: [PATCH] thinkpad: sshfs music mount to home/Music --- flake.lock | 8 ++++---- hosts/thinkpad/configs/cmus.nix | 9 +++++++++ hosts/thinkpad/configs/sshfs.nix | 29 +++++++++++++++++++++++++++++ hosts/thinkpad/configuration.nix | 2 ++ 4 files changed, 44 insertions(+), 4 deletions(-) create mode 100644 hosts/thinkpad/configs/cmus.nix create mode 100644 hosts/thinkpad/configs/sshfs.nix diff --git a/flake.lock b/flake.lock index 628a3a0..7e62c26 100755 --- a/flake.lock +++ b/flake.lock @@ -281,11 +281,11 @@ "nixvim": "nixvim" }, "locked": { - "lastModified": 1737310220, - "narHash": "sha256-2aS+mqzCPcPOaSMel+3ASRB2Xyh80jAEO3H7jT4JPuQ=", + "lastModified": 1737536685, + "narHash": "sha256-JWQ4Qyk8xVkR06zhbXXepKoXhxaA4zKDIUbWgrOxZMw=", "ref": "refs/heads/master", - "rev": "a5a723785017784ce40be12521880dac8583c274", - "revCount": 19, + "rev": "f0313ee843435c4e01fece02b43b1d8afdcdf512", + "revCount": 21, "type": "git", "url": "https://git.4o1x5.dev/4o1x5/neo2005" }, diff --git a/hosts/thinkpad/configs/cmus.nix b/hosts/thinkpad/configs/cmus.nix new file mode 100644 index 0000000..f92b20a --- /dev/null +++ b/hosts/thinkpad/configs/cmus.nix @@ -0,0 +1,9 @@ +{ user, ... }: +{ + + home-manager.users.${user}.programs.cmus = { + enable = true; + # TODO shades of purple theme here + # extraConfig + }; +} diff --git a/hosts/thinkpad/configs/sshfs.nix b/hosts/thinkpad/configs/sshfs.nix new file mode 100644 index 0000000..3e9a7c4 --- /dev/null +++ b/hosts/thinkpad/configs/sshfs.nix @@ -0,0 +1,29 @@ +{ + 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"; + }; + }; +} diff --git a/hosts/thinkpad/configuration.nix b/hosts/thinkpad/configuration.nix index b763eaa..20a2996 100755 --- a/hosts/thinkpad/configuration.nix +++ b/hosts/thinkpad/configuration.nix @@ -60,6 +60,8 @@ ./configs/element.nix ./configs/nvim.nix ./configs/tmux.nix + ./configs/cmus.nix + ./configs/sshfs.nix # terminal #./configs/st.nix # too minimal, most things dont work without a million tweaks