reddit-pub/flake.nix

66 lines
1.6 KiB
Nix
Raw Normal View History

2021-11-24 19:26:58 +02:00
{
description = "A very basic flake";
inputs = {
2022-02-10 21:47:09 +02:00
easy-hls = {
url = "github:jkachmar/easy-hls-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
2021-11-24 19:26:58 +02:00
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 {
2022-02-10 18:07:49 +02:00
packages.reddit-pub = pkgs.haskell.lib.justStaticExecutables hp.reddit-pub;
packages.reddit-pub-dhall = pkgs.dhallPackages.callPackage ./dhall.nix {};
2021-11-24 19:26:58 +02:00
defaultPackage = packages.reddit-pub;
2022-02-10 18:07:49 +02:00
2021-11-24 19:26:58 +02:00
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
2022-02-10 18:07:49 +02:00
hp.dhall-nixpkgs
2021-11-24 19:26:58 +02:00
];
};
}
);
}