-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
62 lines (61 loc) · 1.68 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
52
53
54
55
56
57
58
59
60
61
62
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
systems.url = "github:nix-systems/default";
devshell = {
url = "github:numtide/devshell";
inputs.nixpkgs.follows = "nixpkgs";
inputs.systems.follows = "systems";
};
roc = {
url = "github:roc-lang/roc";
};
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs.nixpkgs.follows = "nixpkgs";
# see: https://github.com/NixOS/nix/issues/5790
inputs.flake-utils.inputs.systems.follows = "systems";
};
};
outputs = { self, systems, nixpkgs, devshell, roc, rust-overlay }:
let
eachSystem = f:
nixpkgs.lib.genAttrs
(import systems)
(
system: f {
roc = roc.packages.${system}.full;
pkgs = import nixpkgs {
inherit system;
overlays = [ devshell.overlays.default (import rust-overlay) ];
};
}
);
in
{
devShells = eachSystem ({ pkgs, roc }: {
default =
let
rust-toolchain = pkgs.rust-bin.selectLatestNightlyWith
(toolchain: toolchain.default.override {
extensions = [ "rust-src" "rust-analyzer" ];
});
in
pkgs.devshell.mkShell {
motd = "";
packages = with pkgs; [
# Python
(python311.withPackages (p: with p; [ black isort ipython ]))
# Roc
roc
# Rust
rust-toolchain
bacon
cargo-expand
cargo-sort
evcxr
];
};
});
};
}