-
Notifications
You must be signed in to change notification settings - Fork 28
/
flake.nix
51 lines (46 loc) · 1.47 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
{
description = ''
Language server proxy which enables sharing a single language server,
like rust-analyzer, between multiple LSP clients (editor windows).
'';
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
rust-overlay.url = "github:oxalica/rust-overlay";
utils.url = "github:numtide/flake-utils";
rust-overlay.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = { self, nixpkgs, rust-overlay, utils }:
utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [(import rust-overlay)];
};
rustToolchain = pkgs.rust-bin.stable."1.80.1".minimal;
rustPlatform = pkgs.makeRustPlatform {
cargo = rustToolchain;
rustc = rustToolchain;
};
rustDev = rustToolchain.override {
extensions = ["rust-src" "rust-analyzer" "rust-docs" "clippy"];
};
# We want to use some unstable options in `rustfmt.toml` and
# unfortunately the only way to do that is use nightly rustfmt.
rustFmt = pkgs.rust-bin.nightly."2024-07-07".minimal.override {
extensions = ["rustfmt"];
};
in {
packages.default = rustPlatform.buildRustPackage {
pname = "ra-multiplex";
version = "0.2.5";
src = self;
cargoLock.lockFile = ./Cargo.lock;
};
devShells.default = pkgs.mkShell {
nativeBuildInputs = [
rustDev
rustFmt
];
};
});
}