diff --git a/dotfiles/.local/share/chezmoi/home/.chezmoi.yaml.tmpl b/dotfiles/.local/share/chezmoi/home/.chezmoi.yaml.tmpl index 7a340710..af0e363c 100644 --- a/dotfiles/.local/share/chezmoi/home/.chezmoi.yaml.tmpl +++ b/dotfiles/.local/share/chezmoi/home/.chezmoi.yaml.tmpl @@ -118,7 +118,7 @@ {{- writeToStdout "Chezmoi is running in headless environment.\n" -}} {{- end -}} -encryption = "age" +encryption: "age" age: identity: "{{ .chezmoi.homeDir }}/.config/age/chezmoi.txt" recipient: "age1necy24c4lzxheey4p2m8v4q000n442wyv47qc640ulyxx9l8dpesdqv7ey" diff --git a/dotfiles/.local/share/chezmoi/home/dot_local/share/ansible/run_onchange_after_symlink-ansible-configs b/dotfiles/.local/share/chezmoi/home/dot_local/share/ansible/run_onchange_after_symlink-ansible-configs.tmpl similarity index 51% rename from dotfiles/.local/share/chezmoi/home/dot_local/share/ansible/run_onchange_after_symlink-ansible-configs rename to dotfiles/.local/share/chezmoi/home/dot_local/share/ansible/run_onchange_after_symlink-ansible-configs.tmpl index 952ed541..1fec5a76 100644 --- a/dotfiles/.local/share/chezmoi/home/dot_local/share/ansible/run_onchange_after_symlink-ansible-configs +++ b/dotfiles/.local/share/chezmoi/home/dot_local/share/ansible/run_onchange_after_symlink-ansible-configs.tmpl @@ -1,25 +1,21 @@ #!/usr/bin/env bash -{{- includeTemplate "universal/profile" }} -{{- includeTemplate "universal/logg" }} - ### Symlink the variables / files / inventories to ~/.config/ansible folders if they are present ### i.e. Changes to upstream will not impact the play if your configuration files are stored locally for TARGET of "files" "group_vars" "host_vars" "inventories" "templates"; do - if [ -d "$XDG_CONFIG_HOME/ansible/$TARGET" ] && [ "$(readlink -f "$XDG_DATA_HOME/ansible/$TARGET")" != "$XDG_CONFIG_HOME/ansible/$TARGET" ]; then + if [ -d "$HOME/.config/ansible/$TARGET" ] && [ "$(readlink -f "$HOME/.local/share/ansible/$TARGET")" != "$HOME/.config/ansible/$TARGET" ]; then logg 'Symlinking Ansible playbook `'"$TARGET"'` to ~/.config/ansible/$TARGET' - rm -f "$XDG_DATA_HOME/ansible/$TARGET" - ln -s "$XDG_CONFIG_HOME/ansible/$TARGET" "$XDG_DATA_HOME/ansible/$TARGET" + rm -f "$HOME/.local/share/ansible/$TARGET" + ln -s "$HOME/.config/ansible/$TARGET" "$HOME/.local/share/ansible/$TARGET" fi done ### Symlink tasks as well ### Note: Only handles tasks one level deep (i.e. ~/.config/ansible/tasks/my-task.yml will link to the tasks folder ### but ~/.config/ansible/tasks/directory/my-other-task.yml will not) -find "$XDG_CONFIG_HOME/ansible/tasks" -type f | while read TASK_FILE; do +find "$HOME/.config/ansible/tasks" -type f | while read TASK_FILE; do TASK_FILE_NAME="$(echo "$TASK_FILE" | sed 's/.*\/\([^\/]*\)$/\1/')" - if [ "$(readlink -f "$XDG_DATA_HOME/ansible/tasks/$TASK_FILE_NAME")" != "$TASK_FILE" ]; then - logg 'Symlinking new task to ~/.local/share/ansible/tasks' - ln -s "$TASK_FILE" "$XDG_DATA_HOME/ansible/tasks/$TASK_FILE_NAME" + if [ "$(readlink -f "$HOME/.local/share/ansible/tasks/$TASK_FILE_NAME")" != "$TASK_FILE" ]; then + ln -s "$TASK_FILE" "$HOME/.local/share/ansible/tasks/$TASK_FILE_NAME" fi done