diff --git a/.github/workflows/cachix.yml b/.github/workflows/cachix.yml index a584cb9..e2c17e1 100644 --- a/.github/workflows/cachix.yml +++ b/.github/workflows/cachix.yml @@ -24,7 +24,7 @@ jobs: build-packages: strategy: matrix: - package: [ ddns ] + package: [ ddns, vscodium-web-host, vscodium-remote-host ] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 diff --git a/pkgs/codium-reh/sources.json b/pkgs/codium-reh/sources.json deleted file mode 100644 index e6a2707..0000000 --- a/pkgs/codium-reh/sources.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "vscodium-reh": { - "x86_64-linux": { - "url": "https://github.com/VSCodium/vscodium/releases/download/1.95.3.24321/vscodium-reh-linux-x64-1.95.3.24321.tar.gz", - "sha256": "0xg50agpnzhxd407mdlrbzjqddjfrs9401hci7rj015g6806hmsm" - }, - "aarch64-linux": { - "url": "https://github.com/VSCodium/vscodium/releases/download/1.95.3.24321/vscodium-reh-linux-arm64-1.95.3.24321.tar.gz", - "sha256": "0s7f3sw0yli0i9qsb2z9a92vywwcv3j6hj3hivv2sj8cjx175w9a" - }, - "x86_64-darwin": { - "url": "https://github.com/VSCodium/vscodium/releases/download/1.95.3.24321/vscodium-reh-darwin-x64-1.95.3.24321.tar.gz", - "sha256": "1f6bycr4d5b4qdxp1hcs72shvmhqmxknl2libq47zjf8y5fb7m8y" - }, - "aarch64-darwin": { - "url": "https://github.com/VSCodium/vscodium/releases/download/1.95.3.24321/vscodium-reh-darwin-arm64-1.95.3.24321.tar.gz", - "sha256": "1mh9chgm5lmy97jgls6ghkwj4q3n8j9xhpy16x1nbnnmyi5p3a21" - } - } -} \ No newline at end of file diff --git a/pkgs/default.nix b/pkgs/default.nix index 84a6426..176f39f 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -3,7 +3,16 @@ }: { topsap = pkgs.callPackage ./topsap { }; - codium-reh = pkgs.callPackage ./codium-reh { }; linux-fhs-python = pkgs.callPackage ./linux-fhs-python { }; ddns = pkgs.python3.pkgs.callPackage ./ddns { }; + vscodium-remote-host = pkgs.callPackage ./vscodium-host { + pname = "vscodium-remote-host"; + assetName = "vscodium-reh"; + }; + + vscodium-web-host = pkgs.callPackage ./vscodium-host { + pname = "vscodium-web-host"; + assetName = "vscodium-reh-web"; + }; + } diff --git a/pkgs/codium-reh/default.nix b/pkgs/vscodium-host/default.nix similarity index 72% rename from pkgs/codium-reh/default.nix rename to pkgs/vscodium-host/default.nix index 1ebbcc6..b6a1668 100644 --- a/pkgs/codium-reh/default.nix +++ b/pkgs/vscodium-host/default.nix @@ -3,6 +3,9 @@ fetchurl, autoPatchelfHook, gnutar, + + pname, + assetName, }: let @@ -10,12 +13,12 @@ let sources = builtins.fromJSON (builtins.readFile ./sources.json); in stdenv.mkDerivation { - pname = "vscodium-reh"; - version = "1.95.3.24321"; + inherit pname; + version = "1.96.2.24355"; sourceRoot = "."; - src = fetchurl sources."vscodium-reh".${system}; + src = fetchurl sources.${assetName}.${system}; unpackPhase = '' mkdir -p "$out" @@ -31,5 +34,5 @@ stdenv.mkDerivation { gnutar ]; - passthru.updateScript = ./update-codium-reh.py; + passthru.updateScript = ./update.py; } diff --git a/pkgs/vscodium-host/sources.json b/pkgs/vscodium-host/sources.json new file mode 100644 index 0000000..70327f3 --- /dev/null +++ b/pkgs/vscodium-host/sources.json @@ -0,0 +1,38 @@ +{ + "vscodium-reh": { + "x86_64-linux": { + "url": "https://github.com/VSCodium/vscodium/releases/download/1.96.2.24355/vscodium-reh-linux-x64-1.96.2.24355.tar.gz", + "sha256": "1hc5xwqbmkv7bzziwvhwpdfv7zw4h6bclhwfcnbysq913027046c" + }, + "aarch64-linux": { + "url": "https://github.com/VSCodium/vscodium/releases/download/1.96.2.24355/vscodium-reh-linux-arm64-1.96.2.24355.tar.gz", + "sha256": "1i6rp6hg9d0xv4vrd8sjcj5qhraxbls8q2wdy0fl7gr3bbj6zaf8" + }, + "x86_64-darwin": { + "url": "https://github.com/VSCodium/vscodium/releases/download/1.96.2.24355/vscodium-reh-darwin-x64-1.96.2.24355.tar.gz", + "sha256": "082hprhriid23qsscn312bj8f899g8zxp3cbr5gzar4nhaff48ca" + }, + "aarch64-darwin": { + "url": "https://github.com/VSCodium/vscodium/releases/download/1.96.2.24355/vscodium-reh-darwin-arm64-1.96.2.24355.tar.gz", + "sha256": "13m0adp9aqqiy86psm3xhmms9yz3sn6sshhl02b9zlbc8by2ynlb" + } + }, + "vscodium-reh-web": { + "x86_64-linux": { + "url": "https://github.com/VSCodium/vscodium/releases/download/1.96.2.24355/vscodium-reh-web-linux-x64-1.96.2.24355.tar.gz", + "sha256": "0c7nqfvr3d0cij5dgi72a8r5gdhrxl2fpmyds24nrlz5r8f4p28h" + }, + "aarch64-linux": { + "url": "https://github.com/VSCodium/vscodium/releases/download/1.96.2.24355/vscodium-reh-web-linux-arm64-1.96.2.24355.tar.gz", + "sha256": "0vd2c13gxgd3asyb8cxg4wr7q9d9rwryy5hyizzdh15dn3h36kxc" + }, + "x86_64-darwin": { + "url": "https://github.com/VSCodium/vscodium/releases/download/1.96.2.24355/vscodium-reh-web-darwin-x64-1.96.2.24355.tar.gz", + "sha256": "0v2ww5gs713ynsx942fka69vb2r99yrrjqfip7w7rb3062r8qjy9" + }, + "aarch64-darwin": { + "url": "https://github.com/VSCodium/vscodium/releases/download/1.96.2.24355/vscodium-reh-web-darwin-arm64-1.96.2.24355.tar.gz", + "sha256": "0jh2jrp0v4gv3pbk2xmszzw6afn1rkhlsw9j41jfvslp43a19sx8" + } + } +} \ No newline at end of file diff --git a/pkgs/codium-reh/update-codium-reh.py b/pkgs/vscodium-host/update.py similarity index 84% rename from pkgs/codium-reh/update-codium-reh.py rename to pkgs/vscodium-host/update.py index 6972ba6..ba20102 100644 --- a/pkgs/codium-reh/update-codium-reh.py +++ b/pkgs/vscodium-host/update.py @@ -7,7 +7,6 @@ import subprocess import re import json -import requests @dataclass @@ -52,6 +51,8 @@ def prefetch(meta: VSCodiumMetadata): def fetch_version_github(owner, repo): + import requests + response = requests.get( f"https://github.com/{owner}/{repo}/releases/latest", allow_redirects=False, @@ -60,6 +61,19 @@ def fetch_version_github(owner, repo): def main(): + from argparse import ArgumentParser + + parser = ArgumentParser() + parser.add_argument("--version", default="latest") + + args = parser.parse_args() + + if args.version == "latest": + print("Fetching the latest version from github") + vscodium_ver = fetch_version_github("VSCodium", "vscodium") + else: + vscodium_ver = args.version + ROOT = os.path.dirname(os.path.realpath(__file__)) nix_path = os.path.join(ROOT, "default.nix") @@ -67,12 +81,6 @@ def main(): print(f"ERROR: cannot find vscodium.nix in {ROOT}") exit(1) - # Get the latest VSCodium version - vscodium_ver = os.environ.get( - "VSCODIUM_VERSION", - fetch_version_github("VSCodium", "vscodium"), - ) - # Update the version in vscodium.nix with open(nix_path, "r") as file: content = file.read() @@ -86,7 +94,7 @@ def main(): # Update hashes for various architectures output = {} - for asset in ("vscodium-reh",): + for asset in ("vscodium-reh", "vscodium-reh-web"): output[asset] = {} for osname in ("linux", "darwin"): for arch in ("x64", "arm64"):