Skip to content

Add generateOptparseApplicativeCompletions setting #427

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
- `settings` module:
- #384: Add `stan`
- #419, #421: Add `installIntermediates`, `previousIntermediates` and `separateIntermediatesOutput`
- #427: Add `generateOptparseApplicativeCompletions`

## 0.5.0 (Jun 24, 2024)

Expand Down
6 changes: 6 additions & 0 deletions doc/settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ You can provide custom settings for use in multiple packages (even across multip

haskell-flake provides the following settings on top of those provided by [nixpkgs].

### `generateOptparseApplicativeCompletions`

Generate and install shell completion files for executables.
The executables need to be using `optparse-applicative` for this to work.
Note that this feature is automatically disabled when cross-compiling, since it requires executing the binaries in question.

### `removeReferencesTo`

Remove references to other packages from this Haskell package. This is useful to eliminate unnecessary data dependencies from your Haskell executable so as to reduce its closure size.
Expand Down
10 changes: 10 additions & 0 deletions nix/modules/project/settings/all.nix
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,16 @@ in
]) else null;
};

generateOptparseApplicativeCompletions = {
type = types.listOf types.str;
description = ''
Generate and install shell completion files for executables.
The executables need to be using `optparse-applicative` for this to work.
Note that this feature is automatically disabled when cross-compiling, since it requires executing the binaries in question.
'';
impl = self.generateOptparseApplicativeCompletions;
};

removeReferencesTo = {
type = types.listOf types.package;
description = ''
Expand Down
Loading