Update base dep, allow to compile with ghc 9.6, add flake.nix

parent e0d9a8b3
...@@ -40,3 +40,14 @@ Currently, the `throttle` function spawns a `mapCleaner` thread which, ...@@ -40,3 +40,14 @@ Currently, the `throttle` function spawns a `mapCleaner` thread which,
periodically, checks the internal `TVar` value for values to clean up periodically, checks the internal `TVar` value for values to clean up
and values to hold before the given delay happens. and values to hold before the given delay happens.
## Building
The easiest is using nix flakes:
```shell
nix -L develop
cabal v2-test --test-show-details=streaming
```
but you can also run tests with nix flakes directly:
```shell
nix flake check
```
module Main (main) where
import Distribution.Simple
main :: IO ()
main = defaultMain
This diff is collapsed.
{
# This is a template created by `hix init`
inputs.haskellNix.url = "github:input-output-hk/haskell.nix";
inputs.nixpkgs.follows = "haskellNix/nixpkgs-unstable";
inputs.flake-utils.url = "github:numtide/flake-utils";
outputs = { self, nixpkgs, flake-utils, haskellNix }:
let
supportedSystems = [
"x86_64-linux"
"x86_64-darwin"
#"aarch64-linux"
#"aarch64-darwin"
];
in
flake-utils.lib.eachSystem supportedSystems (system:
let
overlays = [ haskellNix.overlay
(final: prev: {
hixProject =
final.haskell-nix.hix.project {
src = ./.;
evalSystem = "x86_64-linux";
};
})
];
pkgs = import nixpkgs { inherit system overlays; inherit (haskellNix) config; };
flake = pkgs.hixProject.flake {};
in flake // {
legacyPackages = pkgs;
packages = flake.packages // { default = flake.packages."haskell-throttle:lib:haskell-throttle"; };
});
# --- Flake Local Nix Configuration ----------------------------
nixConfig = {
# This sets the flake to use the IOG nix cache.
# Nix should ask for permission before using it,
# but remove it here if you do not want it to.
extra-substituters = ["https://cache.iog.io"];
extra-trusted-public-keys = ["hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ="];
allow-import-from-derivation = "true";
};
}
...@@ -95,7 +95,7 @@ extra-doc-files: CHANGELOG.md ...@@ -95,7 +95,7 @@ extra-doc-files: CHANGELOG.md
-- Extra source files to be distributed with the package, such as examples, or a tutorial module. -- Extra source files to be distributed with the package, such as examples, or a tutorial module.
-- extra-source-files: -- extra-source-files:
common warnings common warnings
ghc-options: -Wall ghc-options: -Wall
...@@ -115,7 +115,7 @@ library ...@@ -115,7 +115,7 @@ library
, ScopedTypeVariables , ScopedTypeVariables
-- Other library packages from which modules are imported. -- Other library packages from which modules are imported.
build-depends: base ^>=4.17.2.0 build-depends: base >=4.17.2.0 && < 5
, async >= 2.2 && < 2.3 , async >= 2.2 && < 2.3
, containers >= 0.6 && < 0.8 , containers >= 0.6 && < 0.8
, stm >= 2.5 && < 2.6 , stm >= 2.5 && < 2.6
...@@ -153,8 +153,8 @@ test-suite haskell-trottle-test ...@@ -153,8 +153,8 @@ test-suite haskell-trottle-test
-- Test dependencies. -- Test dependencies.
build-depends: build-depends:
base ^>=4.17.2.0 base >=4.17.2.0 && < 5
, haskell-trottle , haskell-throttle
, async >= 2.2 && < 2.3 , async >= 2.2 && < 2.3
, containers >= 0.6 && < 0.8 , containers >= 0.6 && < 0.8
, stm >= 2.5 && < 2.6 , stm >= 2.5 && < 2.6
......
{pkgs, ...}: {
# name = "project-name";
compiler-nix-name = "ghc96"; # Version of GHC to use
crossPlatforms = p: pkgs.lib.optionals pkgs.stdenv.hostPlatform.isx86_64 ([
#p.mingwW64
# p.ghcjs # TODO GHCJS support for GHC 9.2
] ++ pkgs.lib.optionals pkgs.stdenv.hostPlatform.isLinux [
#p.musl64
]);
# Tools to include in the development shell
shell.tools.cabal = "latest";
# shell.tools.hlint = "latest";
# shell.tools.haskell-language-server = "latest";
}
{ nixpkgs ? <nixpkgs> }:
rec {
haskell = import nixpkgs (import (builtins.fetchTarball https://github.com/input-output-hk/haskell.nix/archive/master.tar.gz) {}).nixpkgsArgs;
pkgNames = haskell.pkgs.lib.attrNames haskell.haskell-nix.snapshots."lts-13.18";
}
module Main (main) where
main = putStrLn "Hello, World!"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment