Visual Studio Code, rebuilt in Rust
Rust
feat(nix): add a flake that packages the Linux release
Roman36aa638e3fbd
diff --git a/.gitignore b/.gitignoreindex 6325c0c07c1..ed2d530638b 100644--- a/.gitignore+++ b/.gitignore@@ -6,3 +6,4 @@/out-exthost//node_modules/port/results/raw+/resultdiff --git a/README.md b/README.mdindex adbbd349099..f2e90f0a3b2 100644--- a/README.md+++ b/README.md@@ -98,6 +98,7 @@ Counted from the agent session logs, each call once; cost at OpenRouter list pri- macOS: `darwin-arm64` for Apple silicon, `darwin-x64` for Intel. Signed, notarized, updates itself.- Linux: `linux-x64` and `linux-arm64` archives (`.tar.gz`, glibc 2.39 or newer: Ubuntu 24.04, Debian 13). A preview: webviews in X11 sessions only (WebKitGTK 4.1), no self-update, the rest in the "M23 Linux" rows of [port/ledger.md](port/ledger.md).+- Nix: [flake.nix](flake.nix) packages the Linux archives. Run it with `nix run github:rokartur/vsrustium`, or install `packages.<system>.default` from a NixOS or Home Manager configuration.## Builddiff --git a/flake.lock b/flake.locknew file mode 100644index 00000000000..ee98518e8f6--- /dev/null+++ b/flake.lock@@ -0,0 +1,27 @@+{+ "nodes": {+ "nixpkgs": {+ "locked": {+ "lastModified": 1795911899,+ "narHash": "sha256-OKvZpNQnLc24N/vuklyiHDYmFT4ZQRb5b3Rovh1/Hkg=",+ "owner": "NixOS",+ "repo": "nixpkgs",+ "rev": "e713fda5ec9fad59317d86214b1ee646a11896ea",+ "type": "github"+ },+ "original": {+ "owner": "NixOS",+ "ref": "nixos-unstable",+ "repo": "nixpkgs",+ "type": "github"+ }+ },+ "root": {+ "inputs": {+ "nixpkgs": "nixpkgs"+ }+ }+ },+ "root": "root",+ "version": 7+}diff --git a/flake.nix b/flake.nixnew file mode 100644index 00000000000..ea33de69985--- /dev/null+++ b/flake.nix@@ -0,0 +1,97 @@+{+ description = "VS Code, rebuilt in Rust. No AI. No Account.";++ inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";++ outputs =+ { nixpkgs, ... }:+ let+ version = "1.148.0-insider";+ releases = {+ aarch64-linux = {+ arch = "arm64";+ hash = "sha256:8bdbed53d4f51e3b5d5c77f02dd1425a2ba6ea965cc0eb96ad20893507a0981b";+ };+ x86_64-linux = {+ arch = "x64";+ hash = "sha256:c1787fb34bd8caedbef3b175df33bf610ec0781bd9a03075892222cb1eeaed60";+ };+ };+ forAllSystems =+ f:+ nixpkgs.lib.genAttrs (builtins.attrNames releases) (+ system: f nixpkgs.legacyPackages.${system} releases.${system}+ );+ in+ {+ packages = forAllSystems (+ pkgs: release: {+ default = pkgs.stdenv.mkDerivation {+ pname = "vsrustium";+ inherit version;++ src = pkgs.fetchurl {+ url = "https://github.com/rokartur/vsrustium/releases/download/v${version}/VSRustium-${version}-linux-${release.arch}.tar.gz";+ inherit (release) hash;+ };++ nativeBuildInputs = [+ pkgs.autoPatchelfHook+ pkgs.jq+ pkgs.wrapGAppsHook3+ ];++ buildInputs = [+ pkgs.cairo+ pkgs.glib+ pkgs.glib-networking+ pkgs.gtk3+ pkgs.libx11+ pkgs.libxcb+ pkgs.libxkbcommon+ pkgs.openssl+ pkgs.sqlite+ pkgs.stdenv.cc.cc.lib+ pkgs.webkitgtk_4_1+ ];++ runtimeDependencies = [+ pkgs.vulkan-loader+ pkgs.wayland+ ];++ dontStrip = true;+ dontWrapGApps = true;++ postPatch = ''+ jq 'del(.updateUrl)' resources/app/product.json > product.json.new+ mv product.json.new resources/app/product.json+ '';++ installPhase = ''+ runHook preInstall+ mkdir --parents $out/bin $out/lib+ cp --recursive . $out/lib/vsrustium+ ln --symbolic $out/lib/vsrustium/bin/vsrustium $out/bin/vsrustium+ install -D --mode=644 com.rokartur.vsrustium.desktop --target-directory=$out/share/applications+ install -D --mode=644 vsrustium.png --target-directory=$out/share/icons/hicolor/512x512/apps+ runHook postInstall+ '';++ postFixup = ''+ wrapGApp $out/lib/vsrustium/vsrustium --suffix PATH : ${pkgs.lib.makeBinPath [ pkgs.curl ]}+ '';++ meta = {+ description = "VS Code, rebuilt in Rust";+ homepage = "https://github.com/rokartur/vsrustium";+ license = pkgs.lib.licenses.mit;+ mainProgram = "vsrustium";+ platforms = builtins.attrNames releases;+ sourceProvenance = [ pkgs.lib.sourceTypes.binaryNativeCode ];+ };+ };+ }+ );+ };+}