Skip to content

Commit d91a389

Browse files
jian-linsrid
authored andcommitted
Add generateOptparseApplicativeCompletions setting
1 parent 2bbf598 commit d91a389

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
- `settings` module:
1010
- #384: Add `stan`
1111
- #419, #421: Add `installIntermediates`, `previousIntermediates` and `separateIntermediatesOutput`
12+
- #427: Add `generateOptparseApplicativeCompletions`
1213

1314
## 0.5.0 (Jun 24, 2024)
1415

doc/settings.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,12 @@ You can provide custom settings for use in multiple packages (even across multip
5353

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

56+
### `generateOptparseApplicativeCompletions`
57+
58+
Generate and install shell completion files for executables.
59+
The executables need to be using `optparse-applicative` for this to work.
60+
Note that this feature is automatically disabled when cross-compiling, since it requires executing the binaries in question.
61+
5662
### `removeReferencesTo`
5763

5864
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.

nix/modules/project/settings/all.nix

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,16 @@ in
327327
]) else null;
328328
};
329329

330+
generateOptparseApplicativeCompletions = {
331+
type = types.listOf types.str;
332+
description = ''
333+
Generate and install shell completion files for executables.
334+
The executables need to be using `optparse-applicative` for this to work.
335+
Note that this feature is automatically disabled when cross-compiling, since it requires executing the binaries in question.
336+
'';
337+
impl = self.generateOptparseApplicativeCompletions;
338+
};
339+
330340
removeReferencesTo = {
331341
type = types.listOf types.package;
332342
description = ''

0 commit comments

Comments
 (0)