reddit-pub/flake.nix
2022-02-10 21:47:09 +02:00

66 lines
1.6 KiB
Nix

{
description = "A very basic flake";
inputs = {
easy-hls = {
url = "github:jkachmar/easy-hls-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
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.reddit-pub = pkgs.haskell.lib.justStaticExecutables hp.reddit-pub;
packages.reddit-pub-dhall = pkgs.dhallPackages.callPackage ./dhall.nix {};
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
hp.dhall-nixpkgs
];
};
}
);
}