Skip to content

Commit

Permalink
feat(chezmoi): streamline run scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
entelecheia committed May 25, 2023
1 parent 968192d commit fefda88
Show file tree
Hide file tree
Showing 16 changed files with 77 additions and 140 deletions.
20 changes: 0 additions & 20 deletions chezmoi/.chezmoiscripts/run_once_after_30-github-auth.sh.tmpl

This file was deleted.

14 changes: 0 additions & 14 deletions chezmoi/.chezmoiscripts/run_once_after_35-restore-dotfiles.sh.tmpl

This file was deleted.

57 changes: 57 additions & 0 deletions chezmoi/.chezmoiscripts/run_once_after_40-configuration.sh.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#!/bin/bash
# shellcheck source=/dev/null
source "${HOME}/.config/shrc/00-dotfiles-export"

# log_task "Authenticating with GitHub"
GITHUB_USERNAME=${GITHUB_USERNAME:-"{{ .github.username }}"}
GITHUB_TOKEN=${GITHUB_TOKEN:-"{{ .github.token }}"}
export GITHUB_USERNAME
export GITHUB_TOKEN

# github-auth hash: {{ include "dot_local/bin/executable_github-auth.tmpl" | sha256sum }}
# {{- if .system.is_interactive }}
github-auth --interactive
# {{- else }}
github-auth
# {{- end }}

# log_task "Restoring dotfiles from backup with autorestic"
# {{- if and (.autorestic.enabled) (.autorestic.restore_dotfiles) }}
# dotfiles-restore hash: {{ include "dot_local/bin/executable_dotfiles-restore.tmpl" | sha256sum }}
dotfiles-restore
# {{- end }}

# log_task "Setting up SSH, AGE, and GPG keys"
# before generating SSH keys, you can install them from the dotdrop repository
# {{- if .dotdrop.enabled }}
# dotfiles-setup-dotdrop hash: {{ include "dot_local/bin/executable_dotfiles-setup-dotdrop.tmpl" | sha256sum }}
dotfiles-setup-dotdrop
# {{- end }}
# dotfiles-setup-ssh hash: {{ include "dot_local/bin/executable_dotfiles-setup-ssh.tmpl" | sha256sum }}
dotfiles-setup-ssh
# dotfiles-setup-age hash: {{ include "dot_local/bin/executable_dotfiles-setup-age.tmpl" | sha256sum }}
dotfiles-setup-age
export GPG_PASSPHRASE="{{ .gnupg.passphrase }}"
# dotfiles-setup-gpg hash: {{ include "dot_local/bin/executable_dotfiles-setup-gpg.tmpl" | sha256sum }}
dotfiles-setup-gpg
# dotfiles-setup-github-keys hash: {{ include "dot_local/bin/executable_dotfiles-setup-github-keys.tmpl" | sha256sum }}
dotfiles-setup-github-keys
# log_info "Done setting up SSH, AGE, and GPG keys ✨ 🌟 ✨"

# log_task "Setting up password store"
# pass-init hash: {{ include "dot_local/bin/executable_pass-init.tmpl" | sha256sum }}
pass-init
# passage-init hash: {{ include "dot_local/bin/executable_passage-init.tmpl" | sha256sum }}
passage-init

# {{- if .system.is_interactive }}
# log_task "Login to Docker Hub"
# docker-login hash: {{ include "dot_local/bin/executable_dk-login.tmpl" | sha256sum }}
dk-login
# {{- end }}

# log_task "Backing up dotfiles with autorestic"
# {{ if and (.autorestic.enabled) (.autorestic.backup_dotfiles) }}
# dotfiles-backup hash: {{ include "dot_local/bin/executable_dotfiles-backup.tmpl" | sha256sum }}
dotfiles-backup
# {{ end }}
40 changes: 0 additions & 40 deletions chezmoi/.chezmoiscripts/run_once_after_40-setup-keys.sh.tmpl

This file was deleted.

14 changes: 0 additions & 14 deletions chezmoi/.chezmoiscripts/run_once_after_45-setup-pass.sh.tmpl

This file was deleted.

This file was deleted.

12 changes: 12 additions & 0 deletions chezmoi/.chezmoiscripts/run_once_after_50-setup-workspace.sh.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash
# shellcheck source=/dev/null
source "${HOME}/.config/shrc/00-dotfiles-export"

# log_task "Setting up workspace"
# dotfiles-setup-workspace hash: {{ include "dot_local/bin/executable_dotfiles-setup-workspace.tmpl" | sha256sum }}
dotfiles-setup-workspace

# log_task "Cloning git repos"
# {{ .github.clones }}
# clone-repos hash: {{ include "dot_local/bin/executable_clone-repos.tmpl" | sha256sum }}
clone-repos
8 changes: 0 additions & 8 deletions chezmoi/.chezmoiscripts/run_once_after_55-clone-repos.sh.tmpl

This file was deleted.

11 changes: 0 additions & 11 deletions chezmoi/.chezmoiscripts/run_once_after_60-login-docker.sh.tmpl

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
#!/bin/bash
# {{ if eq .chezmoi.os "darwin" }}
# {{ template "scripts-library" }}
log_task "90. Installing Homebrew from bundle"

ensure_path_entry "${HOME}/.local/bin"

# {{- if eq .chezmoi.os "darwin" }}
# shellcheck source=/dev/null
source "${HOME}/.config/shrc/00-dotfiles-export"
# log_task "Installing Homebrew from bundle"
# brew-install-bundle hash: {{ include "dot_local/bin/executable_brew-install-bundle.tmpl" | sha256sum }}
brew-install-bundle

# {{ end -}}
# {{- end }}
15 changes: 0 additions & 15 deletions chezmoi/.chezmoiscripts/run_once_after_98-backup-dotfiles.sh.tmpl

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/bin/bash
# shellcheck source=/dev/null
source "${HOME}/.config/shrc/00-dotfiles-export"

# dotfiles-final-message hash: {{ include "dot_local/bin/executable_dotfiles-final-message.tmpl" | sha256sum }}
dotfiles-final-message
1 change: 1 addition & 0 deletions chezmoi/dot_local/bin/executable_dotfiles-restore.tmpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash
# {{ template "scripts-library" }}
log_task "Restoring dotfiles from backup with autorestic"

CONFIG_FILE="{{ .autorestic.config_file }}"
LOCATION="{{ .autorestic.location }}"
Expand Down
3 changes: 2 additions & 1 deletion chezmoi/dot_local/bin/executable_github-auth.tmpl
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#!/bin/bash
# {{ template "scripts-library" }}
log_task "Authenticating with GitHub"

# check if --interactive or -f flag is set
set +u
set +u
if [[ "${1}" == "--interactive" ]] || [[ "${1}" == "-i" ]]; then
INTERACTIVE=true
else
Expand Down

0 comments on commit fefda88

Please sign in to comment.