{ 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.1"; inputs.nixpkgs.follows = "hs-flake-utils/nixpkgs"; }; tahoe-ssk = { url = "git+https://whetstone.private.storage/PrivateStorage/tahoe-ssk?ref=refs/tags/0.2.0.0"; inputs.nixpkgs.follows = "hs-flake-utils/nixpkgs"; inputs.tahoe-chk.follows = "tahoe-chk"; }; tahoe-great-black-swamp = { url = "git+https://whetstone.private.storage/PrivateStorage/tahoe-great-black-swamp?ref=refs/tags/0.3.0.0"; inputs.nixpkgs.follows = "hs-flake-utils/nixpkgs"; inputs.tahoe-chk.follows = "tahoe-chk"; }; }; outputs = { self, nixpkgs, flake-utils, hs-flake-utils, tahoe-chk, tahoe-ssk, 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-ssk = tahoe-ssk.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 { name = "cabal-build-and-test"; # Only put packages with things that need to be on PATH here # because that's all that runtimeInputs buys us. Packages with # different requirements need to be handled differently. runtimeInputs = with pkgs; [ pkg-config haskell.compiler.${ghcVersion} cabal-install ]; text = '' # Here we make zlib discoverable by pkg-config so cabal can find # headers and stuff. export PKG_CONFIG_PATH=${pkgs.lib.makeSearchPath "lib/pkgconfig" [pkgs.zlib.dev]} # Get (or update if we have one) a package database so cabal can # solve our dependencies. cabal update hackage.haskell.org # Configure with tests enable, build the tests (if necessary), # and run the default test suite. cabal run --enable-tests tests ''; } }/bin/cabal-build-and-test"; }; }); }