-
Notifications
You must be signed in to change notification settings - Fork 72
Expand file tree
/
Copy pathflake.nix
More file actions
99 lines (85 loc) · 2.19 KB
/
flake.nix
File metadata and controls
99 lines (85 loc) · 2.19 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
{
description = "A Nix flake for OSRD dev shell";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
flake-compat.url = "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz";
fenix = {
url = "github:nix-community/fenix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
{
nixpkgs,
fenix,
flake-utils,
...
}:
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = import nixpkgs {
inherit system;
};
fixedNode = pkgs.nodejs_24;
rustVer = fenix.packages.${system}.stable;
rustChan = rustVer.withComponents [
"cargo"
"clippy"
"rust-src"
"rustc"
"rustfmt"
"rust-analyzer"
];
osrd-dev-scripts = pkgs.callPackage ./nix/scripts.nix { };
in
with pkgs;
{
devShells.default = mkShell {
buildInputs = [
# Rust
rustChan
# Libs
geos
openssl
pkg-config
postgresql
# libs for playwright (see https://wiki.nixos.org/wiki/Playwright)
playwright-driver.browsers
# Tools & Libs
diesel-cli
cargo-watch
taplo
uv
openfga-cli
# Core
gradle
jdk21
# Front
fixedNode
# Nix formatter
nixfmt
nixd
# OSRD dev scripts
osrd-dev-scripts
jq
]
# Section added only on Linux systems
++ lib.optionals (!stdenv.isDarwin) [
# Linker
mold
]
# Section added only on Darwin (macOS) systems
++ lib.optionals stdenv.isDarwin [
libiconv
];
RUSTFLAGS = if stdenv.isDarwin then "" else "-C link-arg=-fuse-ld=mold";
shellHook = ''
export PLAYWRIGHT_BROWSERS_PATH=${pkgs.playwright-driver.browsers}
export PLAYWRIGHT_SKIP_VALIDATE_HOST_REQUIREMENTS=true
'';
};
}
);
}