2022-08-04 10:53:05 +03:00
|
|
|
{
|
|
|
|
description = "Language Server for Nix Expression Language";
|
|
|
|
|
|
|
|
inputs = {
|
|
|
|
flake-utils.url = "github:numtide/flake-utils";
|
|
|
|
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
|
|
|
|
rust-overlay.url = "github:oxalica/rust-overlay";
|
|
|
|
rust-overlay.inputs.flake-utils.follows = "flake-utils";
|
|
|
|
rust-overlay.inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
|
|
|
|
|
|
|
outputs = { self, flake-utils, nixpkgs, rust-overlay }:
|
|
|
|
flake-utils.lib.eachDefaultSystem (system:
|
|
|
|
let
|
|
|
|
inherit (builtins) substring;
|
|
|
|
pkgs = nixpkgs.legacyPackages.${system};
|
|
|
|
rustPkgs = rust-overlay.packages.${system};
|
|
|
|
in {
|
|
|
|
packages = rec {
|
|
|
|
default = nil;
|
|
|
|
nil = pkgs.rustPlatform.buildRustPackage {
|
|
|
|
pname = "nil";
|
|
|
|
version = let mtime = self.lastModifiedDate; in
|
|
|
|
"unstable-${substring 0 4 mtime}-${substring 4 2 mtime}-${substring 6 2 mtime}";
|
|
|
|
src = ./.;
|
|
|
|
cargoLock.lockFile = ./Cargo.lock;
|
|
|
|
buildAndTestSubdir = "lsp";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
devShells.default = pkgs.mkShell {
|
|
|
|
packages = [
|
|
|
|
# Override the stable rustfmt.
|
|
|
|
rustPkgs.rust-nightly_2022-08-01.availableComponents.rustfmt
|
|
|
|
rustPkgs.rust
|
2022-08-12 15:09:26 +03:00
|
|
|
pkgs.gdb
|
2022-08-04 10:53:05 +03:00
|
|
|
pkgs.jq
|
|
|
|
(import ./neovim-env.nix { inherit pkgs; })
|
|
|
|
];
|
2022-08-10 12:44:46 +03:00
|
|
|
RUST_BACKTRACE = "short";
|
2022-08-04 10:53:05 +03:00
|
|
|
NIXPKGS = nixpkgs;
|
|
|
|
|
2022-08-10 12:44:46 +03:00
|
|
|
# bash
|
2022-08-04 10:53:05 +03:00
|
|
|
shellHook = ''
|
2022-08-10 12:44:46 +03:00
|
|
|
export NIL_PATH="$(cargo metadata --format-version=1 | jq -r .target_directory)/debug/nil"
|
2022-08-04 10:53:05 +03:00
|
|
|
'';
|
|
|
|
};
|
2022-08-09 10:14:02 +03:00
|
|
|
|
|
|
|
devShells.fuzz = pkgs.mkShell {
|
|
|
|
packages = [
|
|
|
|
rustPkgs.rust-nightly_2022-08-01
|
|
|
|
pkgs.cargo-fuzz
|
2022-08-09 12:01:01 +03:00
|
|
|
pkgs.llvmPackages_14.llvm
|
|
|
|
pkgs.jq
|
|
|
|
pkgs.gnugrep
|
2022-08-09 10:14:02 +03:00
|
|
|
];
|
2022-08-10 12:44:46 +03:00
|
|
|
RUST_BACKTRACE = "short";
|
2022-08-09 12:01:01 +03:00
|
|
|
|
|
|
|
# bash
|
|
|
|
shellHook = ''
|
|
|
|
export CARGO_TARGET_DIR=~/.cache/targets-syntax
|
|
|
|
'';
|
2022-08-09 10:14:02 +03:00
|
|
|
};
|
2022-08-04 10:53:05 +03:00
|
|
|
});
|
|
|
|
}
|