Skip to content

Commit

Permalink
Fix Nix build (aristanetworks#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabriella439 authored Nov 26, 2022
1 parent 9b54686 commit e36a1a9
Showing 1 changed file with 32 additions and 23 deletions.
55 changes: 32 additions & 23 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,33 +11,39 @@

outputs = { nixpkgs, utils, ... }:
let
compiler = "ghc92";

overlay = pkgsNew: pkgsOld: {
cabal2nix-unwrapped =
pkgsNew.haskell.lib.justStaticExecutables
pkgsNew.haskell.packages.ghc92.cabal2nix;

haskellPackages = pkgsOld.haskellPackages.override (old: {
overrides =
pkgsNew.lib.fold pkgsNew.lib.composeExtensions (old.overrides or (_: _: { })) [
(pkgsNew.haskell.lib.packageSourceOverrides {
nix-serve-ng = ./.;
})
(haskellPackagesNew: haskellPackagesOld: {
nix-serve-ng =
pkgsNew.haskell.lib.overrideCabal
haskellPackagesOld.nix-serve-ng
(old: {
executableSystemDepends = (old.executableSystemDepends or []) ++ [
pkgsNew.boost.dev
];
});
})
];
});
pkgsNew.haskell.packages."${compiler}".cabal2nix;

haskell = pkgsOld.haskell // {
packages = pkgsOld.haskell.packages // {
"${compiler}" = pkgsOld.haskell.packages."${compiler}".override (old: {
overrides =
pkgsNew.lib.fold pkgsNew.lib.composeExtensions (old.overrides or (_: _: { })) [
(pkgsNew.haskell.lib.packageSourceOverrides {
nix-serve-ng = ./.;
})
(haskellPackagesNew: haskellPackagesOld: {
nix-serve-ng =
pkgsNew.haskell.lib.overrideCabal
haskellPackagesOld.nix-serve-ng
(old: {
executableSystemDepends = (old.executableSystemDepends or []) ++ [
pkgsNew.boost.dev
];
});
})
];
});
};
};

nix-serve-ng =
pkgsNew.haskell.lib.justStaticExecutables
pkgsNew.haskellPackages.nix-serve-ng;
pkgsNew.haskell.packages."${compiler}".nix-serve-ng;
};

in
Expand Down Expand Up @@ -68,13 +74,16 @@
defaultApp = apps.default;

devShells.default =
(pkgs.haskell.lib.doBenchmark pkgs.haskellPackages.nix-serve-ng).env;
(pkgs.haskell.lib.doBenchmark
pkgs.haskell.packages."${compiler}".nix-serve-ng
).env;

devShell = devShells.default;
}) // rec {
overlays = {
# The default overlay only adds the exports for
# `pkgs.haskellPackages.nix-serve-ng` and `pkgs.nix-serve-ng`
# `pkgs.haskell.packages."${compiler}".nix-serve-ng` and
# `pkgs.nix-serve-ng`
default = [ overlay ];

# This overlay additionally overrides `pkgs.nix-serve` to refer to
Expand Down

0 comments on commit e36a1a9

Please sign in to comment.