Skip to content

Instantly share code, notes, and snippets.

@MarcoPolo
Created August 28, 2022 05:34
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MarcoPolo/66e2c4a317cbf1bd8d64a8e30d9cf854 to your computer and use it in GitHub Desktop.
Save MarcoPolo/66e2c4a317cbf1bd8d64a8e30d9cf854 to your computer and use it in GitHub Desktop.
pkgs.stdenv.mkDerivation
{
name = "code-server";
src = pkgs.fetchurl
(
let
INSTALL_ARCH = "x86_64";
INSTALL_TARGET = "unknown-linux-gnu";
in
{
url = "https://aka.ms/vscode-server-launcher/${INSTALL_ARCH}-${INSTALL_TARGET}";
# sha256 = pkgs.lib.fakeSha256;
sha256 = "sha256-vwiDIpdV4uq56W5GU3vG6/Q5vwYl4WZUqOMI1aiSRIA=";
}
);
dontUnpack = true;
unpackPhase = ''
echo "UNPACKED"
'';
buildPhase = ''
mkdir -p $out/bin
cp $src $out/bin/code-server
chmod a+x $out/bin/code-server
'';
installPhase = ''
echo "Installed"
'';
buildInputs = [
pkgs.glibc
pkgs.libcxx.dev
pkgs.stdenv.cc.cc.lib
];
# Required for compilation
nativeBuildInputs = [
pkgs.autoPatchelfHook # Automatically setup the loader, and do the magic
pkgs.glibc
];
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment