zls/default.nix
Sage Hane 6420296a82
Nix: Pass -Dcpu=baseline to zig build (#739)
* update flake.lock

* Nix: Pass `-Dcpu=baseline` to `zig build`
2022-11-03 14:44:01 -04:00

34 lines
982 B
Nix

{ pkgs ? import <nixpkgs> { }
, system ? builtins.currentSystem
}:
let
zig-overlay = pkgs.fetchFromGitHub {
owner = "arqv";
repo = "zig-overlay";
rev = "5b9504b8bff072553051d6e130727f7f5c0715c3";
sha256 = "NDm5qT6/qr789IhI2dsQxrR5/Mr7cXVj17x/+tl3pDE=";
};
gitignoreSrc = pkgs.fetchFromGitHub {
owner = "hercules-ci";
repo = "gitignore";
rev = "c4662e662462e7bf3c2a968483478a665d00e717";
sha256 = "1npnx0h6bd0d7ql93ka7azhj40zgjp815fw2r6smg8ch9p7mzdlx";
};
inherit (import gitignoreSrc { inherit (pkgs) lib; }) gitignoreSource;
zig = (import zig-overlay { inherit pkgs system; }).master.latest;
in
pkgs.stdenvNoCC.mkDerivation {
name = "zls";
version = "master";
src = gitignoreSource ./.;
nativeBuildInputs = [ zig ];
dontConfigure = true;
dontInstall = true;
buildPhase = ''
mkdir -p $out
zig build install -Dcpu=baseline -Drelease-safe=true -Ddata_version=master --prefix $out
'';
XDG_CACHE_HOME = ".cache";
}