Added configuration options (fixed)
This commit is contained in:
parent
ff6686cd66
commit
f9df6eb340
76
default.nix
76
default.nix
@ -1,8 +1,10 @@
|
|||||||
let
|
let
|
||||||
zig-overlay = import (builtins.fetchGit {
|
zig-overlay = import (
|
||||||
url = "https://github.com/arqv/zig-overlay.git";
|
builtins.fetchGit {
|
||||||
rev = "a56601116906a2f192702e0b97487b8e7f796fdc";
|
url = "https://github.com/arqv/zig-overlay.git";
|
||||||
});
|
rev = "a56601116906a2f192702e0b97487b8e7f796fdc";
|
||||||
|
}
|
||||||
|
);
|
||||||
pkgs = import <nixpkgs> { overlays = [ zig-overlay ]; };
|
pkgs = import <nixpkgs> { overlays = [ zig-overlay ]; };
|
||||||
|
|
||||||
gitignoreSrc = pkgs.fetchFromGitHub {
|
gitignoreSrc = pkgs.fetchFromGitHub {
|
||||||
@ -13,39 +15,39 @@ let
|
|||||||
};
|
};
|
||||||
inherit (import gitignoreSrc { inherit (pkgs) lib; }) gitignoreSource;
|
inherit (import gitignoreSrc { inherit (pkgs) lib; }) gitignoreSource;
|
||||||
|
|
||||||
zig = pkgs.zig.custom {
|
zig-default = pkgs.zig.master;
|
||||||
sha256 = "7d715ea8948611734986d8a056fdec98d0f39b064e38efcd088823c02b1afba8";
|
in {
|
||||||
version = "0.6.0+91a1c20e7";
|
zig ? zig-default,
|
||||||
};
|
extraConfig ? {}
|
||||||
in
|
}:
|
||||||
pkgs.stdenvNoCC.mkDerivation {
|
|
||||||
name = "zls";
|
|
||||||
version = "master";
|
|
||||||
src = gitignoreSource ./.;
|
|
||||||
nativeBuildInputs = [
|
|
||||||
zig
|
|
||||||
];
|
|
||||||
|
|
||||||
dontConfigure = true;
|
pkgs.stdenvNoCC.mkDerivation {
|
||||||
buildPhase = ''
|
name = "zls";
|
||||||
zig build -Drelease-safe=true
|
version = "master";
|
||||||
'';
|
src = gitignoreSource ./.;
|
||||||
installPhase = ''
|
nativeBuildInputs = [
|
||||||
mkdir -p $out
|
zig
|
||||||
zig build install --prefix $out
|
];
|
||||||
|
|
||||||
# write configuration according to defaults described in README.md
|
dontConfigure = true;
|
||||||
cat << EOF > $out/bin/zls.json
|
buildPhase = ''
|
||||||
{
|
zig build -Drelease-safe=true
|
||||||
"zig_lib_path": "${zig}/lib/zig/",
|
'';
|
||||||
"zig_exe_path": "${zig}/bin/zig",
|
installPhase = ''
|
||||||
"warn_style": false,
|
mkdir -p $out
|
||||||
"enable_snippets": false,
|
zig build install --prefix $out
|
||||||
"enable_semantic_tokens": false,
|
|
||||||
"operator_completions": true
|
|
||||||
}
|
|
||||||
EOF
|
|
||||||
'';
|
|
||||||
|
|
||||||
XDG_CACHE_HOME = ".";
|
cat << EOF > $out/bin/zls.json
|
||||||
}
|
${builtins.toJSON {
|
||||||
|
zig_lib_path = "${zig}/lib/zig/";
|
||||||
|
zig_exe_path = "${zig}/bin/zig";
|
||||||
|
warn_style = false;
|
||||||
|
enable_snippets = false;
|
||||||
|
enable_semantic_tokens = false;
|
||||||
|
operator_completions = true;
|
||||||
|
} // extraConfig}
|
||||||
|
EOF
|
||||||
|
'';
|
||||||
|
|
||||||
|
XDG_CACHE_HOME = ".cache";
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user