Skip to content

Commit

Permalink
🐛 Fix override for C platforms
Browse files Browse the repository at this point in the history
After calling `overrideFactory` on a C platform, the `override` function
was dropped from the resulting set.
  • Loading branch information
abbec committed Sep 12, 2024
1 parent 05b6885 commit 853b5db
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## Fixed
- Overriding the factory of a C platform caused the 'override' function
to disappear from the resulting set.

## [4.1.4] - 2024-06-03

## Fixed
Expand Down
11 changes: 5 additions & 6 deletions c/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ let
sha256 = "sha256:10m80cpdhk1jqvqvkzy8qls7nmsra77fx7rrq4snk0s46z1msafl";
} else mathjax;

inner =
mkPlatform =
{ name
, pkgs
, stdenv ? pkgs.stdenv
, output ? null
, platformOverrides ? _: { }
}:
}@args:
let
factory = pkgs.callPackage (import ./make-derivation.nix platformOverrides)
{
Expand All @@ -51,15 +51,14 @@ let
{
inherit name pkgs;
__functor = _self: factory;
override = overrides:
mkPlatform (args // overrides );
overrideFactory = overrides:
finalPlatform (
factory.override overrides);
finalPlatform (factory.override overrides);
} // lib.optionalAttrs (output != null) { inherit output; };
in
finalPlatform factory;

mkPlatform = lib.makeOverridable inner;

platforms' = {
_default = mkPlatform {
inherit pkgs;
Expand Down

0 comments on commit 853b5db

Please sign in to comment.