Commit Graph

75 Commits

Author SHA1 Message Date
Sridhar Ratnakumar
2ee7904390 fix: support older nixpkgs
lib.attrsets.removeAttrs is only available in newer nixpkgs
2024-04-25 02:19:06 -04:00
Sridhar Ratnakumar
56c45affa6 fix: avoid "used but not defined" error with empty outputs.packages 2024-04-22 06:54:17 -04:00
Sridhar Ratnakumar
d9287fee68 fix(haskell-parsers): accept empty defaults for packages 2024-04-22 06:54:17 -04:00
Sridhar Ratnakumar
462f004e30 chore: only mention cabal.project issue for parser errors 2024-04-22 20:34:33 +10:00
Sridhar Ratnakumar
e22a3cdba5 chore: Improve cabal.project parser error message
It also links to #307
2024-04-22 18:15:13 +10:00
Sridhar Ratnakumar
a85328353a fix: buildFromSdist default for haskell-flake managed packages only 2024-04-22 03:58:10 -04:00
Shivaraj B H
53e434d194
feat: Add granular settings defaults (#275) 2024-04-20 03:44:10 -04:00
Sridhar Ratnakumar
d9dbdd466a
buildFromSdist: enable only for local packages (#298) 2024-04-03 03:30:17 -04:00
Sridhar Ratnakumar
b1db0d5312 fix: make brokenVersions actually work
resolves #297
2024-04-03 17:09:10 +11:00
Sridhar Ratnakumar
cac0cff083 fix: make removeConfigureFlags actually work
resolves #296
2024-04-03 17:05:41 +11:00
Sridhar Ratnakumar
01fb3da1c6 buildFromSdist: deal with breakage of removeReferencesTo
Incidentally, `buildFromSdist` hasn't been changed since 2018:

https://github.com/NixOS/nixpkgs/pull/48699
2024-03-29 12:21:55 -04:00
Sridhar Ratnakumar
51bcbc2719
Reintroduce buildFromSdist (enable it by default) (#286) 2024-03-29 12:05:12 -04:00
Sridhar Ratnakumar
474fcb0763
Unused settings.<name>.impl: use null instead of id (#284) 2024-03-28 15:32:19 -04:00
Sridhar Ratnakumar
5dcb739e9c
Add otherOverlays option (#277) 2024-03-27 15:39:41 -04:00
Robert Hensing
73707ab1b8 attrsOf -> lazyAttrsOf
This means we don't support `mkIf` in the exact places where the
type was `attrsOf`. Almost always, `mkIf` can be replaced by
`optionalAttrs`.

The benefit is that the code becomes much lazier, improving performance
and
- Fixes https://github.com/srid/haskell-flake/issues/270
2024-03-12 16:49:52 -04:00
Sridhar Ratnakumar
76214cf8b0 fix: autoformat 2024-03-01 11:34:56 -05:00
Sridhar Ratnakumar
ce6f6f844f fix: specify a default 2024-03-01 11:31:23 -05:00
Sridhar Ratnakumar
307961a201 refactor: expose haskellProjectTests in flake module
Because we want to use it in multiple tests.
2024-03-01 11:24:18 -05:00
Sridhar Ratnakumar
3a8c1b58cf
Make buildFromSdist configurable; turn it off by default (#253) 2024-02-29 14:00:14 -05:00
Sridhar Ratnakumar
fe9c595916 test: Make haskell-parser tests a flake check 2024-02-23 16:01:17 -05:00
Shivaraj B H
5113f700d6
settings: add removeReferencesTo (#225)
This setting helps remove unnecessary dependencies to your haskell package that
bloats up the final closure size

Source: 5623bb3814/nix/removeReferencesTo.nix (L9)


---------

Co-authored-by: Sridhar Ratnakumar <3998+srid@users.noreply.github.com>
Co-authored-by: Sridhar Ratnakumar <srid@srid.ca>
2024-02-13 09:49:51 -05:00
Sridhar Ratnakumar
f9d17c3aa6
Make devShell.tools a lazyAttrsOf (#223) 2024-02-06 12:56:03 -05:00
Shivaraj B H
56c5550e18
fix(cabal.project parser): parse the packages ending with eof (#222) 2024-02-06 03:08:48 -05:00
Sridhar Ratnakumar
dd0d3b9d51
Switch to buildFromSdist (#221) 2024-02-05 10:56:41 -05:00
Sridhar Ratnakumar
8a526aaf98
Use builtins.traceVerbose for logging (#216) 2024-01-12 08:58:05 -05:00
Sridhar Ratnakumar
cdb3ca3172 Log cabal.project parsing 2024-01-11 15:42:28 +05:30
Sridhar Ratnakumar
ed1480f93c Log the output of cabal parser. 2024-01-11 15:42:28 +05:30
Shivaraj B H
f28104504a
[settings/all]: add extraLibraries option (#210) 2023-12-13 13:43:03 -05:00
Shivaraj B H
91c98bb0af
devShell.extraLibraries: abort when using an older commit of nixpkgs (#203)
* warn the user about using an older commit of nixpkgs

`extraDependencies` was added as an argument to `shellFor` only after: 2e87d165f7
2023-11-21 10:36:17 -05:00
Yuan Wang
f16e7ac05b
replace types.string with types.str (#189) 2023-08-11 10:19:04 -04:00
Shivaraj B H
658dfcf5b0
Add benchmark and hoogle devShell options (#175) 2023-06-26 12:21:46 -04:00
Berk Özkütük
57cd506878
Fix settings.<name>.cabalFlags implementation (#178)
* Fix cabalFlags implementation

* Improve impl; add test

* update changelog

---------

Co-authored-by: Sridhar Ratnakumar <srid@srid.ca>
2023-06-23 15:09:40 -04:00
Dixon Sean Low Yan Feng
c5e908e1c9
fix: don't rely on string context for package source (#170)
* fix: don't rely on string context for package source

Before this commit, the type of a package source (haskell-source-type)
depended on string contexts in its `check` function. However, string
contexts do not work well to represent a path to a package source. For
instance, "hello ./subdirectory" would have a string context, but is
obviously not a valid path.

Furthermore, a `nix` bug (https://github.com/NixOS/nix/issues/8428)
related to string contexts triggers an issue where setting the project
root causes a type error with haskell-source-type (https://github.com/srid/haskell-flake/issues/169).

This commit replaces haskell-source-type with `with type; either path str`
and instances of `isPathUnderNixStore` with `lib.types.path.check` to
avoid using string contexts.

* Update CHANGELOG.md

---------

Co-authored-by: Sridhar Ratnakumar <3998+srid@users.noreply.github.com>
2023-06-15 12:56:16 -04:00
Sridhar Ratnakumar
c76fb22f2c defaults: Turn off separateBinOutput default 2023-06-07 13:54:43 -04:00
Sridhar Ratnakumar
943f7dbb31 settings.separateBinOutput: add warning 2023-06-07 13:54:05 -04:00
Robert Hensing
e3b364aec2 Add missing default so that docs evaluate again 2023-06-01 18:17:39 +02:00
Sridhar Ratnakumar
99b9dda0df Run nixpkgs-fmt 2023-05-31 10:39:12 -04:00
Sridhar Ratnakumar
73202303a7 build-haskell-package: Remove redundant argument, super 2023-05-31 10:38:12 -04:00
Sridhar Ratnakumar
996f5c2cdc
Modular overrides (#162)
**Completely new way to override Haskell packages**: removed `overrides` and `source-overrides`. Use `packages` to specify your source overrides; use `settings` to override individual packages in modular fashion (like NixOS modules). Additional changes include:
  - Add `package.<name>.cabal.executables` referring to the executables in a package. This is auto-detected by parsing the Cabal file.
  - Add `packages.<name>.local.*` to determine of a package is a local package or not.
  - Add `projectFlakeName` option (useful in debug logging prefix)
  - `flake.haskellFlakeProjectModules`: Dropped all defaults, except the `output` module, which now exports `packages` and `settings`. Added a `defaults.projectModules.output` option that allows the user to override this module, or directly access the generated module.
  - Add `project.config.defaults.settings.default` defining sensible defaults for local packages.
  - Add `project.config.defaults.enable` to turn off all default settings en masse.

Also, disable docs test due to https://github.com/hercules-ci/flake.parts-website/issues/332
2023-05-30 13:55:26 -04:00
Sridhar Ratnakumar
4e1c76de87 refactor: separate out 'packages' option 2023-05-15 16:02:37 -04:00
Sridhar Ratnakumar
98dfcc619b Enable specifying the default devShell.tools 2023-04-28 16:24:54 -04:00
Sridhar Ratnakumar
fb1a3c32a8
refactor: Split into smaller modules (#152) 2023-04-28 12:54:18 -04:00
Sridhar Ratnakumar
5ec0dc82f3 refactor: make 'log' an option (consistency) 2023-04-27 15:10:26 -04:00
Sridhar Ratnakumar
11ab35533a
exe: Use getBin instead of justStaticExecutables (#151) 2023-04-27 12:57:56 -04:00
Sridhar Ratnakumar
1ca25ec71f Log the default 'packages' value 2023-04-27 11:52:52 -04:00
Sridhar Ratnakumar
eed521db07 refactor: Re-indent 2023-04-27 11:48:15 -04:00
Sridhar Ratnakumar
af0fe5589a refactor: Do logging uniformly 2023-04-27 11:41:11 -04:00
Sridhar Ratnakumar
6e3f2fba3f Add a 'debug' option to log drv hashes at all stages 2023-04-26 21:38:16 -04:00
Sridhar Ratnakumar
e741f1c049 cleanSourceWith *before* cabal2nix 2023-04-26 21:38:16 -04:00
Sridhar Ratnakumar
81ca2f4051
Remove automatic hpack conversion (#148) 2023-04-26 15:01:02 -04:00