mirror of
https://github.com/nix-community/home-manager
synced 2025-02-07 00:35:04 +01:00
nushell: allow multi-word aliases
Also fix invalid alias in test
This commit is contained in:
parent
709aaab1a5
commit
82455a84e3
3 changed files with 11 additions and 5 deletions
|
@ -164,7 +164,10 @@ in {
|
|||
shellAliases = lib.mkOption {
|
||||
type = types.attrsOf types.str;
|
||||
default = { };
|
||||
example = { ll = "ls -l"; };
|
||||
example = {
|
||||
ll = "ls -l";
|
||||
g = "git";
|
||||
};
|
||||
description = ''
|
||||
An attribute set that maps aliases (the top level attribute names in
|
||||
this option) to command strings or directly to build outputs.
|
||||
|
@ -202,7 +205,8 @@ in {
|
|||
|| aliasesStr != "" || cfg.settings != { };
|
||||
|
||||
aliasesStr = lib.concatLines
|
||||
(lib.mapAttrsToList (k: v: "alias ${k} = ${v}") cfg.shellAliases);
|
||||
(lib.mapAttrsToList (k: v: "alias ${toNushell { } k} = ${v}")
|
||||
cfg.shellAliases);
|
||||
in lib.mkIf writeConfig {
|
||||
"${configDir}/config.nu".text = lib.mkMerge [
|
||||
(let
|
||||
|
|
|
@ -26,5 +26,6 @@ let config = {
|
|||
}
|
||||
|
||||
|
||||
alias ll = ls -a
|
||||
alias lsname = (ls | get name)
|
||||
alias "ll" = ls -a
|
||||
alias "multi word alias" = cd -
|
||||
alias "z" = __zoxide_z
|
||||
|
|
|
@ -26,8 +26,9 @@
|
|||
plugins = [ pkgs.nushellPlugins.formats ];
|
||||
|
||||
shellAliases = {
|
||||
"lsname" = "(ls | get name)";
|
||||
"ll" = "ls -a";
|
||||
"multi word alias" = "cd -";
|
||||
"z" = "__zoxide_z";
|
||||
};
|
||||
|
||||
settings = {
|
||||
|
|
Loading…
Add table
Reference in a new issue