aboutsummaryrefslogtreecommitdiff
path: root/flake.nix
diff options
context:
space:
mode:
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix63
1 files changed, 63 insertions, 0 deletions
diff --git a/flake.nix b/flake.nix
new file mode 100644
index 0000000..4f69fe8
--- /dev/null
+++ b/flake.nix
@@ -0,0 +1,63 @@
1{
2 inputs = {
3
4 nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
5
6 gitignore = {
7 url = "github:hercules-ci/gitignore.nix";
8 inputs.nixpkgs.follows = "nixpkgs";
9 };
10
11 rust-overlay = {
12 url = "github:oxalica/rust-overlay";
13 inputs.nixpkgs.follows = "nixpkgs";
14 };
15
16 };
17
18 outputs =
19 { self
20 , nixpkgs
21 , gitignore
22 , rust-overlay
23 }:
24 let
25 inherit (gitignore.lib) gitignoreSource;
26
27 supportedSystems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
28 forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
29 nixpkgsFor = forAllSystems (system:
30 import nixpkgs {
31 inherit system;
32 overlays = [rust-overlay.overlays.default];
33 });
34
35 in
36 {
37
38 devShell = forAllSystems (system:
39 let
40 pkgs = nixpkgsFor."${system}";
41 in
42 pkgs.mkShell {
43 nativeBuildInputs = [
44 pkgs.cargo-watch
45 pkgs.bacon
46 pkgs.rustfmt
47 pkgs.cargo
48
49 pkgs.rust-bin.nightly.latest.default
50 pkgs.rust-bin.nightly.latest.rust-analyzer
51 pkgs.lld
52 pkgs.trunk
53
54
55 pkgs.mermaid-cli
56 ];
57 RUST_LOG = "info";
58 RUST_BACKTRACE = 1;
59 });
60 };
61}
62
63