reddit-pub/flake.nix
2021-11-24 19:26:58 +02:00

59 lines
1.4 KiB
Nix

{
description = "A very basic flake";
inputs = {
easy-hls = { url = "github:jkachmar/easy-hls-nix"; };
flake-utils = {
url = "github:numtide/flake-utils";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, flake-utils, easy-hls }:
{
overlay = final: prev: {
haskellPackages = prev.haskellPackages.override ( old: {
overrides = final.lib.composeExtensions ( old.overrides or (_: _: {})) (f: p: {
reddit-pub = f.callPackage ./. {};
});
} );
};
}
//
flake-utils.lib.eachSystem ["x86_64-linux" "x86_64-darwin"] ( system:
let
pkgs = import nixpkgs { inherit system; overlays = [ self.overlay ]; };
hp = pkgs.haskellPackages;
hls = (easy-hls.withGhcs [ hp.ghc.version ] ).${system};
in
rec {
packages = { inherit (hp) reddit-pub; };
defaultPackage = packages.reddit-pub;
devShell =
hp.shellFor {
packages = h: [h.reddit-pub];
withHoogle = true;
buildInputs = with pkgs; [
dhall-lsp-server
entr
cabal-install
hp.hlint
stylish-haskell
ghcid
hls
rrdtool
jq
sqlite-interactive
sqlite-interactive
hp.graphmod
];
};
}
);
}