nix update

This commit is contained in:
LordMZTE 2024-08-21 10:35:20 +02:00
parent ad69e9560b
commit be4dd6ea88
Signed by: LordMZTE
GPG key ID: B64802DC33A64FF6
5 changed files with 18 additions and 230 deletions

View file

@ -4,6 +4,7 @@ def "nix rbuild" [
host:string, # The remote host to build on
flakeref:string, # A flake reference to build
...nixargs:string, # Additional arguments to pass to the eval command
--drv(-d), # Don't eval but treat flakeref as path to .drv file
--no-link(-n), # Don't create a `result` link
--nom, # Invoke `nom` on the remote machine instead of `nix`
--remote-eval(-r), # Evaluate the derivation on the remote. Note that this will incorrectly handle path-based flake references.
@ -12,15 +13,17 @@ def "nix rbuild" [
print "Eval & Build on Remote..."
ssh $host $"(if $nom { "nom" } else { "nix" }) build --no-link --print-out-paths '($flakeref)' ($nixargs | str join ' ')" | lines
} else {
print "Eval..."
let eval_output = nix eval $flakeref ...$nixargs
if $eval_output =~ "error:" {
error make {
msg: "Derivation evaluation failed!",
help: $eval_output,
} | return $in
let drv_path = if $drv { $flakeref } else {
print "Eval..."
let eval_output = nix eval $flakeref ...$nixargs
if $eval_output =~ "error:" {
error make {
msg: "Derivation evaluation failed!",
help: $eval_output,
} | return $in
}
$eval_output | parse "«derivation {drv}»" | get 0.drv
}
let drv_path = $eval_output | parse "«derivation {drv}»" | get 0.drv
print "Copy drv to Remote..."
nix copy --substitute-on-destination --derivation --to $"ssh://($host)" $drv_path

View file

@ -2,16 +2,16 @@
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1723991338,
"narHash": "sha256-Grh5PF0+gootJfOJFenTTxDTYPidA3V28dqJ/WV7iis=",
"lastModified": 1724137240,
"narHash": "sha256-VjbV/91spoYpl+fD7cK1asDhQIjJduP0lT+SgeXtcIc=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "8a3354191c0d7144db9756a74755672387b702ba",
"rev": "d2fa2514f041934a6aa261c66dc44829251cffd3",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"ref": "nixos-unstable-small",
"repo": "nixpkgs",
"type": "github"
}

View file

@ -1,6 +1,6 @@
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable-small";
utils.url = "github:numtide/flake-utils";
};

View file

@ -22,7 +22,7 @@ let
nativeBuildInputs = with pkgs; [ zig_0_12.hook git ];
})
(pkgs.callPackage ./haxe-language-server.nix { })
(flakePkg "git+https://git.mzte.de/LordMZTE/haxe-language-server.git")
config.output.packages.jdtls-wrapped
lua-language-server
(flakePkg "github:oxalica/nil")
@ -37,7 +37,7 @@ let
hash = "sha256-Mkbl8wT04sNjV7fpDJh9HbEqnCdi6SMXdlPCbT2801c=";
};
cargoSha256 = "sha256-/jx1hC/98v5L8XLG3ecFkk5H60HDtaKede+a8HDeFk4=";
cargoHash = "sha256-/jx1hC/98v5L8XLG3ecFkk5H60HDtaKede+a8HDeFk4=";
})
rust-analyzer
taplo

View file

@ -1,215 +0,0 @@
{ lib, pkgs, stdenvNoCC, ... }:
let
mkHaxelib = { libname, version, src }: stdenvNoCC.mkDerivation {
name = "${libname}-${version}";
inherit src;
installPhase = ''
runHook preInstall
ver="${lib.replaceStrings ["."] [","] version}"
mkdir $out
if [ $(ls $src | wc -l) == 1 ]; then
cp -r $src/* $out/$ver
else
cp -r $src $out/$ver
fi
echo ${version} > $out/.current
runHook postInstall
'';
};
fetchHaxelib = { libname, version, hash ? "" }: mkHaxelib {
inherit libname version;
src = pkgs.fetchzip {
url = "http://lib.haxe.org/files/3.0/${lib.replaceStrings ["."] [","] "${libname}-${version}"}.zip";
stripRoot = false;
inherit hash;
};
};
deps = pkgs.linkFarm "haxelib-deps" [
# Direct deps
{
name = "hxnodejs";
path = mkHaxelib {
libname = "hxnodejs";
version = "git";
src = pkgs.fetchFromGitHub {
owner = "HaxeFoundation";
repo = "hxnodejs";
rev = "c9450595b2337587bcdaeacf159019531925f25d";
hash = "sha256-hwxzewlWF0IAEDACB4R6ELKcOxzF/2CcdBoPP3leijk=";
};
};
}
{
name = "hxparse";
path = mkHaxelib {
libname = "hxparse";
version = "git";
src = pkgs.fetchFromGitHub {
owner = "simn";
repo = "hxparse";
rev = "876070ec62a4869de60081f87763e23457a3bda8";
hash = "sha256-uIsF0oAXVY+MrJDXlsYobD1pwq3HsTowK6NMMRgD2fg=";
};
};
}
{
name = "haxeparser";
path = mkHaxelib {
libname = "haxeparser";
version = "git";
src = pkgs.fetchFromGitHub {
owner = "HaxeCheckstyle";
repo = "haxeparser";
rev = "7e98c9aef901b8e26541cf3f8a6e1da0385b237a";
hash = "sha256-T61tEtdLBe16+XPXnmxQkoqpZa2FhAohQBMwHkMiFr0=";
};
};
}
{
name = "tokentree";
path = fetchHaxelib {
libname = "tokentree";
version = "1.2.10";
hash = "sha256-f3OpLPDcigsTB7dpwV9PTUBuTxprdc6aEPEc81OfO9o=";
};
}
{
name = "formatter";
path = fetchHaxelib {
libname = "formatter";
version = "1.15.0";
hash = "sha256-cCDuG5YbU+07BrWVJIK1wjsEgvde5lqIOLLZMniTPfc=";
};
}
{
name = "rename";
path = fetchHaxelib {
libname = "rename";
version = "2.2.2";
hash = "sha256-pyQhG+oFeb7XKV1I4CEASedi0NiFZuHV5/OBNLYZRIo=";
};
}
{
name = "json2object";
path = mkHaxelib {
libname = "json2object";
version = "git";
src = pkgs.fetchFromGitHub {
owner = "elnabo";
repo = "json2object";
rev = "429986134031cbb1980f09d0d3d642b4b4cbcd6a";
hash = "sha256-UwPbDL9pICmShhRik3fGCDJrvj0oUuGgVziPMZW4DHY=";
};
};
}
{
name = "language-server-protocol";
path = mkHaxelib {
libname = "language-server-protocol";
version = "git";
src = pkgs.fetchFromGitHub {
owner = "vshaxe";
repo = "language-server-protocol-haxe";
rev = "a6baa2ddcd792e99b19398048ef95aa00f0aa1f6";
hash = "sha256-CAAn6zeR3oV16fPQerZFgZ0dZaZj5MzbHvhtwhEZ0Ro=";
};
};
}
{
name = "vscode-json-rpc";
path = mkHaxelib {
libname = "vscode-json-rpc";
version = "git";
src = pkgs.fetchFromGitHub {
owner = "vshaxe";
repo = "vscode-json-rpc";
rev = "0160f06bc9df1dd0547f2edf23753540db74ed5b";
hash = "sha256-dwd2Ml9kORtkAs0P4B9qC+HTI2JOaLRzxpppeGbnlos=";
};
};
}
{
name = "uglifyjs";
path = fetchHaxelib {
libname = "uglifyjs";
version = "1.0.0";
hash = "sha256-1dR6BzftIXe68U8kFi2A2mssOEcCOkrervmsnxwwpFw=";
};
}
{
name = "safety";
path = fetchHaxelib {
libname = "safety";
version = "1.1.2";
hash = "sha256-fq+W8Or6raW00vsRQ1nbjs4IPou9MV536Yj+uk9VHyU=";
};
}
# Indirect deps
{
name = "hxjsonast";
path = fetchHaxelib {
libname = "hxjsonast";
version = "1.1.0";
hash = "sha256-5Kbq/hDKypx29omnU8bFfd634KqBVYybEmUZh13qjYc=";
};
}
{
name = "test-adapter";
path = fetchHaxelib {
libname = "test-adapter";
version = "2.0.4";
hash = "sha256-OAw/JEL26LZqlY9n2OeeVvp/i4Ts5x3WyoPFYMUBg8k=";
};
}
{
name = "utest";
path = mkHaxelib {
libname = "utest";
version = "git";
src = pkgs.fetchFromGitHub {
owner = "haxe-utest";
repo = "utest";
rev = "a94f8812e8786f2b5fec52ce9f26927591d26327";
hash = "sha256-cf7688QxtuQGHvTsG/eJ2PNOVUrcNG/G5ZaysDH5two=";
};
};
}
];
in
pkgs.stdenvNoCC.mkDerivation {
name = "haxe-language-server";
src = pkgs.fetchFromGitHub {
owner = "klabz";
repo = "haxe-languageserver";
rev = "012951e82f023bc1f662a4b7520c3a39817988ef";
hash = "sha256-rKzyeLbXNBL3wGXYtb3n9YNU0Qwm1Tsl2XPJYXMEjAo=";
};
nativeBuildInputs = with pkgs; [ haxe ];
configurePhase = ''
runHook preConfigure
export HOME="$(pwd)"
echo '${deps}' > .haxelib
runHook postConfigure
'';
buildPhase = ''
runHook preBuild
haxe build.hxml
runHook postBuild
'';
installPhase = ''
runHook preInstall
mkdir -p $out/bin
echo '#!${pkgs.nodejs}/bin/node' > $out/bin/haxe-language-server
cat bin/server.js >> $out/bin/haxe-language-server
chmod +x $out/bin/haxe-language-server
runHook postInstall
'';
}