Skip to content

Commit

Permalink
nix: Expose overridesForMkCrate
Browse files Browse the repository at this point in the history
Signed-off-by: Nick Spinale <[email protected]>
  • Loading branch information
nspin committed Jun 26, 2024
1 parent 54f758e commit 7ea9573
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
12 changes: 5 additions & 7 deletions hacking/nix/scope/crates.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ let

globalPatchSection = workspaceManifest.patch;

overrides = {
overridesForMkCrate = {
sel4-sys = {
extraPaths = [
"build"
Expand Down Expand Up @@ -59,13 +59,11 @@ let
};

unAugmentedCrates = lib.listToAttrs (lib.forEach workspaceMemberPaths (cratePath: rec {
name = (crateUtils.crateManifest cratePath).package.name; # TODO redundant
value = crateUtils.mkCrate cratePath (overrides.${name} or {});
name = (crateUtils.crateManifest cratePath).package.name;
value = crateUtils.mkCrate cratePath (overridesForMkCrate.${name} or {});
}));

augmentedCrates = crateUtils.augmentCrates unAugmentedCrates;

crates = augmentedCrates;
crates = crateUtils.augmentCrates unAugmentedCrates;

isPrivate = crateName: builtins.match "^sel4-.*" crateName == null;

Expand All @@ -75,5 +73,5 @@ let
(lib.concatMapStrings (crateName: "${crateName}\n") (lib.attrNames publicCrates));

in {
inherit crates globalPatchSection publicCrates publicCratesTxt;
inherit crates overridesForMkCrate globalPatchSection publicCrates publicCratesTxt;
}
3 changes: 2 additions & 1 deletion hacking/nix/scope/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,8 @@ superCallPackage ../rust-utils {} self //
{ name = fname; path = builtins.toFile fname (builtins.readFile "${dir}/${fname}"); }
];

inherit (callPackage ./crates.nix {}) crates globalPatchSection publicCrates publicCratesTxt;
inherit (callPackage ./crates.nix {})
crates overridesForMkCrate globalPatchSection publicCrates publicCratesTxt;

distribution = callPackage ./distribution.nix {};

Expand Down

0 comments on commit 7ea9573

Please sign in to comment.