cachix / devenv

Fast, Declarative, Reproducible, and Composable Developer Environments
https://devenv.sh
Apache License 2.0
4.54k stars 340 forks source link

[Feature Request:] Overriding the stdenv not yet possible #567

Closed 573 closed 8 months ago

573 commented 1 year ago

Describe the bug Currently it is not easily possible to override the stdenv, i. e. to compile to certain targets in rust / cargo.

To reproduce See sscce for this issue.

Version

devenv: 0.6.2

workflow commented 1 year ago

Related: https://github.com/cachix/devenv/issues/530

domenkozar commented 8 months ago

We're getting closer to fixing this, I'm not sure if overriding makes sense for the whole devenv but rather than parts of it?

domenkozar commented 8 months ago

For Rust see #900

Otherwise I'd suggest we add an option to devenv.yaml:

stdenv: pkgs.swift.stdenv

Would that work for your use case?

573 commented 8 months ago

900 looks like what is missing, the devenv.yaml option could be feasible from flakes as well then further up the road, so yeah, this would be a nice addition.

haraldh commented 8 months ago

my use case would be stdenv = pkgs.stdenvAdapters.useMoldLinker pkgs.stdenv;

        rustVersion = pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain;

        stdenv = pkgs.stdenvAdapters.useMoldLinker pkgs.stdenv;

        rustPlatform = (pkgs.makeRustPlatform {
          cargo = rustVersion;
          rustc = rustVersion;
          inherit stdenv;
        });
domenkozar commented 8 months ago

Can you try https://github.com/cachix/devenv/pull/1092 and tell me if that works for you as expected?

573 commented 8 months ago

Tried and worked. Thanks all for the work !