-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathflake.nix
More file actions
65 lines (53 loc) · 1.62 KB
/
flake.nix
File metadata and controls
65 lines (53 loc) · 1.62 KB
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
rust-overlay.url = "github:oxalica/rust-overlay";
systems.url = "github:nix-systems/default";
};
outputs = {
nixpkgs,
systems,
...
} @ inputs: let
eachSystem = f:
nixpkgs.lib.genAttrs (import systems) (
system:
f (import nixpkgs {
inherit system;
overlays = [inputs.rust-overlay.overlays.default];
})
);
rustToolchain = eachSystem (pkgs: (pkgs.rust-bin.stable.latest.default.override {
extensions = ["rust-src"];
}));
in {
devShells = eachSystem (pkgs: {
default = pkgs.mkShell {
RUST_SRC_PATH = pkgs.rustPlatform.rustLibSrc;
packages = [
rustToolchain.${pkgs.system}
pkgs.rust-analyzer-unwrapped
pkgs.cargo
pkgs.cargo-insta
pkgs.cargo-hack
pkgs.bacon
pkgs.nodejs
# Alternatively, you can use a specific major version of Node.js
# pkgs.nodejs-22_x
# Use corepack to install npm/pnpm/yarn as specified in package.json
pkgs.corepack
# To install a specific alternative package manager directly,
# comment out one of these to use an alternative package manager.
# pkgs.yarn
# pkgs.pnpm
# pkgs.bun
# Required to enable the language server
pkgs.nodePackages.typescript
pkgs.nodePackages.typescript-language-server
# Python is required on NixOS if the dependencies require node-gyp
# pkgs.python3
];
};
});
};
}