diff --git a/modules/programs/nushell.nix b/modules/programs/nushell.nix index 78842c44..21e9045c 100644 --- a/modules/programs/nushell.nix +++ b/modules/programs/nushell.nix @@ -191,21 +191,6 @@ in ''; }; - abbreviations = lib.mkOption { - type = types.attrsOf types.str; - default = { }; - example = { - ll = "ls -l"; - gs = "git status"; - }; - description = '' - An attribute set that maps each abbreviation (the top level attribute - names in this option) to its expansion. Unlike aliases, abbreviations - are expanded inline in the line editor when a space or enter is pressed, - so the expanded command is what ends up in the command history. - ''; - }; - environmentVariables = lib.mkOption { type = types.attrsOf lib.hm.types.nushellValue; default = { }; @@ -247,16 +232,11 @@ in || cfg.extraConfig != "" || aliasesStr != "" || cfg.settings != { } - || cfg.abbreviations != { } || cfg.environmentVariables != { }; aliasesStr = lib.concatLines ( lib.mapAttrsToList (k: v: "alias ${toNushell { } k} = ${v}") cfg.shellAliases ); - - abbreviationsStr = - lib.optionalString (cfg.abbreviations != { }) - "$env.config.abbreviations = ${toNushell { } cfg.abbreviations}"; in lib.mkIf writeConfig { "${cfg.configDir}/config.nu".text = lib.mkMerge [ @@ -295,7 +275,6 @@ in (lib.mkIf (cfg.configFile != null) cfg.configFile.text) cfg.extraConfig aliasesStr - abbreviationsStr ]; } ) diff --git a/tests/modules/programs/nushell/config-expected.nu b/tests/modules/programs/nushell/config-expected.nu index 73c4af77..cd02b6d7 100644 --- a/tests/modules/programs/nushell/config-expected.nu +++ b/tests/modules/programs/nushell/config-expected.nu @@ -13,6 +13,8 @@ load-env { "PROMPT_COMMAND": ({|| "> "}) } +$env.config.abbreviations.gs = "git status" +$env.config.abbreviations.ll = "ls -l" $env.config.display_errors.exit_code = false $env.config.hooks.pre_execution = [ ({|| "pre_execution hook"}) @@ -29,8 +31,3 @@ let config = { alias "ll" = ls -a alias "multi word alias" = cd - alias "z" = __zoxide_z - -$env.config.abbreviations = { - "gs": "git status" - "ll": "ls -l" -} \ No newline at end of file diff --git a/tests/modules/programs/nushell/example-settings.nix b/tests/modules/programs/nushell/example-settings.nix index b6c77b51..1c8f3209 100644 --- a/tests/modules/programs/nushell/example-settings.nix +++ b/tests/modules/programs/nushell/example-settings.nix @@ -38,12 +38,11 @@ "z" = "__zoxide_z"; }; - abbreviations = { - "gs" = "git status"; - "ll" = "ls -l"; - }; - settings = { + abbreviations = { + "gs" = "git status"; + "ll" = "ls -l"; + }; show_banner = false; display_errors.exit_code = false; hooks.pre_execution = [ (lib.hm.nushell.mkNushellInline ''{|| "pre_execution hook"}'') ];