Skip to content

Commit

Permalink
nix flake overrides
Browse files Browse the repository at this point in the history
  • Loading branch information
turion committed Nov 10, 2024
1 parent 95f6bbb commit fbcf226
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 12 deletions.
43 changes: 39 additions & 4 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 24 additions & 8 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable-small";
monad-schedule.url = "github:turion/monad-schedule";
};

outputs = inputs:
Expand Down Expand Up @@ -43,7 +44,7 @@
lib.genAttrs pnames (pname: hfinal.callCabal2nix pname ./${pname} { });

# A nixpkgs overlay containing everything defined in this repo, for reuse in downstream projects
overlay = final: prev:
localOverlay = final: prev:
let
hps = hpsFor final;

Expand All @@ -52,13 +53,6 @@
temporaryHaskellOverrides = with prev.haskell.lib.compose; [
(hfinal: hprev: {
monad-bayes = markUnbroken hprev.monad-bayes;
monad-schedule = hprev.callHackageDirect
{
pkg = "monad-schedule";
ver = "0.2";
sha256 = "sha256-Z9lAxkvJDH9aQZd65bGOQI3EGH7oSAhK0nuBKULgiCE=";
}
{ };
time-domain = hprev.callHackageDirect
{
pkg = "time-domain";
Expand All @@ -73,6 +67,22 @@
(hfinal: hprev: lib.optionalAttrs (lib.versionOlder hprev.ghc.version "9.4") {
time-domain = doJailbreak hprev.time-domain;
})
(hfinal: hprev: lib.optionalAttrs (lib.versionAtLeast hprev.ghc.version "9.10") {
# Remove these as nixpkgs progresses!
finite-typelits = doJailbreak hprev.finite-typelits;

vector-sized = hprev.callHackageDirect
{
pkg = "vector-sized";
ver = "1.6.1";
sha256 = "sha256-//EOAwpEEQkdYF88U/bp0uybKleYHRmTWaKsxIZvCeQ=";
}
{ };

microstache = doJailbreak hprev.microstache;
gloss-rendering = doJailbreak hprev.gloss-rendering;
gloss = doJailbreak hprev.gloss;
})
];

in
Expand Down Expand Up @@ -131,6 +141,12 @@
};
};

overlay = lib.composeManyExtensions
[
inputs.monad-schedule.overlays.default
localOverlay
];

# Helper to build a flake output for all systems that are defined in nixpkgs
forAllPlatforms = f:
mapAttrs (system: pkgs: f system (pkgs.extend overlay)) inputs.nixpkgs.legacyPackages;
Expand Down

0 comments on commit fbcf226

Please sign in to comment.