From 270fc68ccc071a4543dafd4a09a453d50c7d43e5 Mon Sep 17 00:00:00 2001 From: Nydragon Date: Sat, 4 Jan 2025 19:35:54 +0100 Subject: [PATCH] feat: enable remote dev on vscode --- home/graphical/vscode/default.nix | 39 ++++++++++++++++++++++--------- home/terminal/ssh/default.nix | 27 +++++++++------------ 2 files changed, 39 insertions(+), 27 deletions(-) diff --git a/home/graphical/vscode/default.nix b/home/graphical/vscode/default.nix index bd626ad..dbc20a3 100644 --- a/home/graphical/vscode/default.nix +++ b/home/graphical/vscode/default.nix @@ -4,17 +4,34 @@ pkgs, ... }: -lib.mkIf config.programs.vscode.enable { - programs.vscode = { - package = pkgs.vscodium; - enableUpdateCheck = false; - extensions = with pkgs.vscode-extensions; [ - rust-lang.rust-analyzer - ]; - userSettings = { - "editor.formatOnSave" = true; - "update.mode" = "none"; - "idf.espIdfPath" = "/home/ny/esp/v5.2.2/esp-idf"; +let + inherit (lib) mkIf; + cfg = config.programs.vscode; +in +{ + config = mkIf cfg.enable { + programs.vscode = { + package = pkgs.vscode; + enableUpdateCheck = false; + extensions = with pkgs.vscode-extensions; [ + rust-lang.rust-analyzer + ms-vscode-remote.remote-ssh + ms-vscode-remote.remote-ssh-edit + ms-vscode.remote-explorer + tamasfe.even-better-toml + ]; + userSettings = { + editor.formatOnSave = true; + terminal.integrated.inheritEnv = false; + git.autofetch = true; + remote.SSH = { + connectTimeout = 60; + useLocalServer = true; + remotePlatform = { + "192.168.122.152" = "linux"; + }; + }; + }; }; }; } diff --git a/home/terminal/ssh/default.nix b/home/terminal/ssh/default.nix index 9f4508b..19b4836 100644 --- a/home/terminal/ssh/default.nix +++ b/home/terminal/ssh/default.nix @@ -1,4 +1,9 @@ -{ lib, config, ... }: +{ + lib, + config, + osConfig, + ... +}: let inherit (lib) mkIf; in @@ -11,21 +16,11 @@ mkIf config.programs.ssh.enable { user = "deck"; port = 22; }; - # dockervm = { - #hostname = "192.168.178.22"; - #user = "nydragon"; - #port = 22; - #}; - # raptus = { - #hostname = "vps.ccnlc.eu"; - #user = "ny"; - #port = 56528; - #}; - #shan = { - #hostname = "192.168.178.27"; - #user = "root"; - #port = 22; - #}; + vm = mkIf (osConfig.networking.hostName == "marr") { + hostname = "192.168.122.152"; + user = "ny"; + port = 22; + }; }; }; }