Skip to content
Snippets Groups Projects
  • Jean-Paul Calderone's avatar
    f654fcea
    stop using modern-uri · f654fcea
    Jean-Paul Calderone authored
    we need to use an _even older_ version of ghc than we're using now and
    modern-uri doesn't seem particularly amenable to that.
    
    network-uri is perfectly fine, anyway.
    f654fcea
    History
    stop using modern-uri
    Jean-Paul Calderone authored
    we need to use an _even older_ version of ghc than we're using now and
    modern-uri doesn't seem particularly amenable to that.
    
    network-uri is perfectly fine, anyway.
flake.nix 3.00 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=client-test";
      inputs.nixpkgs.follows = "hs-flake-utils/nixpkgs";
      inputs.tahoe-chk.follows = "tahoe-chk";
    };
  };

  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 = "${