4r/flake.nix

78 lines
2.1 KiB
Nix

{
description = "4r";
inputs = {
nixpkgs.url = github:NixOS/nixpkgs/22.05;
utils.url = github:numtide/flake-utils;
relude-src = {
url = github:kowainik/relude/v1.1.0.0;
flake = false;
};
doctest-src = {
url = github:sol/doctest/0.20.0;
flake = false;
};
servant-src = {
url = github:haskell-servant/servant;
flake = false;
};
polysemy-zoo-src = {
url = github:polysemy-research/polysemy-zoo/006421384e61f4a7f66670e69af926735c91a65e;
flake = false;
};
polysemy-src.url = github:polysemy-research/polysemy/v1.7.1.0;
servant-polysemy-src = {
url = github:AJChapman/servant-polysemy/v0.1.3;
flake = false;
};
};
outputs = inputs@{ nixpkgs, utils, ... }:
utils.lib.eachDefaultSystem (system:
let nixpkgs' = import nixpkgs {
inherit system;
};
this = ghcVersion:
let pkgs = nixpkgs'.haskell.packages.${ghcVersion}.override {
overrides = (import ./nix/dependencies.nix inputs ghcVersion);
};
in
pkgs.mkDerivation {
pname = "4r";
version = "0.1.0";
src = ./.;
isExecutable = true;
executableHaskellDepends = with pkgs; [
aeson
ansi-terminal
base
commonmark
commonmark-extensions
cryptohash-sha512
http-api-data
http-client
optparse-applicative
polysemy
relude
servant
servant-client
servant-polysemy
unordered-containers
];
license = nixpkgs.lib.licenses.gpl3Plus;
};
thisNative = this "ghc922";
in
{
packages.default = thisNative;
apps.default = {
type = "app";
program = "${thisNative}/bin/4r";
};
devShells.default = thisNative.env;
});
}