-
Notifications
You must be signed in to change notification settings - Fork 5
/
shell.nix
53 lines (45 loc) · 1.39 KB
/
shell.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
{ ... }:
let
sources = import ./nix/sources.nix;
pkgs = import sources.nixpkgs { };
niv = import sources.niv { };
macosDeps = [ pkgs.darwin.apple_sdk.frameworks.CoreServices ];
linuxDeps = [
# only necessary until surgical linking is in Roc
pkgs.glibc
];
roc = pkgs.callPackage sources.roc {
cargoSha256 = "sha256-z4UK38Q5hNlAVqCx8ooOKNAI5ftJlLlTOsORf2c+Wmk=";
};
in pkgs.mkShell {
buildInputs = with pkgs;
[
niv.niv
git
typos
# roc tools
roc
(pkgs.writeShellScriptBin "sync-roc-std" ''
set -euo pipefail
ROOT="$(${pkgs.git}/bin/git rev-parse --show-toplevel)"
rm -rf "$ROOT/vendor/roc_std"
mkdir -p "$ROOT/vendor/roc_std"
${pkgs.rsync}/bin/rsync --chmod 0644 -r ${sources.roc}/crates/roc_std/ "$ROOT/vendor/roc_std"
'')
(pkgs.writeShellScriptBin "sync-glue" ''
set -euo pipefail
ROOT="$(${pkgs.git}/bin/git rev-parse --show-toplevel)"
${roc}/bin/roc glue "$ROOT/Package-Config.roc" "$ROOT/src/glue.rs"
${rustfmt}/bin/rustfmt "$ROOT/src/glue.rs"
'')
# rust tools
cargo
cargo-edit
rustPackages.clippy
rustc
rustfmt
libiconv
] ++ pkgs.lib.optionals pkgs.stdenv.isDarwin macosDeps
++ pkgs.lib.optionals pkgs.stdenv.isLinux linuxDeps;
NIXOS_GLIBC_PATH = if pkgs.stdenv.isLinux then pkgs.glibc else "";
}