Commit graph

97 commits

Author SHA1 Message Date
Ryan Gibb 34b5dd453b nixos/zsh-autosuggestions: ZSH_AUTOSUGGEST_STRATEGY array
zsh-autosuggestions supports having fallback strategies expressed
through the ZSH_AUTOSUGGEST_STRATEGY array. For example,
`ZSH_AUTOSUGGEST_STRATEGY=(history completion)`. We should also support
this.
2022-03-07 16:29:00 +00:00
pennae e24a8775a8 treewide: set defaultText for options using simple path defaults
adds defaultText for all options that set their default to a path expression
using the ubiquitous `cfg` shortcut bindings.
2021-12-09 01:12:13 +01:00
Sandro fef107d5a5
Merge pull request #142839 from ivan/zsh-autosuggestions-config-async 2021-11-25 00:09:18 +01:00
Ivan Kozik b897f5fe70 nixos/autosuggestions: add config to control whether suggestions are async
zsh-autosuggestions now defaults to asynchronous suggestions, but they can
be annoying when they take several frames longer to show up after typing.
2021-11-19 01:09:44 +00:00
Andreas Fuchs 8a37d710fd nixos: zsh: Remove hack for zsh-nix-completions on nix 2.4
The zsh-nix-completions package now sets a priority, which helps avoid
conflicts with newer nix versions without patching the package from
the module.
2021-11-14 22:09:01 +01:00
Naïm Favier 2ddc335e6f
nixos/doc: clean up defaults and examples 2021-10-04 12:47:20 +02:00
Jörg Thalheim 8c5c0d6748 nixos: fix zinputrc on flake-enabled systems 2021-08-05 22:19:37 +02:00
Maximilian Bosch 15dab3835f
Merge pull request #128649 from nrdxp/fix-unstable-nix-zsh-completions
zsh: fix nixUnstable completions
2021-07-22 14:58:20 +02:00
Timothy DeHerrera 6dbf8c0409
zsh: include completions for nix-* commands 2021-07-21 15:55:25 -06:00
Timothy DeHerrera 9ad645dce8
zsh: format module with nixpkgs-fmt 2021-07-21 15:55:25 -06:00
Timothy DeHerrera d687fe88fd
zsh: remove conflicting nixUnstable completions 2021-07-21 15:55:22 -06:00
*Kim Zick fbbaa4d40f
nixos/zsh: change default prompt theme to 'suse'
This resolves a long-standing issue caused by the 'walters' theme setting `RPS1`.  See #38535 for discussion details.
2021-06-26 06:36:51 -04:00
Daniël de Kok 7b73713a98 programs.zsh: remove unnecessary with 2020-09-03 08:42:24 +02:00
Benjamin Asbach cbb5b578b8 zsh: added option to enable compatibility with bash's completion system 2020-05-03 12:08:25 +02:00
Dominik Xaver Hörl 0412bde942 treewide: add bool type to enable options, or make use of mkEnableOption
Add missing type information to manually specified enable options or replace them by mkEnableOption where appropriate.
2020-04-21 08:55:36 +02:00
Jörg Thalheim 55819e6c86
Revert "zsh: don't clobber the environment of non-login shells"
This reverts commit 6a756af3e7.

Currently zshenv by default only set fpath and HELPDIR without exporting them.
A parent shell would also not set those variables usually as they are shell local.

It also sources a file called set-environment but this is protected by an
environment variable called __NIXOS_SET_ENVIRONMENT_DONE. Hence any modification
done by the parent shell should persist as long as __NIXOS_SET_ENVIRONMENT_DONE
is not unset.

This behavior deviates from what we do in bashrc and breaks common setups such
as tmux/mosh or screen.

Fixes #80437
2020-02-18 15:52:21 +00:00
Michael Raskin f320a0231c
Merge pull request #67376 from oxij/nixos/zsh-doc
nixos: zsh: add more helpful documentation into generated files
2020-02-09 11:58:30 +00:00
Silvan Mosberger 4ee3e8b21d
nixos/treewide: Move rename.nix imports to their respective modules
A centralized list for these renames is not good because:
- It breaks disabledModules for modules that have a rename defined
- Adding/removing renames for a module means having to find them in the
central file
- Merge conflicts due to multiple people editing the central file
2019-12-10 02:51:19 +01:00
Silva Alejandro Ismael 35ae47e44b nixos/zsh-syntax-highlighting: Fix highlighting when ohMyZsh is enabled
From https://github.com/zsh-users/zsh-syntax-highlighting#faq:

"It must be sourced after all custom widgets have been created
(i.e., after all zle -N calls and after running compinit)."

zsh-syntax-highlighting must be sourced to the end.
2019-10-23 11:54:52 -03:00
Eelco Dolstra b0ccd6dd16
Revert "nixos/doc: re-format"
This reverts commit ea6e8775bd. The new
format is not an improvement.
2019-09-19 19:17:30 +02:00
Jan Tojnar ea6e8775bd
nixos/doc: re-format 2019-09-18 22:13:35 +02:00
Vladimír Čunát f21211ebfe
Merge branch 'master' into staging 2019-09-02 23:25:24 +02:00
Silvan Mosberger 478e7184f8
nixos/modules: Remove all usages of types.string
And replace them with a more appropriate type

Also fix up some minor module problems along the way
2019-08-31 18:19:00 +02:00
Frederik Rietdijk ad1d58c622 Merge staging-next into staging 2019-08-31 10:04:20 +02:00
Frederik Rietdijk 5061fe0c2c Merge staging-next into staging 2019-08-28 08:26:42 +02:00
Matthew Bauer 4081bec5ac
zsh: remove unfunction on TERM=dumb
Unfortunately this gives an error when precmd or preexec exists. Removing to avoid that.
2019-08-27 11:00:58 -04:00
volth 35d68ef143 treewide: remove redundant quotes 2019-08-26 21:40:19 +00:00
Jan Malakhovski 2eaf57541f nixos: zsh: reorder /etc/zshrc a little bit, add more helpful documentation 2019-08-24 05:48:57 +00:00
Jan Malakhovski f70e3f3738 nixos: zsh: move NixOS-specific variables from /etc/zshrc to /etc/zshenv
We want these to be set even when /etc/zshrc loading is disabled.
2019-08-24 05:36:02 +00:00
Matthew Bauer ac773d1607 nixos/zsh: Fix tramp support
For a long time, TRAMP has not worked with ZSH NixOS servers. I
thought I fixed this in 0740f57e63af61694d14796286cb9204, but now
realize that was only half the problem. For TRAMP to start working
again ‘unsetopt zle’ was needed, otherwise the connection would hang.
In addition, I have a few more settings added that can apparenty
interfere with these settings.
2019-08-21 21:24:45 -04:00
Jan Malakhovski 065c6ed96e nixos: zsh: setopt prompt_sp to workaround a zsh bug
See #38535, properly fixing the prompt seems complicated, and this seems
to work in all the ttys I checked.

Suggested by @Mic92.
2019-08-19 22:58:13 +00:00
Izorkin 82ad143a51
nixos/zsh: move zsh setopt 2019-06-09 00:13:01 +02:00
Daniel Schaefer 786f02f7a4 treewide: Remove usage of isNull
isNull "is deprecated; just write e == null instead" says the Nix manual
2019-04-29 14:05:50 +02:00
Florian Klink 2457510db4
Merge pull request #51918 from bobvanderlinden/var-run
tree-wide: nixos: /var/run -> /run
2019-04-07 20:09:46 +02:00
Vladimír Čunát 4c3ec0e325
nixos docs: run the formatting tool (no content change)
As documented in the docs themselves :-)
2019-03-22 14:44:11 +01:00
Will Dietz 173f79f690 zsh: don't export HISTFILE and friends
Just set them normally.
Exporting them will propagate them to all executed programs
such as bash (as used by nix-shell or nix run),
and badness ensues when different formats are used.
2019-03-21 10:28:20 -05:00
Bob van der Linden 9d4bc79003 nixos/zsh: do not use /var/run 2019-03-20 00:01:45 +01:00
Izorkin 53d05fd0cc nixos/zsh: enable configure history and custom options 2019-03-18 19:57:54 +03:00
Izorkin 420b83b29b zsh.syntaxHighlighting: add option to customize styles 2019-01-03 01:05:45 +03:00
Pablo Delgado Krämer 685c4f5608 nixos/oh-my-zsh: fix wrong manual information
Manual still refers to 'programs.ohMyZsh' although it should be 'programs.zsh.ohMyZsh'.
2018-12-18 14:31:35 +01:00
Tim Steinbach 97ad321e42
zsh-autosuggestions: Fix module for 0.5.0
The update for zsh-autosuggestions in #51752 broke the module.
This fix reflects the required changes.
2018-12-10 10:11:33 -05:00
Mitsuhiro Nakamura c941577dcb nixos/shells: enable to nullify already defined aliases 2018-10-14 00:14:49 +09:00
Mitsuhiro Nakamura 3b5449b80c nixos/shells: programs.*sh.shellAliases override environment.shellAliases 2018-10-14 00:14:09 +09:00
Graham Christensen 8413f22bb3
docs: format 2018-09-29 20:51:11 -04:00
Maximilian Bosch 1e211a70cb nixos/zsh: use `escapeShelLArg' for shell aliases (#47471)
Previously single quotes were used by default for aliases and the module
never warned about possible collisions when having a shell alias which
relies on single quotes.

Adding `escapeShellArg` works around this fixes the issue and ensures that a
properly quoted value is written to `/etc/zshrc`.
2018-09-28 23:42:55 +02:00
xeji 5fc8ebdda0
Merge pull request #45784 from oxij/pull/44720-shell-env-edited
nixos/shells: Avoid overriding the environment for other child shells
2018-09-06 20:30:34 +02:00
Graham Christensen 34d2ec7c09
nixos docs: give IDs to things 2018-09-01 16:20:49 -04:00
Jan Malakhovski 8952375b48 nixos/shells: fix indent everywhere
to comply with `doc/coding-conventions.xml`
2018-08-30 13:20:39 +00:00
Tor Hedin Brønner d273db48c6 nixos/shells: avoid overriding the environment for child shells
A shared exported guard `__NIXOS_SET_ENVIRONMENT_DONE` is introduced that can
be used to prevent child shells from sourcing `system.build.setEnvironment`
the second time.

This fixes e.g. `nix run derivation` when run from e.g. ZSH through the console or
ssh. Before this Bash would resource the common environment resetting the `PATH`
environment variable.

We also export `system.build.setEnvironment` to `/etc/set-environment` making it
easy to reset the common environment with `. /etc/set-environment` when
needed and to grep for environment variables in `/etc` (which was the
motivation of #30418).

This reverts changes made in b00a3fc6fd
(the original #30418).
2018-08-30 13:20:39 +00:00
Jörg Thalheim 4e365aa453 nixos/zsh: make enableGlobalCompInit description less ambiguous 2018-08-27 10:43:31 +01:00