mirror of
https://github.com/versia-pub/server.git
synced 2025-12-06 08:28:19 +01:00
rm: nix build
This commit is contained in:
parent
26dc389010
commit
92db74acf3
|
|
@ -16,11 +16,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1722957468,
|
"lastModified": 1723320709,
|
||||||
"narHash": "sha256-SQ0TCC4aklOhN/OzcztrKqDLY8SjpIZcyvTulzhDXs0=",
|
"narHash": "sha256-DeKCsLQsS58D8TB/cTjXs2x8XMvsyv2JVxcF0Hu6pu8=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "2a13929e1f191b3690dd2f2db13098b04adb9043",
|
"rev": "e1d92cda6fd1bcec60e4938ce92fcee619eea793",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
|
||||||
60
flake.nix
60
flake.nix
|
|
@ -22,66 +22,6 @@
|
||||||
});
|
});
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
packages = forAllSystems ({ pkgs }: {
|
|
||||||
default = let
|
|
||||||
pin = pkgs.lib.importJSON ./pin.json;
|
|
||||||
src = self;
|
|
||||||
node_modules = pkgs.stdenv.mkDerivation {
|
|
||||||
pname = "versiajs-node_modules";
|
|
||||||
inherit src;
|
|
||||||
version = pin.version;
|
|
||||||
impureEnvVars = pkgs.lib.fetchers.proxyImpureEnvVars
|
|
||||||
++ [ "GIT_PROXY_COMMAND" "SOCKS_SERVER" ];
|
|
||||||
nativeBuildInputs = with pkgs; [ bun nodejs nodePackages.typescript nodePackages.typescript-language-server ];
|
|
||||||
buildInputs = with pkgs; [ libstdcxx5 ];
|
|
||||||
dontConfigure = true;
|
|
||||||
buildPhase = ''
|
|
||||||
bun install --production --frozen-lockfile --ignore-scripts
|
|
||||||
'';
|
|
||||||
installPhase = ''
|
|
||||||
mkdir -p $out/node_modules
|
|
||||||
cp -R ./node_modules $out
|
|
||||||
'';
|
|
||||||
outputHash = pin."${pkgs.stdenv.system}";
|
|
||||||
outputHashAlgo = "sha256";
|
|
||||||
outputHashMode = "recursive";
|
|
||||||
dontFixup = true;
|
|
||||||
};
|
|
||||||
in pkgs.stdenv.mkDerivation {
|
|
||||||
name = "versiajs";
|
|
||||||
version = pin.version;
|
|
||||||
|
|
||||||
buildPhase = ''
|
|
||||||
runHook preBuild
|
|
||||||
|
|
||||||
ln -s ${node_modules}/node_modules .
|
|
||||||
bun run build
|
|
||||||
|
|
||||||
runHook postBuild
|
|
||||||
'';
|
|
||||||
|
|
||||||
installPhase = ''
|
|
||||||
runHook preInstall
|
|
||||||
mkdir -p $out/bin
|
|
||||||
cp -R ./* $out
|
|
||||||
makeBinaryWrapper ${pkgs.bun}/bin/bun $out/bin/versiajs \
|
|
||||||
--prefix PATH : ${pkgs.lib.makeBinPath [ pkgs.bun ]} \
|
|
||||||
--add-flags "run --prefer-offline --no-install --cwd $out ./cli/index.ts start"
|
|
||||||
|
|
||||||
runHook postInstall
|
|
||||||
'';
|
|
||||||
|
|
||||||
buildInputs = with pkgs; [
|
|
||||||
nodejs
|
|
||||||
];
|
|
||||||
|
|
||||||
nativeBuildInputs = with pkgs; [ makeBinaryWrapper bun ];
|
|
||||||
|
|
||||||
inherit src;
|
|
||||||
|
|
||||||
dontConfigure = true;
|
|
||||||
};
|
|
||||||
});
|
|
||||||
devShells = forAllSystems ({ pkgs }: {
|
devShells = forAllSystems ({ pkgs }: {
|
||||||
default = pkgs.mkShell {
|
default = pkgs.mkShell {
|
||||||
buildInputs = with pkgs; [
|
buildInputs = with pkgs; [
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue