Skip to content

Commit 9e271a6

Browse files
Bump Nix Flake, fix darwin problems (#779)
<!-- The PR description should answer 2 (maybe 3) important questions: --> ### What A recent [nixpkgs change](NixOS/nixpkgs#401364) means we cannot build or use the development shells on `darwin`, this fixes that.
1 parent 0925861 commit 9e271a6

File tree

3 files changed

+18
-15
lines changed

3 files changed

+18
-15
lines changed

flake.lock

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

nix/app.nix

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,6 @@ let
3939
] ++ lib.optionals hostPlatform.isDarwin [
4040
# macOS-specific dependencies
4141
libiconv
42-
darwin.apple_sdk.frameworks.CoreFoundation
43-
darwin.apple_sdk.frameworks.Security
44-
darwin.apple_sdk.frameworks.SystemConfiguration
4542
];
4643
};
4744

nix/rust.nix

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,24 @@ let
2323
buildPlatform = pkgs.stdenv.buildPlatform;
2424
hostPlatform = pkgs.stdenv.hostPlatform;
2525

26+
# nixpkgs decided to change the name of the darwin targets which wrecks everything
27+
hostPlatformName =
28+
if hostPlatform.config == "arm64-apple-darwin"
29+
then "aarch64-apple-darwin"
30+
else hostPlatform.config;
31+
2632
# When possibly cross-compiling we get several versions of nixpkgs of the
2733
# form, `pkgs.pkgs<where it runs><platform it produces outputs for>`. We use
2834
# `pkgs.pkgsBuildHost` to get packages that run at build time (so run on the
2935
# build platform), and that produce outputs for the host platform which is the
3036
# cross-compilation target.
3137
rustBin = pkgs.pkgsBuildHost.rust-bin.fromRustupToolchainFile ../rust-toolchain.toml;
32-
rustToolchain = rustBin.override { targets = [ hostPlatform.config ]; };
38+
rustToolchain = rustBin.override { targets = [ hostPlatformName ]; };
3339
craneLib = (crane.mkLib pkgs).overrideToolchain rustToolchain;
3440

3541
buildEnv = {
36-
CARGO_BUILD_TARGET = hostPlatform.config;
37-
"CARGO_TARGET_${envCase hostPlatform.config}_LINKER" = "${pkgs.stdenv.cc.targetPrefix}cc";
42+
CARGO_BUILD_TARGET = hostPlatformName;
43+
"CARGO_TARGET_${envCase hostPlatformName}_LINKER" = "${pkgs.stdenv.cc.targetPrefix}cc";
3844

3945
# This environment variable may be necessary if any of your dependencies use
4046
# a build-script which invokes the `cc` crate to build some other code. The

0 commit comments

Comments
 (0)