summaryrefslogtreecommitdiff
path: root/modules/programs/fish.nix
diff options
context:
space:
mode:
authorMike Vink <59492084+ivi-vink@users.noreply.github.com>2025-01-16 22:22:34 +0100
committerGitHub <noreply@github.com>2025-01-16 22:22:34 +0100
commit8e7bd91f353caacc0bc4105f573eb3e17f09e03a (patch)
treec5059edcbebd9644290cad7c653c49a36d593021 /modules/programs/fish.nix
parent6bd39d420578aacf7c0bab7de3e7027b952115ae (diff)
parentbd921223ba7cdac346477d7ea5204d6f4736fcc6 (diff)
Merge branch 'LnL7:master' into masterHEADmaster
Diffstat (limited to 'modules/programs/fish.nix')
-rw-r--r--modules/programs/fish.nix28
1 files changed, 15 insertions, 13 deletions
diff --git a/modules/programs/fish.nix b/modules/programs/fish.nix
index 287cc71..65797cc 100644
--- a/modules/programs/fish.nix
+++ b/modules/programs/fish.nix
@@ -9,7 +9,7 @@ let
cfg = config.programs.fish;
fishAliases = concatStringsSep "\n" (
- mapAttrsFlatten (k: v: "alias ${k} ${escapeShellArg v}")
+ mapAttrsToList (k: v: "alias ${k} ${escapeShellArg v}")
(filterAttrs (k: v: v != null) cfg.shellAliases)
);
@@ -51,16 +51,18 @@ in
enable = mkOption {
default = false;
- description = lib.mdDoc ''
+ description = ''
Whether to configure fish as an interactive shell.
'';
type = types.bool;
};
+ package = lib.mkPackageOption pkgs "fish" { };
+
useBabelfish = mkOption {
type = types.bool;
default = false;
- description = lib.mdDoc ''
+ description = ''
If enabled, the configured environment will be translated to native fish using [babelfish](https://github.com/bouk/babelfish).
Otherwise, [foreign-env](https://github.com/oh-my-fish/plugin-foreign-env) will be used.
'';
@@ -69,7 +71,7 @@ in
babelfishPackage = mkOption {
type = types.package;
default = pkgs.babelfish;
- description = lib.mdDoc ''
+ description = ''
The babelfish package to use when useBabelfish is
set to true.
'';
@@ -78,7 +80,7 @@ in
vendor.config.enable = mkOption {
type = types.bool;
default = true;
- description = lib.mdDoc ''
+ description = ''
Whether fish should source configuration snippets provided by other packages.
'';
};
@@ -86,7 +88,7 @@ in
vendor.completions.enable = mkOption {
type = types.bool;
default = true;
- description = lib.mdDoc ''
+ description = ''
Whether fish should use completion files provided by other packages.
'';
};
@@ -94,14 +96,14 @@ in
vendor.functions.enable = mkOption {
type = types.bool;
default = true;
- description = lib.mdDoc ''
+ description = ''
Whether fish should autoload fish functions provided by other packages.
'';
};
shellAliases = mkOption {
default = config.environment.shellAliases;
- description = lib.mdDoc ''
+ description = ''
Set of aliases for fish shell. See {option}`environment.shellAliases`
for an option format description.
'';
@@ -110,7 +112,7 @@ in
shellInit = mkOption {
default = "";
- description = lib.mdDoc ''
+ description = ''
Shell script code called during fish shell initialisation.
'';
type = types.lines;
@@ -118,7 +120,7 @@ in
loginShellInit = mkOption {
default = "";
- description = lib.mdDoc ''
+ description = ''
Shell script code called during fish login shell initialisation.
'';
type = types.lines;
@@ -126,7 +128,7 @@ in
interactiveShellInit = mkOption {
default = "";
- description = lib.mdDoc ''
+ description = ''
Shell script code called during interactive fish shell initialisation.
'';
type = types.lines;
@@ -134,7 +136,7 @@ in
promptInit = mkOption {
default = "";
- description = lib.mdDoc ''
+ description = ''
Shell script code used to initialise fish prompt.
'';
type = types.lines;
@@ -238,7 +240,7 @@ in
++ optional cfg.vendor.functions.enable "/share/fish/vendor_functions.d";
}
- { systemPackages = [ pkgs.fish ]; }
+ { systemPackages = [ cfg.package ]; }
];
};