1
0
Fork 0
mirror of https://github.com/LnL7/nix-darwin.git synced 2024-12-14 11:57:34 +00:00
Commit graph

42 commits

Author SHA1 Message Date
Sam
5fbb7b7637
zsh: only run shell initialization in /etc/zshenv when RCs are enabled 2024-11-07 20:29:35 -08:00
Michael Hoang
98e7dba872
Merge pull request #909 from motheki/fast-syntax-highlighting-support
Add support for zsh-fast-syntax-highlighting
2024-11-06 07:31:39 +00:00
Trevor Opiyo
48e5c8de1a
Update modules/programs/zsh/default.nix
Changes added by Enzime

Co-authored-by: Michael Hoang <Enzime@users.noreply.github.com>
2024-11-06 01:10:24 -06:00
Trevor Opiyo
897fc37c47
Update default.nix
Co-authored-by: Michael Hoang <Enzime@users.noreply.github.com>
2024-11-05 08:16:35 -06:00
Michael Hoang
470f87c182 zsh: enable by default as zsh is the default shell on macOS
Historically this was a footgun because users would not always have this
enabled leading to `darwin-rebuild` and other programs not being found.
2024-10-31 15:09:11 +11:00
Antoine Cotten
953d02ba59
{bash,zsh}: remove nix-shell early return in /etc/{bashrc,zshenv}
The condition does not match the comment, and therefore not the original
intention. It currently returns early in *any* type of Nix shell, not
just pure ones, including 'nix develop'.

Besides being unnecessary, this check prevents Nix shells from
functioning properly. For instance, it causes the initialization of the
Zsh fpath to be skipped, which is critical. The fact that the user is
unable to opt out of this behaviour makes this an ever bigger problem
since /etc/zshenv is being loaded unconditionally by Zsh.

For reference, NixOS does not perform such check, and apparently never
did.
2024-09-12 17:37:56 +00:00
Sebastian Reuße
6ad463a764
zsh: don't be noisy when scripts are run with -u
When a script specifies the shell option "nounset" as part of the
shebang (e.g., via "#!/usr/bin/env -S zsh -u"), our initialization
scripts would produce error messages of the form:

    __ETC_FOO_SOURCED: parameter not set

These messages could probably be confusing to users when running such
scripts. By providing a fall-back in the parameter expansion, we can
avoid them.

This patch does not address interactive shell start-up, where such
messages may (or may not) be less problematic.

NixOS/nixpkgs@7d84dbdf5b
2024-09-11 14:07:24 +02:00
Jörg Thalheim
7e6c548eef
zsh: let children shells set their fpath
Currently zshenv by default only sets fpath without exporting it. 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 __NIX_DARWIN_SET_ENVIRONMENT_DONE. Hence
any modification done by the parent shell should persist as long as
__NIX_DARWIN_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.

NixOS/nixpkgs@55819e6c86
2024-09-11 13:01:26 +02:00
Sebastian Reuße
15f64efcaf
zsh: prefer Nix completions these from Zsh package
Zsh ships some rudimentary completions for programs where upstream also
ships their own completions (e.g., curl). So as not to shadow those
completions, we need to prepend to the fpath instead of appending.

NixOS/nixpkgs@8dad5a2239
2024-09-10 21:40:11 +02:00
Jan Malakhovski
4d59f660bc
zsh: move fpath init from /etc/zshrc to /etc/zshenv
We want these to be set even when /etc/zshrc loading is disabled.

NixOS/nixpkgs@f70e3f3738
2024-09-10 21:35:35 +02:00
Trevor Opiyo
44c88484c4 add warning for enabling syntax highlighting and fast syntax highlighting 2024-05-29 12:24:11 -05:00
Trevor Opiyo
2839ef54aa Add support for zsh-fast-syntax-highlighting 2024-05-29 12:24:11 -05:00
Dominik Gleich
c8a8faedbc
Change zsh default prompt 2024-05-20 09:48:03 +02:00
Weijia Wang
def1e23be8 treewide: remove lib.mdDoc 2024-04-19 04:05:50 +02:00
Evan Petousis
f1a0d68a8f
etc: add known hash for /etc/zshenv and /etc/nix/nix.conf
Adds support for DeterminateSystems installer 0.16.0 and later. Fixes #880.
2024-02-23 18:45:24 +11:00
Jōshin
a3be68d105
Add option to disable zsh global compinit
Fixes #855.
2024-01-21 03:24:00 -05:00
Michael Hoang
4b90ea84e4 doc: store a copy of known files 2023-07-11 18:59:05 +10:00
Cuichen Li
8364529fc4 fix zsh eating output without new line ending 2023-07-10 15:00:02 +08:00
Emily
e65131e69c treewide: convert all option docs to Markdown
This process was automated by [my fork of `nix-doc-munge`]; thanks
to @pennae for writing this tool! It automatically checks that the
resulting documentation doesn't change, although my fork loosens
this a little to ignore some irrelevant whitespace and typographical
differences.

As of this commit there is no DocBook remaining in the options
documentation.

You can play along at home if you want to reproduce this commit:

    $ NIX_PATH=nixpkgs=flake:nixpkgs/c1bca7fe84c646cfd4ebf3482c0e6317a0b13f22 \
      nix shell nixpkgs#coreutils \
      -c find . -name '*.nix' \
      -exec nix run github:emilazy/nix-doc-munge/0a7190f600027bf7baf6cb7139e4d69ac2f51062 \
      {} +

[my fork of `nix-doc-munge`]: https://github.com/emilazy/nix-doc-munge
2023-06-24 10:48:55 +01:00
Daiderd Jordan
079db5db5b
don't set SHELL automatically based on programs.<shell>.enable 2020-10-25 16:37:02 +01:00
Daiderd Jordan
20b9f53035
etc: add known hashes for bashrc/zsh/nix.conf 2020-06-17 19:37:07 +02:00
Kirill Elagin
644d6acb7a
zsh: Add vendor-completions to fpath 2019-01-04 15:50:48 +03:00
Andrew Childs
676ef10377 Unify environment configuration and don't run in child shells
This should enable `nix run` to work under shells like fish and zsh,
as well as making child shells not needlessly reset any environment
that should be inherited.

Implementation adapted from NixOS.
2018-10-25 01:00:52 +09:00
Daiderd Jordan
072d2e75ab
zsh: fix nix run shells of nix 2.0 2018-03-27 00:32:31 +02:00
Daiderd Jordan
abd9a7c2fe
zsh: remove shell wrapper 2018-01-20 01:32:33 +01:00
Daiderd Jordan
4d4acf6550
zsh: don't clobber promptInit in a nix-shell
Configure this yourself if you want a different prompt
when a nix-shell is active.
2018-01-17 01:54:02 +01:00
Daiderd Jordan
e8355cdd93
system-build: change type of setEnvironment and setAliases
On NixOS system.build.setEnvironment also is a writeText
2017-10-07 12:41:33 +02:00
Daiderd Jordan
a8b4770275
environment: include extraInit in set-environment script 2017-10-07 12:27:43 +02:00
Daiderd Jordan
94fddd38af
zsh: move environment variables to zshenv 2017-10-07 11:19:11 +02:00
Daiderd Jordan
61cd181a0f
zsh: use container names for fzf docker completion 2017-07-18 22:34:09 +02:00
Daiderd Jordan
88a11d28f1
bash: enable by default 2017-07-09 10:16:57 +02:00
Daiderd Jordan
71f25cba9d
zsh: support nix-shell --run zsh 2017-07-09 10:14:49 +02:00
Daiderd Jordan
e01e48de3b
zsh: improve fzf docker completion 2017-06-21 23:48:32 +02:00
Daiderd Jordan
f5efd16be6
zsh: add fzf completion for docker containers 2017-06-17 21:46:49 +02:00
Daiderd Jordan
983c465a72
zsh: use custom fzf completion 2017-06-13 01:00:57 +02:00
Daiderd Jordan
1b6f56f5b8
environment: include /usr/sbin and /sbin in systemPath
Don't extend initial PATH adding extra entries should be done through
appending environment.systemPath or manually extending it with
environment.extraInit or similar options.
2017-05-15 19:46:34 +02:00
Daiderd Jordan
6b1e73adb1
zsh: use explicit source instead of . 2017-05-13 15:24:13 +02:00
Daiderd Jordan
2343363b5b
zsh: link /share/zsh when enabled 2017-05-13 14:45:45 +02:00
Brandon Kase
d0e9c0762a Added zsh-syntax-highlighting option to zsh program 2017-03-05 13:21:13 -08:00
Daiderd Jordan
18c06d53bd
zsh: add options for fzf completion and git 2017-02-21 22:52:08 +01:00
Daiderd Jordan
c4e573258d
fzf-history: don't enable by default and reverse 2017-02-21 21:32:26 +01:00
Daiderd Jordan
8cdebe9fa9
add fzf history keybindings for zsh 2017-01-30 23:04:29 +01:00