From 5c57559640d7239703684ed880e058f73e989b7d Mon Sep 17 00:00:00 2001 From: Ryan Yin Date: Mon, 18 Dec 2023 15:27:45 +0800 Subject: [PATCH] etc: add more known hashes for DeterminateSystems nix-installer --- ...3db0b63d940347ba71119ae6f14cccfec35da56cce | 42 +++++++++++++++++ ...a2b73b5103d0303161b3be9eac88fce83e0789f0b7 | 28 +++++++++++ ...74b5ae11882d53e206d1aa50b3abe591a8144fa710 | 47 +++++++++++++++++++ modules/programs/bash/default.nix | 1 + modules/programs/zsh/default.nix | 5 ++ 5 files changed, 123 insertions(+) create mode 100644 doc/known-files/204d2a960b3ab80e51748d3db0b63d940347ba71119ae6f14cccfec35da56cce create mode 100644 doc/known-files/383a89c1f79c3bcfd2ff39a2b73b5103d0303161b3be9eac88fce83e0789f0b7 create mode 100644 doc/known-files/b9902f2020c636aeda956a74b5ae11882d53e206d1aa50b3abe591a8144fa710 diff --git a/doc/known-files/204d2a960b3ab80e51748d3db0b63d940347ba71119ae6f14cccfec35da56cce b/doc/known-files/204d2a960b3ab80e51748d3db0b63d940347ba71119ae6f14cccfec35da56cce new file mode 100644 index 000000000..bdf745d72 --- /dev/null +++ b/doc/known-files/204d2a960b3ab80e51748d3db0b63d940347ba71119ae6f14cccfec35da56cce @@ -0,0 +1,42 @@ + +# Nix +if [ -e '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh' ]; then + . '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh' +fi +# End Nix + + +# /etc/bashrc: DO NOT EDIT -- this file has been generated automatically. +# This file is read for interactive shells. + +[ -r "/etc/bashrc_$TERM_PROGRAM" ] && . "/etc/bashrc_$TERM_PROGRAM" + +# Only execute this file once per shell. +if [ -n "$__ETC_BASHRC_SOURCED" -o -n "$NOSYSBASHRC" ]; then return; fi +__ETC_BASHRC_SOURCED=1 + +# Don't execute this file when running in a pure nix-shell. +if [ "$IN_NIX_SHELL" = "pure" ]; then return; fi + +if [ -z "$__NIX_DARWIN_SET_ENVIRONMENT_DONE" ]; then + . /nix/store/aqx44dhrnk2kdk5mvpxix8xaqsr9f3lh-set-environment +fi + +# Return early if not running interactively, but after basic nix setup. +[[ $- != *i* ]] && return + +# Make bash check its window size after a process completes +shopt -s checkwinsize + + + + + + + + + +# Read system-wide modifications. +if test -f /etc/bash.local; then + source /etc/bash.local +fi diff --git a/doc/known-files/383a89c1f79c3bcfd2ff39a2b73b5103d0303161b3be9eac88fce83e0789f0b7 b/doc/known-files/383a89c1f79c3bcfd2ff39a2b73b5103d0303161b3be9eac88fce83e0789f0b7 new file mode 100644 index 000000000..9753a8973 --- /dev/null +++ b/doc/known-files/383a89c1f79c3bcfd2ff39a2b73b5103d0303161b3be9eac88fce83e0789f0b7 @@ -0,0 +1,28 @@ + +# Set up Nix only on SSH connections +# See: https://github.com/DeterminateSystems/nix-installer/pull/714 +if [ -e '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh' ] && [ -n "${SSH_CONNECTION}" ] && [ "${SHLVL}" -eq 1 ]; then + . '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh' +fi +# End Nix +# /etc/zshenv: DO NOT EDIT -- this file has been generated automatically. +# This file is read for all shells. + +# Only execute this file once per shell. +# But don't clobber the environment of interactive non-login children! +if [ -n "$__ETC_ZSHENV_SOURCED" ]; then return; fi +export __ETC_ZSHENV_SOURCED=1 + +# Don't execute this file when running in a pure nix-shell. +if test -n "$IN_NIX_SHELL"; then return; fi + +if [ -z "$__NIX_DARWIN_SET_ENVIRONMENT_DONE" ]; then + . /nix/store/aqx44dhrnk2kdk5mvpxix8xaqsr9f3lh-set-environment +fi + + + +# Read system-wide modifications. +if test -f /etc/zshenv.local; then + source /etc/zshenv.local +fi diff --git a/doc/known-files/b9902f2020c636aeda956a74b5ae11882d53e206d1aa50b3abe591a8144fa710 b/doc/known-files/b9902f2020c636aeda956a74b5ae11882d53e206d1aa50b3abe591a8144fa710 new file mode 100644 index 000000000..94243d44a --- /dev/null +++ b/doc/known-files/b9902f2020c636aeda956a74b5ae11882d53e206d1aa50b3abe591a8144fa710 @@ -0,0 +1,47 @@ + +# Nix +if [ -e '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh' ]; then + . '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh' +fi +# End Nix + + +# /etc/zshrc: DO NOT EDIT -- this file has been generated automatically. +# This file is read for interactive shells. + +# Only execute this file once per shell. +if [ -n "$__ETC_ZSHRC_SOURCED" -o -n "$NOSYSZSHRC" ]; then return; fi +__ETC_ZSHRC_SOURCED=1 + +# history defaults +SAVEHIST=2000 +HISTSIZE=2000 +HISTFILE=$HOME/.zsh_history + +setopt HIST_IGNORE_DUPS SHARE_HISTORY HIST_FCNTL_LOCK + +bindkey -e + + + + +# Tell zsh how to find installed completions +for p in ${(z)NIX_PROFILES}; do + fpath+=($p/share/zsh/site-functions $p/share/zsh/$ZSH_VERSION/functions $p/share/zsh/vendor-completions) +done + +autoload -U promptinit && promptinit && prompt walters && setopt prompt_sp + +autoload -U compinit && compinit +autoload -U bashcompinit && bashcompinit + + + + + + + +# Read system-wide modifications. +if test -f /etc/zshrc.local; then + source /etc/zshrc.local +fi diff --git a/modules/programs/bash/default.nix b/modules/programs/bash/default.nix index 61f82e01a..cba214ab8 100644 --- a/modules/programs/bash/default.nix +++ b/modules/programs/bash/default.nix @@ -100,6 +100,7 @@ in "617b39e36fa69270ddbee19ddc072497dbe7ead840cbd442d9f7c22924f116f4" # official Nix installer "6be16cf7c24a3c6f7ae535c913347a3be39508b3426f5ecd413e636e21031e66" # official Nix installer "08ffbf991a9e25839d38b80a0d3bce3b5a6c84b9be53a4b68949df4e7e487bb7" # DeterminateSystems installer + "204d2a960b3ab80e51748d3db0b63d940347ba71119ae6f14cccfec35da56cce" # DeterminateSystems nix-installer 0.15.1+ ]; }; diff --git a/modules/programs/zsh/default.nix b/modules/programs/zsh/default.nix index 4e983e51d..2b4095a4d 100644 --- a/modules/programs/zsh/default.nix +++ b/modules/programs/zsh/default.nix @@ -197,12 +197,17 @@ in "0235d3c1b6cf21e7043fbc98e239ee4bc648048aafaf6be1a94a576300584ef2" # macOS ]; + environment.etc."zshenv".knownSha256Hashes = [ + "383a89c1f79c3bcfd2ff39a2b73b5103d0303161b3be9eac88fce83e0789f0b7" # DeterminateSystems nix-installer 0.15.1+ + ]; + environment.etc."zshrc".knownSha256Hashes = [ "19a2d673ffd47b8bed71c5218ff6617dfc5e8533b240b9ba79142a45f8823c23" "fb5827cb4712b7e7932d438067ec4852c8955a9ff0f55e282473684623ebdfa1" # macOS "c5a00c072c920f46216454978c44df044b2ec6d03409dc492c7bdcd92c94a110" # official Nix installer "40b0d8751adae5b0100a4f863be5b75613a49f62706427e92604f7e04d2e2261" # official Nix installer "2af1b563e389d11b76a651b446e858116d7a20370d9120a7e9f78991f3e5f336" # DeterminateSystems installer + "b9902f2020c636aeda956a74b5ae11882d53e206d1aa50b3abe591a8144fa710" # DeterminateSystems nix-installer 0.15.1+ ]; };