diff --git a/hosts/deimos/home.nix b/hosts/deimos/home.nix index d99b44d..ee1c190 100644 --- a/hosts/deimos/home.nix +++ b/hosts/deimos/home.nix @@ -1,23 +1,32 @@ -_: { - home.homeDirectory = "/home/artem"; - +{ + config, + lib, + pkgs, + ... +}: +let + utils = import "${pkgs.path}/nixos/lib/utils.nix" { inherit lib pkgs config; }; + haremote-path = "${config.home.homeDirectory}/src/haremote"; + haremote-unit = utils.escapeSystemdPath haremote-path; +in +{ services.vscode-server.enable = true; services.vscode-server.installPath = [ "$HOME/.vscode-server" "$HOME/.antigravity-server" ]; - systemd.user.mounts.home-artem-src-haremote = { + systemd.user.mounts."${haremote-unit}" = { Unit = { - Description = "Mount ~/src/haremote"; + Description = "Mount ${haremote-path}"; After = [ "network-online.target" ]; Wants = [ "network-online.target" ]; }; Mount = { What = "root@homeassistant.home.arpa:/homeassistant"; - Where = "/home/artem/src/haremote"; + Where = haremote-path; Type = "fuse.sshfs"; - Options = "reconnect,ServerAliveInterval=15,uid=1000,gid=1000,IdentityAgent=/home/artem/.ssh/ssh_auth_sock"; + Options = "reconnect,ServerAliveInterval=15,uid=1000,gid=1000,IdentityAgent=${config.home.homeDirectory}/.ssh/ssh_auth_sock"; }; Install = { WantedBy = [ "default.target" ]; @@ -26,8 +35,8 @@ _: { programs.zsh.loginExtra = '' if [ -n "$SSH_AUTH_SOCK" ]; then - mkdir -p ~/src/haremote - [ -z "$(ls -A ~/src/haremote 2>/dev/null)" ] && systemctl --user restart home-artem-src-haremote.mount + mkdir -p ${haremote-path} + [ -z "$(ls -A ${haremote-path} 2>/dev/null)" ] && systemctl --user restart ${haremote-unit}.mount fi ''; }