feat(home): shellAbbrs module
This commit is contained in:
parent
6ef9ec385a
commit
35c4b54705
1 changed files with 18 additions and 21 deletions
|
@ -1,21 +1,20 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
{ config, lib, ... }:
|
||||
let
|
||||
inherit (lib)
|
||||
types
|
||||
mkOption
|
||||
attrsets
|
||||
literalExpression
|
||||
mkIf
|
||||
;
|
||||
|
||||
# https://github.com/nix-community/home-manager/blob/master/modules/programs/fish.nix
|
||||
abbrModule = types.submodule {
|
||||
options = {
|
||||
expansion = mkOption {
|
||||
type = with types; nullOr str;
|
||||
default = null;
|
||||
description = ''
|
||||
The command expanded by an abbreviation.
|
||||
'';
|
||||
description = "The command expanded by an abbreviation.";
|
||||
};
|
||||
|
||||
position = mkOption {
|
||||
|
@ -23,9 +22,9 @@ let
|
|||
default = null;
|
||||
example = "anywhere";
|
||||
description = ''
|
||||
If the position is "command", the abbreviation expands only if
|
||||
the position is a command. If it is "anywhere", the abbreviation
|
||||
expands anywhere.
|
||||
If the position is "command", the abbreviation expands only if the
|
||||
position is a command. If it is "anywhere", the abbreviation expands
|
||||
anywhere.
|
||||
'';
|
||||
};
|
||||
|
||||
|
@ -50,9 +49,7 @@ let
|
|||
function = mkOption {
|
||||
type = with types; nullOr str;
|
||||
default = null;
|
||||
description = ''
|
||||
The fish function expanded instead of a literal string.
|
||||
'';
|
||||
description = "The fish function expanded instead of a literal string.";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -82,9 +79,9 @@ in
|
|||
}
|
||||
'';
|
||||
description = ''
|
||||
An attribute set that maps aliases (the top level attribute names
|
||||
in this option) to abbreviations. Abbreviations are expanded with
|
||||
the longer phrase after they are entered.
|
||||
An attribute set that maps aliases (the top level attribute names in
|
||||
this option) to abbreviations. Abbreviations are expanded with the
|
||||
longer phrase after they are entered.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
@ -92,7 +89,7 @@ in
|
|||
config =
|
||||
let
|
||||
fishCfg = config.programs.fish;
|
||||
shellAbbrs = config.home.shellAbbrs;
|
||||
inherit (config.home) shellAbbrs;
|
||||
in
|
||||
{
|
||||
programs.fish.shellAbbrs = mkIf fishCfg.enable shellAbbrs;
|
Loading…
Reference in a new issue