From 3c3595312652ecdcd1825764b2a9a710bbb4f5bb Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar <3998+srid@users.noreply.github.com> Date: Wed, 1 Mar 2023 09:48:48 -0500 Subject: [PATCH] Make `source-overrides` support Hackage inputs (#100) --- CHANGELOG.md | 1 + nix/flake-module.nix | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b99e0f7..497e3df 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ - #49 & #91: The `packages` option now autodiscovers the top-level `.cabal` file (in addition to looking inside sub-directories) as its default value. - #69: The default flake template creates `flake.nix` only, while the `#example` one creates the full Haskell project template. - #92: Add `devShell.mkShellArgs` to pass custom arguments to `mkShell` + - #100: `source-overrides` option now supports specifying Hackage versions. - API changes - #37: Group `buildTools` (renamed to `tools`), `hlsCheck` and `hlintCheck` under the `devShell` submodule option; and allow disabling them all using `devShell.enable = false;` (useful if you want haskell-flake to produce just the package outputs). - #64: Remove hlintCheck (use [treefmt-nix](https://github.com/numtide/treefmt-nix#flake-parts) instead) diff --git a/nix/flake-module.nix b/nix/flake-module.nix index bfc552b..db1f2a2 100644 --- a/nix/flake-module.nix +++ b/nix/flake-module.nix @@ -110,8 +110,13 @@ in defaultText = lib.literalExpression "pkgs.haskellPackages"; }; source-overrides = mkOption { - type = types.attrsOf types.path; - description = ''Package overrides given new source path''; + type = types.attrsOf (types.oneOf [ types.path types.str ]); + description = '' + Source overrides for Haskell packages + + You can either assign a path to the source, or Hackage + version string. + ''; default = { }; }; overrides = mkOption {