nixpkgs/pkgs/development/tools/language-servers/nil/default.nix
Maximilian Bosch 2b4e18f3d4
nixVersions.unstable: build from master, re-init at 2.22.0.pre20240321_6fd2f42c
The idea behind that is to enable users and developers of
downstream tools such as home-manager to test Nix master for several
reasons:

* Nix is currently trying to have a `master` branch that's always
  releasable[1]. We're still on Nix 2.18 in nixpkgs due to too many
  notable regressions. Enabling people to test latest master may help on
  that end.

* This uses the most bleeding-edge Nix, but our packaging, so we can
  identify issues with our packaging early.

* From what I've seen, most people are using the packages from nixpkgs
  anyways instead of the upstream flake, this is far more convenient
  anyways.

My plan is to update this once a week. Right now we rely on the
`installCheckPhase` here, but as soon as we have proper regression
testing[2], we may want to add `nixUnstable` there as well (however with
failures being allowed probably).

[1] https://discourse.nixos.org/t/nix-release-schedule-and-roadmap/14204
[2] https://github.com/NixOS/nixpkgs/pull/304332
2024-04-28 21:59:04 +02:00

38 lines
987 B
Nix

{ lib, rustPlatform, fetchFromGitHub, nixVersions, nix-update-script }:
rustPlatform.buildRustPackage rec {
pname = "nil";
version = "2023-08-09";
src = fetchFromGitHub {
owner = "oxalica";
repo = pname;
rev = version;
hash = "sha256-fZ8KfBMcIFO/R7xaWtB85SFeuUjb9SCH8fxYBnY8068=";
};
cargoHash = "sha256-lyKPmzuZB9rCBI9JxhxlyDtNHLia8FXGnSgV+D/dwgo=";
nativeBuildInputs = [
(lib.getBin nixVersions.latest)
];
env.CFG_RELEASE = version;
# might be related to https://github.com/NixOS/nix/issues/5884
preBuild = ''
export NIX_STATE_DIR=$(mktemp -d)
'';
passthru.updateScript = nix-update-script { };
meta = with lib; {
description = "Yet another language server for Nix";
homepage = "https://github.com/oxalica/nil";
changelog = "https://github.com/oxalica/nil/releases/tag/${version}";
license = with licenses; [ mit asl20 ];
maintainers = with maintainers; [ figsoda oxalica ];
mainProgram = "nil";
};
}