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

132 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
Emily
f203352cc0
Merge pull request #1135 from Enzime/push-lxwqqpssklyn
environment: remove misleading `environment.loginShell` option
2024-11-02 22:23:10 +00:00
Michael Hoang
63f4d40e55 tmux: remove programs.tmux.defaultCommand 2024-10-31 16:00:03 +11: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
isabel
c9fd4820d5
programs/bash: move to completion.*
a port of https://github.com/NixOS/nixpkgs/pull/291552 for darwin
2024-10-08 10:05:26 +01: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
Ihar Hrachyshka
75d14c62cb gpg: Suppress stderr from gpg-connect-agent on shell init
In some scenarios, the command may fail, e.g. when the shell is executed
with a different $HOME from where gpg agent is configured to run from.

(E.g. this happens in kitty terminal test suite.)

This patch will suppress stderr errors on tty in this situation.

Note that zsh does not allow to suppress execution of /etc/zshenv on
startup, so it's impossible to skip it in the test suite environment.

An alternative would be to set IN_NIX_SHELL in the test suite, but this
was rejected in upstream:

https://github.com/kovidgoyal/kitty/pull/7800

There's also a kitty package specific fix posted here but this may be
unnecessary once nix-darwin is patched here:

https://github.com/NixOS/nixpkgs/pull/338070

Signed-off-by: Ihar Hrachyshka <ihar.hrachyshka@gmail.com>
2024-08-29 16:37:56 -04:00
Alice Carroll
d5dba1c6f5
refactor: rename environment.postBuild to environment.extraSetup 2024-08-17 02:50:56 +03:00
Jörg Thalheim
cf45edbf27 programs.ssh: add certificate authorities 2024-07-31 19:34:17 +02:00
zowoq
e88eb66c2b mapAttrsFlatten -> mapAttrsToList
deprecated in 473e469d5a
2024-07-27 13:37:28 +10:00
Emily
cf297a8d24
Merge pull request #976 from emilazy/openssh-use-links-for-authorized-keys
ssh: use symlinks for `authorizedKeys` options
2024-07-10 09:17:22 +01:00
Nikola Milojević
e00896468a
chore: remove mkpackageoptionmd deprecation 2024-07-01 16:24:41 +02:00
Emily
b833d4a32d ssh: use symlinks for authorizedKeys options
As explained in the changelog and activation check, the previous
implementation had a nasty security bug that made removing a user’s
authorized keys effectively a no‐op.
2024-06-15 12:15:13 +01: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
Mathew Polzin
9090c6f897 nix-darwin/programs.direnv: init 2024-02-27 08:38:36 -06: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
Wael M. Nasreddine
e58bcb921b
programs.ssh: write ssh known_hosts only if there are any set 2023-09-15 08:24:20 -07:00
Emily
e2187d633c fish: simplify babelfishTranslate 2023-08-05 22:57:44 +01:00
Emily
e65825ca9e fish: add default for babelfishPackage
This option should probably be dropped but I'd prefer to batch that
with using Babelfish by default (or unconditionally, as Home Manager
does) so as to avoid multiple independent breaking changes.

Fixes: #632
2023-08-05 21:36:54 +01:00
Jakub Janczak
6a00d1b59b Update modules/programs/bash/default.nix
Co-authored-by: Michael Hoang <Enzime@users.noreply.github.com>
2023-07-26 09:19:33 +02:00
Jakub Janczak
e21b70da3f Don't run static bashrc only for pure nix-shell 2023-07-26 09:19:33 +02:00
Michael Hoang
63af129cb5 etc: use .before-nix-darwin instead of .orig 2023-07-12 08:35:36 +10: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
Michael Hoang
257b5c1994 ssh: fix public keys in home directory not working
Added `services.openssh.authorizedKeysFiles` option from NixOS.
2023-06-08 15:44:07 +10:00
sbh69840
f781cb0ac5 give credits 2023-05-10 21:39:27 +05:30
sbh69840
4094dbccde newline eof for authorized-keys conf 2023-05-10 21:30:35 +05:30
sbh69840
ab2e16159f authkeys path in sshd_config 2023-05-10 21:16:52 +05:30
sbh69840
ecb5840f6b enable copy 2023-05-10 19:35:23 +05:30
sbh69840
64a15676ac support authorized_keys for users 2023-05-10 19:28:00 +05:30
Tianyao Chou
a3cab812ac add escape to shell aliases 2022-06-30 19:21:36 +02:00
Daiderd Jordan
44da835ac4
add forward compatibility for literalExample deprecation
Fixes #367
2021-10-23 15:06:42 +02:00
Daiderd Jordan
034600cb84
Merge pull request #288 from r-burns/fish-fenv
fish: fix fenv function path
2021-02-17 18:42:11 +01:00
Daiderd Jordan
c8be627ed0
Merge pull request #292 from MaxSchlueter/fix-gnupg-agent
Fix gnupg-agent being kept alive
2021-02-17 18:29:46 +01:00
Max Schlueter
6d4bf1a29e
Fix gnupg-agent being kept alive
The agent is restarted automatically after it has been launched
successfully, this creates a lot of noise in the logs. This change
reloads the agent only if it has crashed, i.e. returns with a non-zero
exit code.
2021-02-14 21:55:16 +09:00
Ryan Burns
771f01c4e6 fish: fix fenv function path 2021-02-04 17:52:27 -08:00
Kevin Griffin
aa5611cc81
fish: fix fenv reference on 20.09
Referring to the deprecated package first causes
an error to be thrown before the correct package can be selected.
2021-01-30 11:27:01 +09:00
Kevin Griffin
867ef96e0b
fish: add babelfish translation option
Configuration may be ran through fenv at shell start time
(as previously) or translated to fish at build time with
a specified babelfish package.
2021-01-17 10:30:27 +09:00