~jack/simple-haskell-flake

Function for making simple Haskell flakes
README.md: Add flake-utils to `inputs.simple-haskell-flake.follows`
flake.lock: Add
Add licence

refs

master
browse  log 

clone

read-only
https://git.sr.ht/~jack/simple-haskell-flake
read/write
git@git.sr.ht:~jack/simple-haskell-flake

You can also use your local clone with git send-email.

#simple-haskell-flake

Provides a function for building simple flakes for single-package Haskell projects. It wraps the nixpkgs Haskell infrastructure and does not use IFD.

#Example

{
  description = "aeson-dependent-sum";

  inputs = {
    nixpkgs.url = "nixpkgs";
    simple-haskell-flake = {
      url = "sourcehut:~jack/simple-haskell-flake";
      inputs = {
        nixpkgs.follows = "nixpkgs";

        # Optional; it's tiny.
        flake-utils.follows = "flake-utils";
      };
    };
    flake-compat = {
      url = "github:edolstra/flake-compat";
      flake = false;
    };
  };

  outputs = inputs: inputs.simple-haskell-flake.lib.makeFlake {
    # Generate this file yourself using cabal2nix.
    packageFile = ./aeson-dependent-sum.nix;
    overrides = final: prev: {
      tasty-hedgehog = prev.callHackage "tasty-hedgehog" "1.2.0.0" { };
    };

    testGhcVersions = [ "ghc884" "ghc8107" "ghc902" "ghc924" ];
    testSystems = [ "x86_64-linux" ];
  };
}

#Reference

This flake provides one function:

lib.makeFlake =
  # Configure the package itself
  ## Path to the package nix file, generated by cabal2nix
  { packageFile
  ## Arguments passed to haskellPackages.callPackage after the packageFile.
  , packageArgs ? { }
  ## Overrides to apply to the Haskell package set.
  , overrides ? final: prev: { }

  # Configure packages/devShells
  , defaultGhcVersion ? null
  ## List of GHC versions to use in packages/devShells (default: any ghc[0-9]* in haskell.packages)
  , ghcVersions ? null
  , systems ? inputs.flake-utils.lib.defaultSystems

  # Configure hydraJobs
  ## List of GHC versions to use in hydraJobs (default: any ghc[0-9]* in haskell.packages)
  , testGhcVersions ? null
  , testSystems ? inputs.flake-utils.lib.defaultSystems
  }: ...
Do not follow this link