diff --git a/.envrc b/.envrc index 1e2885a..2a2dd34 100644 --- a/.envrc +++ b/.envrc @@ -2,3 +2,4 @@ if ! has nix_direnv_version || ! nix_direnv_version 2.1.1; then source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/2.1.1/direnvrc" "sha256-b6qJ4r34rbE23yWjMqbmu3ia2z4b2wIlZUksBke/ol0=" fi use nix +watch_file cabal.project wai-middleware-delegate.cabal h8x.nix diff --git a/default.nix b/default.nix index 0150db9..ae14438 100644 --- a/default.nix +++ b/default.nix @@ -1,24 +1,8 @@ let - # Pin haskell-nix to a recent (as of 2023/07/20) commit - h8x-pin = "https://github.com/input-output-hk/haskell.nix/archive/3ae883bb7864ba85c3aab30f8f488b9a7d84afc8.tar.gz"; - h8x-src = builtins.fetchTarball h8x-pin; - h8x = import h8x-src {}; - - # Import nixpkgs and pass the haskell.nix provided nixpkgsArgs - pkgs = import - - # haskell.nix provides access to the nixpkgs pins which are used by our CI, - # hence you will be more likely to get cache hits when using these. But you - # can also just use your own, e.g. ''. - - h8x.sources.nixpkgs-2305 - - # These arguments passed to nixpkgs, include some patches and also the - # haskell.nix functionality itself as an overlay. - - h8x.nixpkgsArgs; - -in pkgs.haskell-nix.cabalProject { + pkgsNix = import ./h8x.nix; +in +{ pkgs ? pkgsNix +} : pkgs.haskell-nix.cabalProject { # 'cleanGit' cleans a source directory based on the files known by git src = pkgs.haskell-nix.haskellLib.cleanGit { name = "wai-middleware-delegate"; @@ -29,5 +13,5 @@ in pkgs.haskell-nix.cabalProject { compiler-nix-name = "ghc928"; # Specify the hackage index state - index-state = "2023-07-20T00:00:00Z"; + index-state = "2023-11-24T00:00:00Z"; } diff --git a/h8x.nix b/h8x.nix new file mode 100644 index 0000000..70d571d --- /dev/null +++ b/h8x.nix @@ -0,0 +1,20 @@ +let + # Pin haskell-nix to a recent (as of 2023/11/24) commit + h8x-commit = "c6e3c91844e91f86cb64015258eed2ed8545d2a9"; + h8x-pin = "https://github.com/input-output-hk/haskell.nix/archive/${h8x-commit}.tar.gz"; + h8x-src = builtins.fetchTarball h8x-pin; + h8x = import h8x-src {}; + +in + import + + # haskell.nix provides access to the nixpkgs pins which are used by our CI, + # hence you will be more likely to get cache hits when using these. But you + # can also just use your own, e.g. ''. + + h8x.sources.nixpkgs-unstable + + # These arguments passed to nixpkgs, include some patches and also the + # haskell.nix functionality itself as an overlay. + + h8x.nixpkgsArgs diff --git a/shell.nix b/shell.nix index a11d8ed..7dcdc1e 100644 --- a/shell.nix +++ b/shell.nix @@ -1,5 +1,5 @@ let - project = import ./default.nix; + project = import ./default.nix {}; in project.shellFor { # Builds a Hoogle documentation index of all dependencies, @@ -12,7 +12,7 @@ in hlint = "latest"; # Selects the latest version in the hackage.nix snapshot haskell-language-server = "latest"; ghcid = "latest"; - fourmolu = "latest"; + fourmolu = "0.14.0.0"; cabal-fmt = "latest"; }; # See overlays/tools.nix for more details