Skip to content

Commit

Permalink
fixup! treewide: standardize shell integration options
Browse files Browse the repository at this point in the history
  • Loading branch information
rycee committed Jan 30, 2025
1 parent c0bd4a9 commit 5bc459a
Showing 1 changed file with 16 additions and 30 deletions.
46 changes: 16 additions & 30 deletions modules/misc/shell.nix
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";
};
}

0 comments on commit 5bc459a

Please sign in to comment.