cachix / devenv

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

devenv test failing #1160

Open jembishop opened 1 week ago

jembishop commented 1 week ago

I am trying to create a rust environment, and then run the devenv test command to verify it works on a CI job. When I set up the shell intitially it gave me this error:

 error:
       error: To use 'languages.rust.version', run the following command:

         $ devenv inputs add fenix github:nix-community/fenix --follows nixpkgs

So I ran the suggested command to get it to update the devenv.yaml and that seems to fix the devenv shell command. However I still get this error when running devenv test, and I'm not sure how to fix it. Here is the version of devenv.yaml after the update:

inputs:
  fenix:
    url: github:nix-community/fenix
    inputs:
      nixpkgs:
        follows: nixpkgs
  nixpkgs:
    url: github:cachix/devenv-nixpkgs/rolling

Here is my devenv.nix

{ pkgs, lib, ... }:

{
  languages.rust = {
    enable = true;
    channel = "stable";

    components = [ "rustc" "cargo" "clippy" "rustfmt" "rust-analyzer" ];
  };
  enterShell = ''
     source <(just --completions bash)
  '';
  enterTest = ''
    just init-project
  '';
  packages = [pkgs.just pkgs.pre-commit];
}

Version devenv 1.0.4 (aarch64-darwin)

norbertwnuk commented 1 week ago

That seems to be a problem with imports in v1.0.4, like described here: https://github.com/cachix/devenv/issues/1149. If that's the case, downgrade to v1.0.3 should resolve the problem:

nix profile list
nix profile remove X
nix profile install nixpkgs/e89cf1c932006531f454de7d652163a9a5c86668#devenv
domenkozar commented 1 week ago

I'll release 1.0.5 today/tomorrow to fix this.