From 735c2644a6dba37b985dcd4f2e0341c0f6a248e3 Mon Sep 17 00:00:00 2001 From: Brian Zalewski Date: Mon, 20 Mar 2023 15:22:58 -0400 Subject: [PATCH] Latest --- .../run_onchange_after_10-configure-macos.tmpl | 16 ++++++++++------ home/dot_config/git/config.tmpl | 1 - home/dot_config/npm/npmrc.tmpl | 4 ++-- ...run_onchanges_after_generate-public-keys.tmpl | 2 +- software.yml | 1 + 5 files changed, 14 insertions(+), 10 deletions(-) diff --git a/home/.chezmoiscripts/darwin/run_onchange_after_10-configure-macos.tmpl b/home/.chezmoiscripts/darwin/run_onchange_after_10-configure-macos.tmpl index c4b3cf2e..51cb5a75 100644 --- a/home/.chezmoiscripts/darwin/run_onchange_after_10-configure-macos.tmpl +++ b/home/.chezmoiscripts/darwin/run_onchange_after_10-configure-macos.tmpl @@ -10,7 +10,10 @@ logg info 'A sudo password is required to apply some of the macOS optimizations. sudo echo "Sudo access granted." # Log commands -set +x +if [ "$DEBUG" = 'true' ]; then + set -x +fi +set -x # Enable SSH access sudo systemsetup -setremotelogin {{ .macosRemoteLogin }} @@ -216,11 +219,12 @@ sudo systemsetup -setcomputersleep Off > /dev/null sudo pmset -a hibernatemode 0 # Remove the sleep image file to save disk space -sudo rm /private/var/vm/sleepimage -# Create a zero-byte file instead… -sudo touch /private/var/vm/sleepimage -# …and make sure it can’t be rewritten -sudo chflags uchg /private/var/vm/sleepimage +if sudo rm -f /private/var/vm/sleepimage > /dev/null; then + # Create a zero-byte file instead… + sudo touch /private/var/vm/sleepimage + # …and make sure it can’t be rewritten + sudo chflags uchg /private/var/vm/sleepimage +fi ############################################################################### # Screen # diff --git a/home/dot_config/git/config.tmpl b/home/dot_config/git/config.tmpl index 39963d79..2dea3fdf 100644 --- a/home/dot_config/git/config.tmpl +++ b/home/dot_config/git/config.tmpl @@ -1,5 +1,4 @@ [include] - path = ~/.local/share/delta/themes.gitconfig path = ~/.config/git/local.toml [advice] detachedHead = false diff --git a/home/dot_config/npm/npmrc.tmpl b/home/dot_config/npm/npmrc.tmpl index 56259db1..b515f773 100644 --- a/home/dot_config/npm/npmrc.tmpl +++ b/home/dot_config/npm/npmrc.tmpl @@ -1,4 +1,4 @@ -cache=${XDG_CACHE_HOME:-$HOME/.cache}/npm +cache={{ .chezmoi.homeDir }}/.cache/npm init-author-email={{ .user.email }} init-author-name="{{ .user.name }} <{{ .user.email }}> ({{ .user.domain }})" init-author-url="{{ .user.domain }}" @@ -7,6 +7,6 @@ init-module=${XDG_CONFIG_HOME:-$HOME/.config}/npm/config/npm-init.js init-version=0.0.1 loglevel=error network-concurrency=32 -prefix=${XDG_DATA_HOME:-$HOME/.local/share}/npm +prefix={{ .chezmoi.homeDir }}/.local/share/npm strict-peer-dependencies=false //registry.npmjs.org/:_authToken={{ if (stat (joinPath .chezmoi.sourceDir ".chezmoitemplates" "secrets" "NPM_TOKEN")) }}{{ includeTemplate "secrets/NPM_TOKEN" | decrypt }}{{ else if (env "NPM_TOKEN") }}{{ env "NPM_TOKEN" }}{{ else }}${NPM_TOKEN}{{ end }} \ No newline at end of file diff --git a/home/private_dot_ssh/run_onchanges_after_generate-public-keys.tmpl b/home/private_dot_ssh/run_onchanges_after_generate-public-keys.tmpl index 3f95ae2a..177f8f7f 100644 --- a/home/private_dot_ssh/run_onchanges_after_generate-public-keys.tmpl +++ b/home/private_dot_ssh/run_onchanges_after_generate-public-keys.tmpl @@ -12,7 +12,7 @@ logg info 'Ensuring public keys are present' -find "$HOME/.ssh" -maxdepth 1 ! -name "*.pub" ! -name "authorized_keys*" ! -name "known_host*" ! -name "config" | while read FILE; do +find "$HOME/.ssh" -type f -maxdepth 1 ! -name "*.pub" ! -name "authorized_keys*" ! -name "known_host*" ! -name "config" | while read FILE; do if [ ! -f "${FILE}.pub" ]; then logg info 'Generating missing public key for `'"$FILE"'`' ssh-keygen -f "$FILE" -y > "${FILE}.pub" diff --git a/software.yml b/software.yml index d101a544..2f1b515b 100644 --- a/software.yml +++ b/software.yml @@ -7932,6 +7932,7 @@ softwarePackages: _home: null _name: trivy _type: cli + brew: trivy github: github.com/aquasecurity/trivy yay: trivy-bin _service: false