-
Jean-Paul Calderone authoredJean-Paul Calderone authored
flake.nix 3.05 KiB
{
description = "gbs-downloader";
inputs = {
# Nix Inputs
nixpkgs.follows = "hs-flake-utils/nixpkgs";
flake-utils.url = github:numtide/flake-utils;
hs-flake-utils.url = "git+https://whetstone.private.storage/jcalderone/hs-flake-utils.git?ref=main";
tahoe-chk = {
url = "git+https://whetstone.private.storage/PrivateStorage/tahoe-chk?ref=refs/tags/0.1.0.0";
inputs.nixpkgs.follows = "hs-flake-utils/nixpkgs";
};
tahoe-great-black-swamp = {
url = "git+https://whetstone.private.storage/PrivateStorage/tahoe-great-black-swamp?ref=refs/tags/0.1.0.1";
inputs.nixpkgs.follows = "hs-flake-utils/nixpkgs";
};
};
outputs = {
self,
nixpkgs,
flake-utils,
hs-flake-utils,
tahoe-chk,
tahoe-great-black-swamp,
}: let
ulib = flake-utils.lib;
ghcVersion = "ghc8107";
in
ulib.eachSystem ["x86_64-linux" "aarch64-darwin"] (system: let
# Get a nixpkgs customized for this system and including our overlay.
pkgs = import nixpkgs {
inherit system;
};
hslib = hs-flake-utils.lib {
inherit pkgs;
src = ./.;
compilerVersion = ghcVersion;
packageName = "gbs-downloader";
hsPkgsOverrides = import ./nix/haskell-packages.nix {
tahoe-chk = tahoe-chk.outputs.packages.${system}.default;
tahoe-great-black-swamp = tahoe-great-black-swamp.outputs.packages.${system}.default;
haskellLib = pkgs.haskell.lib;
};
};
in {
checks = hslib.checks {};
devShells = hslib.devShells {
extraBuildInputs = pkgs:
with pkgs; [
# We configure cabal to use zlib:pkg-config so we better supply
# pkg-config in the dev shell or `cabal ...` builds will surely
# fail.
pkg-config
# And also that pesky zlib dependency.
zlib
];
};
packages = hslib.packages {};
apps.hlint = hslib.apps.hlint {};
# Using the working directory of `nix run`, do a build with cabal and
# then run the test suite.
apps.cabal-test = {
type = "app";
program = "${
pkgs.writeShellApplication {