Skip to content

Commit

Permalink
nix: Add convenience override functions
Browse files Browse the repository at this point in the history
Signed-off-by: Nick Spinale <nick@nickspinale.com>
  • Loading branch information
nspin committed Jun 26, 2024
1 parent 21bd721 commit 54f758e
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion hacking/nix/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,21 @@ let
inherit lib pkgs;
} // import ./top-level self);

this = makeOverridableWith lib.id mkThis baseArgs;
this = lib.fix (self: makeOverridableWith lib.id mkThis baseArgs // rec {
overrideNixpkgsArgs = f: self.override (superArgs: selfBase:
let
concreteSuperArgs = superArgs selfBase;
in
concreteSuperArgs // {
nixpkgsArgsFor = crossSystem: f (concreteSuperArgs.nixpkgsArgsFor crossSystem);
}
);
withOverlays = overlays: self.overrideNixpkgsArgs (superNixpkgsArgs:
superNixpkgsArgs // {
overlays = superNixpkgsArgs.overlays ++ overlays;
}
);
});

in
this

0 comments on commit 54f758e

Please sign in to comment.