feat(vscodium remote): attempt to match versions on client and server environments

This commit is contained in:
steveej 2024-03-07 21:58:24 +01:00
parent 092e69133f
commit b144c4501f
6 changed files with 67 additions and 5 deletions

35
flake.lock generated
View file

@ -631,6 +631,22 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs-vscodium": {
"locked": {
"lastModified": 1709558755,
"narHash": "sha256-hx4FIbk4X4ve1oiHLOj+VE6dzO4CtXBR5RSU6kaq34M=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "207107bbc7d6d19a8b2c36a088d3756d03490243",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable-small",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-wayland": { "nixpkgs-wayland": {
"inputs": { "inputs": {
"flake-compat": "flake-compat_2", "flake-compat": "flake-compat_2",
@ -684,6 +700,23 @@
"type": "github" "type": "github"
} }
}, },
"openvscode-server": {
"flake": false,
"locked": {
"lastModified": 1708067838,
"narHash": "sha256-GNqDYqi40X7/og3TacvKyPj6c5amkxTYr/1DsnGV2AI=",
"owner": "gitpod-io",
"repo": "openvscode-server",
"rev": "fa212cab64faaac10741979e96a0662d14f61c81",
"type": "github"
},
"original": {
"owner": "gitpod-io",
"ref": "openvscode-server-v1.86.2",
"repo": "openvscode-server",
"type": "github"
}
},
"prs": { "prs": {
"flake": false, "flake": false,
"locked": { "locked": {
@ -730,8 +763,10 @@
"nixpkgs-unstable-small" "nixpkgs-unstable-small"
], ],
"nixpkgs-unstable-small": "nixpkgs-unstable-small", "nixpkgs-unstable-small": "nixpkgs-unstable-small",
"nixpkgs-vscodium": "nixpkgs-vscodium",
"nixpkgs-wayland": "nixpkgs-wayland", "nixpkgs-wayland": "nixpkgs-wayland",
"ofi-pass": "ofi-pass", "ofi-pass": "ofi-pass",
"openvscode-server": "openvscode-server",
"prs": "prs", "prs": "prs",
"radicalePkgs": [ "radicalePkgs": [
"nixpkgs-2211" "nixpkgs-2211"

View file

@ -25,6 +25,10 @@
nixpkgs-wayland.url = "github:nix-community/nixpkgs-wayland"; nixpkgs-wayland.url = "github:nix-community/nixpkgs-wayland";
nixpkgs-vscodium.url = "github:nixos/nixpkgs/nixos-unstable-small";
openvscode-server.url = "github:gitpod-io/openvscode-server/openvscode-server-v1.86.2";
openvscode-server.flake = false;
colmena = { colmena = {
url = "github:zhaofengli/colmena"; url = "github:zhaofengli/colmena";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";

View file

@ -2,7 +2,9 @@
self', self',
inputs', inputs',
pkgs, pkgs,
}: { }: let
pkgsUnstable = inputs'.nixpkgs-unstable.legacyPackages;
in {
install = pkgs.mkShell { install = pkgs.mkShell {
name = "infra-install"; name = "infra-install";
packages = with pkgs; [ packages = with pkgs; [

View file

@ -4,6 +4,7 @@
config, config,
# these come in via home-manager.extraSpecialArgs and are specific to each node # these come in via home-manager.extraSpecialArgs and are specific to each node
nodeFlake, nodeFlake,
repoFlake,
packages', packages',
... ...
}: let }: let

View file

@ -1,11 +1,14 @@
{ {
pkgs, pkgs,
nodeFlake, nodeFlake,
repoFlake,
... ...
}: { }: let
pkgsVscodium = import repoFlake.inputs.nixpkgs-vscodium {inherit (pkgs) system config;};
in {
programs.vscode = { programs.vscode = {
enable = true; enable = true;
package = pkgs.vscodium; package = pkgsVscodium.vscodium;
extensions = extensions =
[ [
# TODO: how can i install (this) vsix(s) directly? # TODO: how can i install (this) vsix(s) directly?
@ -38,7 +41,11 @@
mutableExtensionsDir = true; mutableExtensionsDir = true;
}; };
home.packages = [pkgs.nixpkgs-fmt pkgs.alejandra]; home.packages = [
pkgs.nixpkgs-fmt
pkgs.alejandra
pkgs.nil
];
} }
# TODO: automate # TODO: automate
### original list: ### original list:

View file

@ -9,7 +9,10 @@
nodeName, nodeName,
system, system,
... ...
}: { }: let
pkgsUnstableSmall = import nodeFlake.inputs.nixpkgs-unstable-small {inherit (pkgs) system config;};
pkgsVscodium = import repoFlake.inputs.nixpkgs-vscodium {inherit (pkgs) system config;};
in {
disabledModules = [ disabledModules = [
]; ];
@ -47,6 +50,16 @@
pkgs.nixpkgs-fmt pkgs.nixpkgs-fmt
pkgs.alejandra pkgs.alejandra
pkgs.nixfmt pkgs.nixfmt
# TODO: automate linking this
# 1. get the commit with: `codium --version`
# 2. create the binary directory: `mkdir -p /home/steveej/.vscodium-server/bin/c8ce3ba4bc6b30b3b10edc61481cb85b1d2396bc/bin/`
# 3. link the binary. this relies on the client-side setting `"remote.SSH.experimental.serverBinaryName": "openvscode-server"` : ln -s $(which openvscode-server) /home/steveej/.vscodium-server/bin/c8ce3ba4bc6b30b3b10edc61481cb85b1d2396bc/bin/
(pkgsVscodium.openvscode-server.overrideAttrs(attrs: {
src = repoFlake.inputs.openvscode-server;
version = "1.86.2";
yarnCache = attrs.yarnCache.overrideAttrs (_: {outputHash = "sha256-mB7Fw/5pCBJNGtH3PvGhZOAIP/C2MoSvBvZy17TPN9U=";});
}))
]; ];
}; };