Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 13 additions & 6 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,19 @@
lib,
...
}: let
craneLibFor = p: (crane.mkLib p).overrideToolchain pkgs.lre.stableRustFor;
nightlyCraneLibFor = p: (crane.mkLib p).overrideToolchain pkgs.lre.nightlyRustFor;
# On Linux we build fully static musl binaries, elsewhere the default stdenv.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this but I'd like to explore giving people the option to run glibc at times when they need it. Musl is good default, though, for obvious reasons.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, that sounds reasonable. I could do that in a follow-up pr

stdenvSelectorFor = q:
if q.stdenv.targetPlatform.isLinux
then q.pkgsMusl.stdenv
else q.stdenv;
craneLibFor = p:
((crane.mkLib p).overrideToolchain pkgs.lre.stableRustFor).overrideScope (_: _: {
stdenvSelector = stdenvSelectorFor;
});
nightlyCraneLibFor = p:
((crane.mkLib p).overrideToolchain pkgs.lre.nightlyRustFor).overrideScope (_: _: {
stdenvSelector = stdenvSelectorFor;
});

src = pkgs.lib.cleanSourceWith {
src = (craneLibFor pkgs).path ./.;
Expand Down Expand Up @@ -124,10 +135,6 @@
in
{
inherit src;
stdenv = q:
if q.stdenv.targetPlatform.isLinux
then q.pkgsMusl.stdenv
else q.stdenv;
strictDeps = true;
buildInputs =
[p.cacert]
Expand Down
Loading