From d6f77dca45f6d4acab5d6b7f2652c24044648458 Mon Sep 17 00:00:00 2001 From: mat ess Date: Thu, 21 Apr 2022 18:15:52 -0400 Subject: [PATCH] Add initial vscodium-m1 --- flake.nix | 1 + home/default.nix | 2 +- pkgs/vscodium-m1.nix | 31 +++++++++++++++++++++++++++++++ 3 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 pkgs/vscodium-m1.nix diff --git a/flake.nix b/flake.nix index 0045747..1ae5368 100644 --- a/flake.nix +++ b/flake.nix @@ -161,6 +161,7 @@ system = "x86_64-darwin"; inherit (nixpkgsConfig) config; }; + vscodium-m1 = import ./pkgs/vscodium-m1.nix { }; }; }; diff --git a/home/default.nix b/home/default.nix index f6f2bb0..255751d 100644 --- a/home/default.nix +++ b/home/default.nix @@ -66,7 +66,7 @@ # vscode vscode = { enable = true; - package = pkgs.vscodium; + package = pkgs.vscodium-m1; }; }; # }}} diff --git a/pkgs/vscodium-m1.nix b/pkgs/vscodium-m1.nix new file mode 100644 index 0000000..da13ab0 --- /dev/null +++ b/pkgs/vscodium-m1.nix @@ -0,0 +1,31 @@ +{ lib, stdenv }: + +stdenv.mkDerivation rec { + pname = "vscodium"; + version = "1.66.2"; + + executableName = "codium"; + longName = "VSCodium"; + shortName = "vscodium"; + + src = fetchurl { + url = "https://github.com/VSCodium/vscodium/archive/refs/tags/${version}.tar.gz"; + sha256 = ""; + }; + + buildPhase = '' + rm -rf VSCode* + rm -rf vscode + + . get_repo.sh + + SHOULD_BUILD=yes CI_BUILD=no OS_NAME=osx VSCODE_ARCH=arm64 . build.sh + ''; + + installPhase = '' + runHook preInstall + mkdir -p "$out/Applications/${longName}.app" "$out/bin" + cp -r ./* "$out/Applications/${longName}.app" + ln -s "$out/Applications/${longName}.app/Contents/Resources/app/bin/${executableName}" "$out/bin/${executableName}" + ''; +}