Skip to content

Commit

Permalink
Merge pull request #51 from NixOS/cargo
Browse files Browse the repository at this point in the history
Fix cargo missing in dev env
  • Loading branch information
infinisil authored Apr 18, 2024
2 parents 6090c42 + fd9a167 commit ff3553e
Showing 1 changed file with 13 additions and 18 deletions.
31 changes: 13 additions & 18 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -45,26 +45,22 @@ let
settings.formatter.shfmt.options = [ "--space-redirects" ];
};

results = {
# We're using this value as the root result. By default, derivations expose all of their
# internal attributes, which is very messy. We prevent this using lib.lazyDerivation
build = lib.lazyDerivation {
derivation = pkgs.callPackage ./package.nix {
inherit
nixpkgsLibPath
initNix
runtimeExprPath
testNixpkgsPath
version
;
};
packages = {
build = pkgs.callPackage ./package.nix {
inherit
nixpkgsLibPath
initNix
runtimeExprPath
testNixpkgsPath
version
;
};

shell = pkgs.mkShell {
env.NIX_CHECK_BY_NAME_EXPR_PATH = toString runtimeExprPath;
env.NIX_PATH = "test-nixpkgs=${toString testNixpkgsPath}:test-nixpkgs/lib=${toString nixpkgsLibPath}";
env.RUST_SRC_PATH = "${pkgs.rustPlatform.rustLibSrc}";
inputsFrom = [ results.build ];
inputsFrom = [ packages.build ];
nativeBuildInputs = with pkgs; [
npins
rust-analyzer
Expand Down Expand Up @@ -139,7 +135,7 @@ let
pkgs.runCommand "test-nixpkgs-check-by-name"
{
nativeBuildInputs = [
results.build
packages.build
pkgs.nix
];
nixpkgsPath = nixpkgs;
Expand All @@ -151,15 +147,14 @@ let
'';
};
in
results.build
// results
packages
// {

# Good for debugging
inherit pkgs;

# Built by CI
ci = pkgs.linkFarm "ci" results;
ci = pkgs.linkFarm "ci" packages;

# Used by CI to determine whether a new version should be released
inherit version;
Expand Down

0 comments on commit ff3553e

Please sign in to comment.