Skip to content

Commit

Permalink
flake: support macos and improve readibility
Browse files Browse the repository at this point in the history
Signed-off-by: Élyse Viard <[email protected]>
  • Loading branch information
ElysaSrc committed Nov 7, 2024
1 parent 00a169a commit 337c478
Showing 1 changed file with 18 additions and 12 deletions.
30 changes: 18 additions & 12 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,17 @@
with pkgs;
{
devShells.default = mkShell {
nativeBuildInputs = [
# Rust
rustChan
# Linker
mold-wrapped
# Libs
geos
openssl
pkg-config
postgresql
];
buildInputs =
[
# Rust
rustChan

# Libs
geos
openssl
pkg-config
postgresql

# Tools & Libs
diesel-cli
cargo-watch
Expand All @@ -86,16 +84,24 @@

# OSRD dev scripts
osrd-dev-scripts

]
# Section added only on Linux systems
++ lib.optionals (!stdenv.isDarwin) [
# Linker
mold-wrapped
]
# Section added only on Darwin (macOS) systems
++ lib.optionals stdenv.isDarwin (
with pkgs.darwin.apple_sdk.frameworks;
[
CoreFoundation
SystemConfiguration
libiconv
]
);

RUSTFLAGS = "-C link-arg=-fuse-ld=mold";
RUSTFLAGS = if stdenv.isDarwin then "" else "-C link-arg=-fuse-ld=mold";
};
}
);
Expand Down

0 comments on commit 337c478

Please sign in to comment.