dotfiles.nix/pkgs/vscodium-m1.nix

68 lines
1.2 KiB
Nix
Raw Normal View History

2022-04-22 02:33:07 +00:00
{ lib
, stdenv
, fetchurl
, # VSCodium build deps
git
, curl
, cacert
, jq
, nodejs
, nodePackages
, yarn
, python3
, xcodebuild
, darwin
2022-05-08 01:43:56 +00:00
, ...
2022-04-22 02:33:07 +00:00
}:
2022-04-21 22:15:52 +00:00
stdenv.mkDerivation rec {
pname = "vscodium";
2022-05-08 01:43:56 +00:00
version = "1.67.0";
2022-04-21 22:15:52 +00:00
executableName = "codium";
longName = "VSCodium";
shortName = "vscodium";
src = fetchurl {
url = "https://github.com/VSCodium/vscodium/archive/refs/tags/${version}.tar.gz";
2022-05-08 01:43:56 +00:00
sha256 = "d7Ci1SzEkH+QBYnBEZQ6Jim7dO2NoDe2eK4xDqENnrI=";
2022-04-21 22:15:52 +00:00
};
2022-04-22 02:33:07 +00:00
nativeBuildInputs = with darwin.apple_sdk.frameworks; [
git
curl
cacert
jq
nodejs
nodePackages.npm
yarn
python3
xcodebuild
AppKit
CoreServices
Cocoa
];
2022-04-21 22:15:52 +00:00
buildPhase = ''
2022-04-22 02:33:07 +00:00
runHook preBuild
2022-04-21 22:15:52 +00:00
2022-04-22 02:33:07 +00:00
export HOME=$(mktemp -d)
2022-04-21 22:15:52 +00:00
. get_repo.sh
SHOULD_BUILD=yes CI_BUILD=no OS_NAME=osx VSCODE_ARCH=arm64 . build.sh
2022-04-22 02:33:07 +00:00
runHook postBuild
2022-04-21 22:15:52 +00:00
'';
installPhase = ''
runHook preInstall
2022-04-22 02:33:07 +00:00
2022-04-21 22:15:52 +00:00
mkdir -p "$out/Applications/${longName}.app" "$out/bin"
2022-05-08 01:43:56 +00:00
cp -r ./VSCode-darwin-arm64/${longName}.app/* "$out/Applications/${longName}.app"
2022-04-21 22:15:52 +00:00
ln -s "$out/Applications/${longName}.app/Contents/Resources/app/bin/${executableName}" "$out/bin/${executableName}"
2022-04-22 02:33:07 +00:00
runHook postInstall
2022-04-21 22:15:52 +00:00
'';
2022-04-22 02:33:07 +00:00
meta.platforms = [ "aarch64-darwin" ];
2022-04-21 22:15:52 +00:00
}