Skip to content

Commit

Permalink
nix
Browse files Browse the repository at this point in the history
  • Loading branch information
k0001 committed Dec 11, 2023
1 parent f32011f commit 551f8b9
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 86 deletions.
88 changes: 48 additions & 40 deletions flake.lock

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

74 changes: 28 additions & 46 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -1,54 +1,36 @@
{
description = "di";
inputs = {
nixpkgs = {
url = "github:NixOS/nixpkgs/389cc28963163614765721eda940fd5299f18458";
};
flake-parts = { url = "github:hercules-ci/flake-parts"; };
hs_bsb-http-chunked = {
url =
"github:sjakobi/bsb-http-chunked/c0ecd72fe2beb1cf7de9340cc8b4a31045460532";
flake = false;
};
hs_streaming = {
url = "github:haskell-streaming/streaming/0.2.4.0";
flake = false;
};
flakety.url = "github:k0001/flakety";
nixpkgs.follows = "flakety/nixpkgs";
flake-parts.follows = "flakety/flake-parts";
};

outputs = inputs@{ ... }:
inputs.flake-parts.lib.mkFlake { inherit inputs; } {
flake.overlays.default = final: prev:
let
hsLib = prev.haskell.lib;
hsClean = drv:
hsLib.overrideCabal drv
(old: { src = prev.lib.sources.cleanSource old.src; });
in {
haskell = prev.haskell // {
packageOverrides = prev.lib.composeExtensions
(prev.haskell.packageOverrides or (_: _: { })) (hself: hsuper: {
df1 = hsClean (hself.callPackage ./df1 { });
df1-html = hsClean (hself.callPackage ./df1-html { });
di = hsClean (hself.callPackage ./di { });
di-core = hsClean (hself.callPackage ./di-core { });
di-df1 = hsClean (hself.callPackage ./di-df1 { });
di-handle = hsClean (hself.callPackage ./di-handle { });
di-monad = hsClean (hself.callPackage ./di-monad { });

streaming =
hself.callCabal2nix "streaming" inputs.hs_streaming { };

# hoogle stuff
bsb-http-chunked = hself.callCabal2nix "bsb-http-chunked"
inputs.hs_bsb-http-chunked { };
warp = hsLib.dontCheck (hself.callHackage "warp" "3.3.25" { });
warp-tls =
hsLib.dontCheck (hself.callHackage "warp-tls" "3.3.6" { });
recv = hself.callHackage "recv" "0.1.0" { };
});
};
};
flake.overlays.default = inputs.nixpkgs.lib.composeManyExtensions [
inputs.flakety.overlays.default
(final: prev:
let
hsLib = prev.haskell.lib;
hsClean = drv:
hsLib.overrideCabal drv
(old: { src = prev.lib.sources.cleanSource old.src; });
in {
haskell = prev.haskell // {
packageOverrides = prev.lib.composeExtensions
(prev.haskell.packageOverrides or (_: _: { })) (hself: hsuper: {
df1 = hsClean (hself.callPackage ./df1 { });
df1-html = hsClean (hself.callPackage ./df1-html { });
di = hsClean (hself.callPackage ./di { });
di-core = hsClean (hself.callPackage ./di-core { });
di-df1 = hsClean (hself.callPackage ./di-df1 { });
di-handle = hsClean (hself.callPackage ./di-handle { });
di-monad = hsClean (hself.callPackage ./di-monad { });
});
};
})
];
systems = [ "x86_64-linux" ];
perSystem = { config, pkgs, system, ... }: {
_module.args.pkgs = import inputs.nixpkgs {
Expand All @@ -69,12 +51,12 @@
config.devShells.ghc
];
};
inherit (pkgs.haskell.packages.ghc962)
inherit (pkgs.haskell.packages.ghc98)
df1 df1-html di di-core di-df1 di-handle di-monad;
};
devShells = {
default = config.devShells.ghc;
ghc = pkgs.haskell.packages.ghc962.shellFor {
ghc = pkgs.haskell.packages.ghc98.shellFor {
packages = p: [
p.df1
p.df1-html
Expand Down

0 comments on commit 551f8b9

Please sign in to comment.