5010de46db
Simpler than using `fetchFromGitHub`, we can have `nix` manage the version instead
43 lines
1.4 KiB
Nix
43 lines
1.4 KiB
Nix
{
|
|
inputs = {
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
|
|
|
zig-overlay.url = "github:arqv/zig-overlay";
|
|
zig-overlay.inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
gitignore.url = "github:hercules-ci/gitignore.nix";
|
|
gitignore.inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
flake-utils.url = "github:numtide/flake-utils";
|
|
|
|
known-folders.url = "github:ziglibs/known-folders";
|
|
known-folders.flake = false;
|
|
};
|
|
|
|
outputs = {self, nixpkgs, zig-overlay, gitignore, flake-utils, known-folders }:
|
|
let
|
|
systems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
|
|
inherit (gitignore.lib) gitignoreSource;
|
|
in flake-utils.lib.eachSystem systems (system:
|
|
let
|
|
pkgs = nixpkgs.legacyPackages.${system};
|
|
zig = zig-overlay.packages.${system}.master.latest;
|
|
in rec {
|
|
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
|
|
zig build install -Drelease-safe=true -Ddata_version=master -Dknown-folders=${known-folders}/known-folders.zig --prefix $out
|
|
'';
|
|
XDG_CACHE_HOME = ".cache";
|
|
};
|
|
}
|
|
);
|
|
}
|