From 8a1714eeb673abe1b1f3329c5c9defeccc314df6 Mon Sep 17 00:00:00 2001 From: mjallen18 Date: Mon, 18 Aug 2025 20:54:28 -0500 Subject: [PATCH] ssh --- modules/home/programs/code/default.nix | 6 +++- packages/open-remote-ssh/default.nix | 47 ++++++++++++++++++++++++++ 2 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 packages/open-remote-ssh/default.nix diff --git a/modules/home/programs/code/default.nix b/modules/home/programs/code/default.nix index fa34add..069294f 100644 --- a/modules/home/programs/code/default.nix +++ b/modules/home/programs/code/default.nix @@ -2,6 +2,7 @@ config, pkgs, system, + namespace, ... }: let @@ -9,6 +10,7 @@ let x86_only = with pkgs; [ vscode-extensions.redhat.vscode-xml ]; + open-remote-ssh = pkgs.${namespace}.open-remote-ssh; in { programs = { @@ -39,7 +41,7 @@ in # open-remote-ssh # nix-vscode-extensions.open-vsx.jeanp413.open-remote-ssh - # open-vsx.jeanp413.open-remote-ssh + open-remote-ssh ] ++ (if !isArm then x86_only else [ ]) ++ pkgs.vscode-utils.extensionsFromVscodeMarketplace [ @@ -138,6 +140,8 @@ in "*.db" = "default"; }; }; + + "enable-proposed-api" = [ "jeanp413.open-remote-ssh" ]; }; }; }; diff --git a/packages/open-remote-ssh/default.nix b/packages/open-remote-ssh/default.nix new file mode 100644 index 0000000..e91a24c --- /dev/null +++ b/packages/open-remote-ssh/default.nix @@ -0,0 +1,47 @@ +{ lib +, stdenv +, fetchurl +, vscode-utils +, pkgs +}: + +let + version = "0.0.49"; + publisher = "jeanp413"; + name = "open-remote-ssh"; +in +vscode-utils.buildVscodeMarketplaceExtension { + mktplcRef = { + inherit name publisher version; + }; + + vsix = fetchurl { + url = "https://open-vsx.org/api/${publisher}/${name}/${version}/file/${publisher}.${name}-${version}.vsix"; + # Update this hash after downloading + sha256 = "sha256-QfJnAAx+kO2iJ1EzWoO5HLogJKg3RiC3hg1/u2Jm6t4="; + }; + + unpackPhase = '' + ${pkgs.unzip}/bin/unzip -q $src + ''; + + meta = with lib; { + description = "Use any remote machine with a SSH server as your development environment"; + longDescription = '' + The Open Remote SSH extension allows you to open a remote folder on any + remote machine, virtual machine, or container with a running SSH server + and take full advantage of VS Code's feature set. This is an open-source + alternative to Microsoft's proprietary Remote SSH extension, designed to + work with VSCodium and other open-source VS Code variants. + + Note: This extension requires enabling proposed APIs in VSCodium/Code-OSS. + You need to add "jeanp413.open-remote-ssh" to the "enable-proposed-api" + array in ~/.vscode-oss/argv.json + ''; + homepage = "https://github.com/jeanp413/open-remote-ssh"; + changelog = "https://github.com/jeanp413/open-remote-ssh/releases"; + license = licenses.mit; + maintainers = with maintainers; [ /* add your name here if you maintain this */ ]; + platforms = platforms.all; + }; +} \ No newline at end of file