From d0968ab836ab1301a24b47a529a878b95269ffa5 Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Mon, 24 Nov 2025 21:24:40 -0500 Subject: [PATCH] Install remote tunnels on odowork. --- nix/configuration/hosts/odowork/default.nix | 1 + nix/configuration/roles/vscode/default.nix | 94 +++++++++++++++++---- 2 files changed, 79 insertions(+), 16 deletions(-) diff --git a/nix/configuration/hosts/odowork/default.nix b/nix/configuration/hosts/odowork/default.nix index 4c1fbb63..6fdd82b0 100644 --- a/nix/configuration/hosts/odowork/default.nix +++ b/nix/configuration/hosts/odowork/default.nix @@ -122,6 +122,7 @@ me.thunderbolt.enable = true; me.user.enable = true; me.vscode.enable = true; + me.vscode.enable_remote_tunnels = true; me.waybar.enable = true; me.wireguard.activated = [ "wgh" diff --git a/nix/configuration/roles/vscode/default.nix b/nix/configuration/roles/vscode/default.nix index f8b3fb59..cf32a53d 100644 --- a/nix/configuration/roles/vscode/default.nix +++ b/nix/configuration/roles/vscode/default.nix @@ -15,6 +15,13 @@ example = true; description = "Whether we want to install vscode."; }; + + vscode.enable_remote_tunnels = lib.mkOption { + type = lib.types.bool; + default = false; + example = true; + description = "Whether we want to install the remote tunnels vscode extension."; + }; }; config = lib.mkIf (config.me.vscode.enable && config.me.graphical) { @@ -27,22 +34,25 @@ environment.systemPackages = with pkgs; [ (vscode-with-extensions.override { - vscodeExtensions = with vscode-extensions; [ - bbenoist.nix - ms-python.python - ms-azuretools.vscode-docker - ms-vscode-remote.remote-ssh - esbenp.prettier-vscode - ] - # ++ pkgs.vscode-utils.extensionsFromVscodeMarketplace [ - # { - # name = "remote-ssh-edit"; - # publisher = "ms-vscode-remote"; - # version = "0.47.2"; - # sha256 = "1hp6gjh4xp2m1xlm1jsdzxw9d8frkiidhph6nvl24d0h8z34w49g"; - # } - # ] - ; + vscodeExtensions = + with vscode-extensions; + ( + [ + bbenoist.nix + ms-python.python + ms-azuretools.vscode-docker + ms-vscode-remote.remote-ssh + esbenp.prettier-vscode + ] + ++ (pkgs.vscode-utils.extensionsFromVscodeMarketplace ( + lib.lists.optional config.me.vscode.enable_remote_tunnels { + name = "remote-server"; + publisher = "ms-vscode"; + version = "1.5.3"; + sha256 = "MSayIBwvSgIHg6gTrtUotHznvo5kTiveN8iSrehllW0="; + } + )) + ); }) ]; @@ -54,5 +64,57 @@ source = ./files/keybindings.json; }; }; + + environment.persistence."/persist" = lib.mkIf (config.me.mountPersistence) { + hideMounts = true; + users.talexander = { + directories = [ + { + directory = ".config/Code/User/globalStorage"; + user = "talexander"; + group = "talexander"; + mode = "0755"; + } + { + directory = ".config/Code/User/workspaceStorage"; + user = "talexander"; + group = "talexander"; + mode = "0755"; + } + ]; + }; + }; + + environment.persistence."/state" = lib.mkIf (config.me.mountPersistence) { + hideMounts = true; + users.talexander = { + directories = [ + { + directory = ".config/Code/CachedProfilesData"; + user = "talexander"; + group = "talexander"; + mode = "0755"; + } + { + directory = ".config/Code/CachedConfigurations"; + user = "talexander"; + group = "talexander"; + mode = "0755"; + } + { + directory = ".config/Code/Cache"; + user = "talexander"; + group = "talexander"; + mode = "0755"; + } + { + directory = ".config/Code/CachedData"; + user = "talexander"; + group = "talexander"; + mode = "0755"; + } + ]; + }; + }; }; }