2022-07-18 18:12:17 +01:00
|
|
|
{
|
|
|
|
inputs = {
|
|
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
|
|
|
|
2022-08-26 16:34:18 +01:00
|
|
|
zig-overlay.url = "github:mitchellh/zig-overlay";
|
2022-07-18 18:12:17 +01:00
|
|
|
zig-overlay.inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
|
|
|
|
gitignore.url = "github:hercules-ci/gitignore.nix";
|
|
|
|
gitignore.inputs.nixpkgs.follows = "nixpkgs";
|
2022-07-19 04:42:20 +01:00
|
|
|
|
|
|
|
flake-utils.url = "github:numtide/flake-utils";
|
2022-07-19 07:08:04 +01:00
|
|
|
|
|
|
|
known-folders.url = "github:ziglibs/known-folders";
|
|
|
|
known-folders.flake = false;
|
2022-12-29 18:36:38 +00:00
|
|
|
|
2023-02-11 22:04:22 +00:00
|
|
|
diffz.url = "github:ziglibs/diffz";
|
|
|
|
diffz.flake = false;
|
|
|
|
|
2022-12-29 18:36:38 +00:00
|
|
|
tres.url = "github:ziglibs/tres";
|
|
|
|
tres.flake = false;
|
2022-07-18 18:12:17 +01:00
|
|
|
};
|
2022-11-03 18:44:01 +00:00
|
|
|
|
2023-02-11 22:12:15 +00:00
|
|
|
outputs = { self, nixpkgs, zig-overlay, gitignore, flake-utils, known-folders, tres, diffz }:
|
2022-07-18 18:12:17 +01:00
|
|
|
let
|
2022-07-19 04:42:20 +01:00
|
|
|
systems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
|
2022-07-18 18:12:17 +01:00
|
|
|
inherit (gitignore.lib) gitignoreSource;
|
2022-11-03 18:44:01 +00:00
|
|
|
in
|
|
|
|
flake-utils.lib.eachSystem systems (system:
|
2022-07-19 04:42:20 +01:00
|
|
|
let
|
|
|
|
pkgs = nixpkgs.legacyPackages.${system};
|
2022-08-26 16:34:18 +01:00
|
|
|
zig = zig-overlay.packages.${system}.master;
|
2022-11-03 18:44:01 +00:00
|
|
|
in
|
|
|
|
rec {
|
2022-07-19 04:42:20 +01:00
|
|
|
packages.default = packages.zls;
|
|
|
|
packages.zls = pkgs.stdenvNoCC.mkDerivation {
|
|
|
|
name = "zls";
|
|
|
|
version = "master";
|
|
|
|
src = gitignoreSource ./.;
|
|
|
|
nativeBuildInputs = [ zig ];
|
|
|
|
dontConfigure = true;
|
|
|
|
dontInstall = true;
|
|
|
|
buildPhase = ''
|
|
|
|
mkdir -p $out
|
2023-02-11 22:04:22 +00:00
|
|
|
zig build install -Dcpu=baseline -Doptimize=ReleaseSafe -Ddata_version=master -Dtres=${tres}/tres.zig -Dknown-folders=${known-folders}/known-folders.zig -Ddiffz=${diffz}/DiffMatchPatch.zig --prefix $out
|
2022-07-19 04:42:20 +01:00
|
|
|
'';
|
|
|
|
XDG_CACHE_HOME = ".cache";
|
|
|
|
};
|
|
|
|
}
|
2022-11-03 18:44:01 +00:00
|
|
|
);
|
2022-07-18 18:12:17 +01:00
|
|
|
}
|