-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixup! treewide: standardize shell integration options
- Loading branch information
Showing
1 changed file
with
16 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,30 @@ | ||
{ config, lib, ... }: | ||
{ lib, ... }: | ||
|
||
{ | ||
options.shell = { | ||
enableShellIntegration = lib.mkOption { | ||
let | ||
|
||
mkShellIntegrationOption = name: | ||
lib.mkOption { | ||
type = lib.types.bool; | ||
default = true; | ||
example = false; | ||
|
||
description = '' | ||
Whether to enable shell integration for all supported shells. | ||
Whether to globally enable shell integration for ${name} by default. | ||
Individual shell integrations can be overridden with their respective | ||
`shell.enable<SHELL>Integration` option. For example, the following | ||
declaration globally disables shell integration for Bash: | ||
You can override this default value for an individual module by | ||
explicitly setting its `enable${name}Integration` option. For example, | ||
```nix | ||
config.shell.enableBashIntegration = false; | ||
config.services.gpg-agent.enableBashIntegration = false; | ||
``` | ||
''; | ||
}; | ||
|
||
enableBashIntegration = lib.hm.shell.mkBashIntegrationOption { | ||
inherit config; | ||
baseName = "Shell"; | ||
}; | ||
enableFishIntegration = lib.hm.shell.mkFishIntegrationOption { | ||
inherit config; | ||
baseName = "Shell"; | ||
}; | ||
enableIonIntegration = lib.hm.shell.mkIonIntegrationOption { | ||
inherit config; | ||
baseName = "Shell"; | ||
}; | ||
enableNushellIntegration = lib.hm.shell.mkNushellIntegrationOption { | ||
inherit config; | ||
baseName = "Shell"; | ||
}; | ||
enableZshIntegration = lib.hm.shell.mkZshIntegrationOption { | ||
inherit config; | ||
baseName = "Shell"; | ||
}; | ||
in { | ||
options.shell = { | ||
enableBashIntegration = mkShellIntegrationOption "Bash"; | ||
enableFishIntegration = mkShellIntegrationOption "Fish"; | ||
enableIonIntegration = mkShellIntegrationOption "Ion"; | ||
enableNushellIntegration = mkShellIntegrationOption "Nushell"; | ||
enableZshIntegration = mkShellIntegrationOption "Zsh"; | ||
}; | ||
} |