nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 rustPlatform,
4 fetchFromGitHub,
5 nix,
6 nixfmt,
7 nix-update-script,
8}:
9
10rustPlatform.buildRustPackage rec {
11 pname = "nil";
12 version = "2025-06-13";
13
14 src = fetchFromGitHub {
15 owner = "oxalica";
16 repo = "nil";
17 rev = version;
18 hash = "sha256-oxvVAFUO9husnRk6XZcLFLjLWL9z0pW25Fk6kVKwt1c=";
19 };
20
21 cargoHash = "sha256-OZIajxv8xNfCGalVw/FUAwWdQzPqfGuDoeRg2E2RR7s=";
22
23 nativeBuildInputs = [ nix ];
24
25 env = {
26 CFG_RELEASE = version;
27 CFG_DEFAULT_FORMATTER = lib.getExe nixfmt;
28 };
29
30 # might be related to https://github.com/NixOS/nix/issues/5884
31 preBuild = ''
32 export NIX_STATE_DIR=$(mktemp -d)
33 '';
34
35 passthru.updateScript = nix-update-script { };
36
37 meta = {
38 description = "Yet another language server for Nix";
39 homepage = "https://github.com/oxalica/nil";
40 changelog = "https://github.com/oxalica/nil/releases/tag/${version}";
41 license = with lib.licenses; [
42 mit
43 asl20
44 ];
45 maintainers = with lib.maintainers; [
46 oxalica
47 ];
48 mainProgram = "nil";
49 };
50}