Skip to content

Commit

Permalink
nix/flake: fix MacOS build
Browse files Browse the repository at this point in the history
The MacOS build fails with:

> ++ command cargo build --release --message-format json-render-diagnostics --locked
>    Compiling gitlab-timelogs v0.2.2 (/private/tmp/nix-build-gitlab-timelogs-0.2.2.drv-0/8bm81sjfqmsk7lclw7pnddrxv785aaj3-source)
> error: linking with `cc` failed: exit status: 1

Fix by manually adding iconv as a dependency.

Other people also have encountered this:
nix-community/home-manager#3482
  • Loading branch information
blitz committed Jul 31, 2024
1 parent 3a99d4f commit 819117d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions nix/build.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
, lib
, nix-gitignore
, openssl
, iconv
, pkg-config
, stdenv
}:
Expand All @@ -17,9 +18,10 @@ let
];
buildInputs = [
openssl
] ++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [
SystemConfiguration
]);
] ++ lib.optionals stdenv.isDarwin [
iconv
darwin.apple_sdk.frameworks.SystemConfiguration
];
# Fix build. Reference:
# - https://github.com/sfackler/rust-openssl/issues/1430
# - https://docs.rs/openssl/latest/openssl/
Expand Down

0 comments on commit 819117d

Please sign in to comment.