diff --git a/dotfiles/.local/share/chezmoi/home/.chezmoi.yaml.tmpl b/dotfiles/.local/share/chezmoi/home/.chezmoi.yaml.tmpl index 41e1ebe5..f672bae4 100644 --- a/dotfiles/.local/share/chezmoi/home/.chezmoi.yaml.tmpl +++ b/dotfiles/.local/share/chezmoi/home/.chezmoi.yaml.tmpl @@ -131,6 +131,7 @@ data: id: "{{ get .chezmoi.osRelease "id" | default .chezmoi.os }}" home: "{{ .chezmoi.homeDir }}" homeParentFolder: "{{ if eq .chezmoi.os "linux" }}/home{{ else if eq .chezmoi.os "darwin" }}/Users{{ else }}C:\Users{{ end }}" + qubes: {{ ne (stat (joinPath "usr" "bin" "qubes-session")) false }} type: "{{ $chassisType }}" work: {{ $work }} restricted: {{ $restricted }} diff --git a/dotfiles/.local/share/chezmoi/home/.chezmoidata.yaml b/dotfiles/.local/share/chezmoi/home/.chezmoidata.yaml index f95d7459..bb18240c 100644 --- a/dotfiles/.local/share/chezmoi/home/.chezmoidata.yaml +++ b/dotfiles/.local/share/chezmoi/home/.chezmoidata.yaml @@ -38,6 +38,9 @@ # flatpak: com.yubico.yubioath # gem: altair # go: github.com/ProfessorManhattan/blockinfile@latest +# krew: +# - ctx +# - ns # nix: emplace # npm: altair # pacman: altair @@ -836,6 +839,8 @@ softwarePackages: brew: volta scoop: volta vscode: + _snapClassic: true + ansible: professormanhattan.vscode brew: visual-studio-code choco: vscode snap: code @@ -1264,10 +1269,90 @@ softwarePackages: brew: kn github: github.com/knative/client yay: knative-client-bin + kubectx: + _github: https://github.com/ahmetb/kubectx + apt: kubectx + brew: kubectx + choco: + - kubens + - kubectx + krew: + - ctx + - ns + pacman: kubectx + port: kubectx # @cli [kubenav](https://github.com/kubenav/kubenav) - kubenav is the navigator for your Kubernetes clusters right in your pocket kubenav: github: github.com/kubenav/kubenav yay: kubenav-bin + kubernetes-cli: + _snapClassic: true + brew: kubectl + choco: kubernetes-cli + snap: kubectl + kubernetes-helm: + _snapClassic: true + brew: helm + choco: kubernetes-helm + snap: helm + kubernetes-kompose: + brew: kompose + choco: kubernetes-kompose + snap: kompose + minikube: + _post: minikube config set driver virtualbox + brew: minikube + brew:darwin: + - hyperkit + - minikube + choco: minikube + kubeval: + _post:binary:darwin: | + tar xf kubeval-darwin-amd64.tar.gz + sudo cp kubeval /usr/local/bin + _post:binary:linux: | + tar xf kubeval-linux-amd64.tar.gz + sudo cp kubeval /usr/local/bin + _pre:scoop: scoop bucket add instrumenta https://github.com/instrumenta/scoop-instrumenta + binary:darwin: https://github.com/instrumenta/kubeval/releases/latest/download/kubeval-darwin-amd64.tar.gz + binary:linux: https://github.com/instrumenta/kubeval/releases/latest/download/kubeval-linux-amd64.tar.gz + brew: instrumenta/instrumenta/kubeval + scoop: kubeval + kvm: + _post:apt: | + sudo adduser "$(id -un)" kvm + sudo adduser "$(id -un)" libvirt + _post:dnf: | + sudo adduser "$(id -un)" kvm + sudo adduser "$(id -un)" libvirt + _post:pacman: | + sudo adduser "$(id -un)" kvm + sudo adduser "$(id -un)" libvirt + apt: + - bridge-utils + - libvirt-clients + - libvirt-daemon-system + - qemu-kvm + - virt-manager + - virtinst + brew: + - libvirt + - qemu + dnf: + - bridge-utils + - libvirt + - qemu-kvm + - virt-install + - virt-manager + - virt-top + - virt-viewer + pacman: + - bridge-utils + - libvirt + - virt-manager + lepton: + cask: lepton + snap: lepton # @cli [license](https://github.com/nishanths/license) - Command-line license text generator license: go: github.com/nishanths/license@latest @@ -1647,6 +1732,29 @@ softwarePackages: choco: velero github: github.com/vmware-tanzu/velero yay: velero-bin + virtualbox: + _pre:dnf: | + . /etc/os-release + cat < + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dotfiles/.local/share/chezmoi/home/dot_VirtualBox/VirtualBox.xml b/dotfiles/.local/share/chezmoi/home/dot_VirtualBox/VirtualBox.xml new file mode 100644 index 00000000..26a1da9e --- /dev/null +++ b/dotfiles/.local/share/chezmoi/home/dot_VirtualBox/VirtualBox.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dotfiles/.local/share/chezmoi/home/dot_local/bin/executable_install-software b/dotfiles/.local/share/chezmoi/home/dot_local/bin/executable_install-software index 5e791373..f399a8fb 100644 --- a/dotfiles/.local/share/chezmoi/home/dot_local/bin/executable_install-software +++ b/dotfiles/.local/share/chezmoi/home/dot_local/bin/executable_install-software @@ -164,6 +164,7 @@ async function beforeInstall(packageManager) { elif [ "$PACKAGE_MANAGER" = 'apk' ]; then elif [ "$PACKAGE_MANAGER" = 'apt' ]; then sudo apt-get update + elif [ "$PACKAGE_MANAGER" = 'ansible' ]; then elif [ "$PACKAGE_MANAGER" = 'basher' ]; then elif [ "$PACKAGE_MANAGER" = 'binary' ]; then elif [ "$PACKAGE_MANAGER" = 'bpkg' ]; then @@ -179,6 +180,8 @@ async function beforeInstall(packageManager) { elif [ "$PACKAGE_MANAGER" = 'nix' ]; then elif [ "$PACKAGE_MANAGER" = 'npm' ]; then elif [ "$PACKAGE_MANAGER" = 'pacman' ]; then + sudo pacman -Syu + elif [ "$PACKAGE_MANAGER" = 'pipx' ]; then elif [ "$PACKAGE_MANAGER" = 'pkg' ]; then elif [ "$PACKAGE_MANAGER" = 'port' ]; then elif [ "$PACKAGE_MANAGER" = 'scoop' ]; then @@ -191,36 +194,32 @@ async function beforeInstall(packageManager) { ` } +let packageManagerInstalled = {} ### Ensure the package manager is available async function ensurePackageManager(packageManager) { + if(packageManagerInstalled[packageManager]) { + return + } else { + packageManagerInstalled[packageManager] = true + } const PACKAGE_MANAGER = packageManager + if(packageManager === 'ansible') { + await ensurePackageManager('pipx') + } + if(packageManager === 'gem' || packageManager === 'go' || packageManager === 'npm' || packageManager === 'pipx' || packageManager === 'whalebrew') { + await ensurePackageManager('brew') + } await $` - ### Ensures Homebrew is installed - ensurePackageManagerHomebrew() { - if ! command -v brew > /dev/null; then - if command -v sudo > /dev/null && sudo -n true; then - echo | bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" - else - logg info 'Homebrew is not installed. Password may be required.' - bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" || BREW_EXIT_CODE="$?" - if [ -n "$BREW_EXIT_CODE" ]; then - if command -v brew > /dev/null; then - logg warn 'Homebrew was installed but part of the installation failed. Attempting to fix..' - BREW_DIRS="share/man share/doc share/zsh/site-functions etc/bash_completion.d" - for BREW_DIR in $BREW_DIRS; do - if [ -d "$(brew --prefix)/$BREW_DIR" ]; then - sudo chown -R "$(whoami)" "$(brew --prefix)/$BREW_DIR" - fi - done - brew update --force --quiet - fi - fi - fi - fi - } - if [ "$PACKAGE_MANAGER" = 'appimage' ]; then # Do nothing + elif [ "$PACKAGE_MANAGER" = 'ansible' ]; then + if [ ! -f "$HOME/.cache/megabytelabs/ansible-installed" ] || ! command -v ansible > /dev/null; then + pipx install ansible + pipx inject ansible PyObjC PyObjC-core docker lxml netaddr pexpect python-vagrant pywinrm requests-credssp watchdog + touch "$HOME/.cache/megabytelabs/ansible-installed" + else + logg '`ansible` and its supporting packages appear to be installed' + fi elif [ "$PACKAGE_MANAGER" = 'apk' ]; then if command -v apk > /dev/null; then logg '`apk` is available' @@ -251,7 +250,26 @@ async function ensurePackageManager(packageManager) { if command -v brew > /dev/null; then logg '`brew` is available' else - ensurePackageManagerHomebrew + if ! command -v brew > /dev/null; then + if command -v sudo > /dev/null && sudo -n true; then + echo | bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" + else + logg info 'Homebrew is not installed. Password may be required.' + bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" || BREW_EXIT_CODE="$?" + if [ -n "$BREW_EXIT_CODE" ]; then + if command -v brew > /dev/null; then + logg warn 'Homebrew was installed but part of the installation failed. Attempting to fix..' + BREW_DIRS="share/man share/doc share/zsh/site-functions etc/bash_completion.d" + for BREW_DIR in $BREW_DIRS; do + if [ -d "$(brew --prefix)/$BREW_DIR" ]; then + sudo chown -R "$(whoami)" "$(brew --prefix)/$BREW_DIR" + fi + done + brew update --force --quiet + fi + fi + fi + fi fi elif [ "$PACKAGE_MANAGER" = 'cargo' ]; then if command -v cargo > /dev/null; then @@ -285,13 +303,34 @@ async function ensurePackageManager(packageManager) { if command -v flatpak > /dev/null; then logg '`flatpak` is available' else - ensurePackageManagerHomebrew + if command -v apk > /dev/null; then + sudo apk add flatpak + elif command -v apt > /dev/null; then + sudo apt install -y flatpak + if [ -f /usr/bin/gnome-shell ]; then + sudo apt install -y gnome-software-plugin-flatpak + fi + if [ -f /usr/bin/plasmashell ]; then + sudo apt install -y plasmashell + fi + elif command -v dnf > /dev/null; then + sudo dnf install -y flatpak + elif command -v yum > /dev/null; then + sudo yum install -y flatpak + elif command -v pacman > /dev/null; then + sudo pacman -S flatpak + elif command -v xbps-install > /dev/null; then + sudo xbps-install -S flatpak + elif command -v zypper > /dev/null; then + sudo zypper install -y flatpak + fi + flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo + logg warn '`flatpak` may require a reboot to work properly' fi elif [ "$PACKAGE_MANAGER" = 'gem' ]; then if command -v gem > /dev/null; then logg '`gem` is available' else - ensurePackageManagerHomebrew # TODO - is this enough to make `gem install` available? brew install ruby fi @@ -299,7 +338,6 @@ async function ensurePackageManager(packageManager) { if command -v go > /dev/null; then logg '`go` is available' else - ensurePackageManagerHomebrew brew install go fi elif [ "$PACKAGE_MANAGER" = 'nix' ]; then @@ -317,7 +355,6 @@ async function ensurePackageManager(packageManager) { logg '`volta`, `npm`, and `node` are all available' else if ! command -v volta > /dev/null; then - ensurePackageManagerHomebrew if ! command -v volta > /dev/null; then logg 'Installing `volta` via `brew`' brew install volta @@ -336,6 +373,13 @@ async function ensurePackageManager(packageManager) { else logg '`pacman` is not installed' && exit 106 fi + elif [ "$PACKAGE_MANAGER" = 'pipx' ]; then + if command -v pipx > /dev/null; then + logg '`pipx` is available' + else + brew install pipx + pipx ensurepath + fi elif [ "$PACKAGE_MANAGER" = 'pkg' ]; then if command -v pkg > /dev/null; then logg '`pkg` is available' @@ -405,7 +449,6 @@ async function ensurePackageManager(packageManager) { if command -v whalebrew > /dev/null; then logg '`whalebrew` is available' else - ensurePackageManagerHomebrew logg 'Installing `whalebrew` via `brew`' brew install whalebrew fi @@ -448,6 +491,7 @@ async function installPackageList(packageManager, packages) { sudo apk add ${PACKAGES} elif [ "$PACKAGE_MANAGER" = 'apt' ]; then sudo apt-get install -y ${PACKAGES} + elif [ "$PACKAGE_MANAGER" = 'ansible' ]; then elif [ "$PACKAGE_MANAGER" = 'basher' ]; then elif [ "$PACKAGE_MANAGER" = 'binary' ]; then elif [ "$PACKAGE_MANAGER" = 'bpkg' ]; then @@ -479,6 +523,7 @@ async function installPackageList(packageManager, packages) { volta install ${PACKAGES} elif [ "$PACKAGE_MANAGER" = 'pacman' ]; then sudo pacman -Sy --noconfirm --needed ${PACKAGES} + elif [ "$PACKAGE_MANAGER" = 'pipx' ]; then elif [ "$PACKAGE_MANAGER" = 'pkg' ]; then # TODO elif [ "$PACKAGE_MANAGER" = 'port' ]; then diff --git a/dotfiles/.local/share/chezmoi/home/dot_local/bin/run_onchange_ensure-executable.tmpl b/dotfiles/.local/share/chezmoi/home/dot_local/bin/run_onchange_ensure-executable.tmpl new file mode 100644 index 00000000..d69709b7 --- /dev/null +++ b/dotfiles/.local/share/chezmoi/home/dot_local/bin/run_onchange_ensure-executable.tmpl @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +{{ $exeFiles := (output "find" (joinPath .chezmoi.homeDir ".local" "bin") "-mindepth" "1" "-maxdepth" "1" "-type" "f") -}} +{{- range $exeFile := splitList "\n" $exeFiles -}} +{{- if ne $exeFile "" -}} +# {{ $exeFile }} +{{ end -}} +{{- end }} + +### Ensure all files in ~/.local/bin are executable +find "$HOME/.local/bin" -mindepth 1 -maxdepth 1 -type f | while read EXE_FILE; do + chmod +x "$EXE_FILE" +done diff --git a/dotfiles/.local/share/chezmoi/home/dot_local/bin/symlink_bombshell-client.tmpl b/dotfiles/.local/share/chezmoi/home/dot_local/bin/symlink_bombshell-client.tmpl new file mode 100644 index 00000000..d6d3556f --- /dev/null +++ b/dotfiles/.local/share/chezmoi/home/dot_local/bin/symlink_bombshell-client.tmpl @@ -0,0 +1,4 @@ +{{- if true -}} +{{ .host.home }}/.local/src/ansible-qubes/bin/bombshell-client +{{- end -}} + diff --git a/dotfiles/.local/share/chezmoi/home/dot_local/bin/symlink_qrun.tmpl b/dotfiles/.local/share/chezmoi/home/dot_local/bin/symlink_qrun.tmpl new file mode 100644 index 00000000..81dee442 --- /dev/null +++ b/dotfiles/.local/share/chezmoi/home/dot_local/bin/symlink_qrun.tmpl @@ -0,0 +1,4 @@ +{{- if true -}} +{{ .host.home }}/.local/src/ansible-qubes/bin/qrun +{{- end -}} + diff --git a/dotfiles/.local/share/chezmoi/home/dot_local/bin/symlink_qscp b/dotfiles/.local/share/chezmoi/home/dot_local/bin/symlink_qscp new file mode 100644 index 00000000..f155a489 --- /dev/null +++ b/dotfiles/.local/share/chezmoi/home/dot_local/bin/symlink_qscp @@ -0,0 +1,3 @@ +{{- if true -}} +{{ .host.home }}/.local/src/ansible-qubes/bin/qssh +{{- end -}} diff --git a/dotfiles/.local/share/chezmoi/home/dot_local/bin/symlink_qssh.tmpl b/dotfiles/.local/share/chezmoi/home/dot_local/bin/symlink_qssh.tmpl new file mode 100644 index 00000000..b6009236 --- /dev/null +++ b/dotfiles/.local/share/chezmoi/home/dot_local/bin/symlink_qssh.tmpl @@ -0,0 +1,4 @@ +{{- if true -}} +{{ .host.home }}/.local/src/ansible-qubes/bin/qssh +{{- end -}} + diff --git a/dotfiles/.local/share/chezmoi/home/dot_local/share/ansible/plugins/action/symlink_commonlib.py.tmpl b/dotfiles/.local/share/chezmoi/home/dot_local/share/ansible/plugins/action/symlink_commonlib.py.tmpl new file mode 100644 index 00000000..a2faff6e --- /dev/null +++ b/dotfiles/.local/share/chezmoi/home/dot_local/share/ansible/plugins/action/symlink_commonlib.py.tmpl @@ -0,0 +1,3 @@ +{{- if .host.qubes -}} +{{ .host.home }}/.local/src/ansible-qubes/action_plugins/commonlib.py +{{- end -}} diff --git a/dotfiles/.local/share/chezmoi/home/dot_local/share/ansible/plugins/action/symlink_qubes_pass.py.tmpl b/dotfiles/.local/share/chezmoi/home/dot_local/share/ansible/plugins/action/symlink_qubes_pass.py.tmpl new file mode 100644 index 00000000..4a41c9da --- /dev/null +++ b/dotfiles/.local/share/chezmoi/home/dot_local/share/ansible/plugins/action/symlink_qubes_pass.py.tmpl @@ -0,0 +1,3 @@ +{{- if .host.qubes -}} +{{ .host.home }}/.local/src/ansible-qubes/action_plugins/qubes_pass.py +{{- end -}} diff --git a/dotfiles/.local/share/chezmoi/home/dot_local/share/ansible/plugins/action/symlink_qubesformation.py.tmpl b/dotfiles/.local/share/chezmoi/home/dot_local/share/ansible/plugins/action/symlink_qubesformation.py.tmpl new file mode 100644 index 00000000..56dddd56 --- /dev/null +++ b/dotfiles/.local/share/chezmoi/home/dot_local/share/ansible/plugins/action/symlink_qubesformation.py.tmpl @@ -0,0 +1,3 @@ +{{- if .host.qubes -}} +{{ .host.home }}/.local/src/ansible-qubes/action_plugins/qubesformation.py +{{- end -}} diff --git a/dotfiles/.local/share/chezmoi/home/dot_local/share/ansible/plugins/action/symlink_qubesguid.py.tmpl b/dotfiles/.local/share/chezmoi/home/dot_local/share/ansible/plugins/action/symlink_qubesguid.py.tmpl new file mode 100644 index 00000000..a6bf7a1c --- /dev/null +++ b/dotfiles/.local/share/chezmoi/home/dot_local/share/ansible/plugins/action/symlink_qubesguid.py.tmpl @@ -0,0 +1,3 @@ +{{- if .host.qubes -}} +{{ .host.home }}/.local/src/ansible-qubes/action_plugins/qubesguid.py +{{- end -}} diff --git a/dotfiles/.local/share/chezmoi/home/dot_local/share/ansible/plugins/action/symlink_qubessls.py.tmpl b/dotfiles/.local/share/chezmoi/home/dot_local/share/ansible/plugins/action/symlink_qubessls.py.tmpl new file mode 100644 index 00000000..b1fc195b --- /dev/null +++ b/dotfiles/.local/share/chezmoi/home/dot_local/share/ansible/plugins/action/symlink_qubessls.py.tmpl @@ -0,0 +1,3 @@ +{{- if .host.qubes -}} +{{ .host.home }}/.local/src/ansible-qubes/action_plugins/qubessls.py +{{- end -}} diff --git a/dotfiles/.local/share/chezmoi/home/dot_local/share/ansible/plugins/connection/symlink_qubes.py.tmpl b/dotfiles/.local/share/chezmoi/home/dot_local/share/ansible/plugins/connection/symlink_qubes.py.tmpl new file mode 100644 index 00000000..74a0af6e --- /dev/null +++ b/dotfiles/.local/share/chezmoi/home/dot_local/share/ansible/plugins/connection/symlink_qubes.py.tmpl @@ -0,0 +1,3 @@ +{{- if .host.qubes -}} +{{ .host.home }}/.local/src/ansible-qubes/connection_plugins/qubes.py +{{- end -}} diff --git a/dotfiles/.local/share/chezmoi/home/dot_local/share/ansible/plugins/library/symlink_qubes_pass.py.tmpl b/dotfiles/.local/share/chezmoi/home/dot_local/share/ansible/plugins/library/symlink_qubes_pass.py.tmpl new file mode 100644 index 00000000..6ed8635c --- /dev/null +++ b/dotfiles/.local/share/chezmoi/home/dot_local/share/ansible/plugins/library/symlink_qubes_pass.py.tmpl @@ -0,0 +1,3 @@ +{{- if .host.qubes -}} +{{ .host.home }}/.local/src/ansible-qubes/library/qubes_pass.py +{{- end -}} diff --git a/dotfiles/.local/share/chezmoi/home/dot_local/share/ansible/plugins/library/symlink_qubesformation.py.tmpl b/dotfiles/.local/share/chezmoi/home/dot_local/share/ansible/plugins/library/symlink_qubesformation.py.tmpl new file mode 100644 index 00000000..3cc44b5b --- /dev/null +++ b/dotfiles/.local/share/chezmoi/home/dot_local/share/ansible/plugins/library/symlink_qubesformation.py.tmpl @@ -0,0 +1,3 @@ +{{- if .host.qubes -}} +{{ .host.home }}/.local/src/ansible-qubes/library/qubesformation.py +{{- end -}} diff --git a/dotfiles/.local/share/chezmoi/home/dot_local/share/ansible/plugins/library/symlink_qubesguid.py.tmpl b/dotfiles/.local/share/chezmoi/home/dot_local/share/ansible/plugins/library/symlink_qubesguid.py.tmpl new file mode 100644 index 00000000..def4a7e5 --- /dev/null +++ b/dotfiles/.local/share/chezmoi/home/dot_local/share/ansible/plugins/library/symlink_qubesguid.py.tmpl @@ -0,0 +1,3 @@ +{{- if .host.qubes -}} +{{ .host.home }}/.local/src/ansible-qubes/library/qubesguid.py +{{- end -}} diff --git a/dotfiles/.local/share/chezmoi/home/dot_local/share/ansible/plugins/library/symlink_qubessls.py.tmpl b/dotfiles/.local/share/chezmoi/home/dot_local/share/ansible/plugins/library/symlink_qubessls.py.tmpl new file mode 100644 index 00000000..ed33069f --- /dev/null +++ b/dotfiles/.local/share/chezmoi/home/dot_local/share/ansible/plugins/library/symlink_qubessls.py.tmpl @@ -0,0 +1,3 @@ +{{- if .host.qubes -}} +{{ .host.home }}/.local/src/ansible-qubes/library/qubessls.py +{{- end -}} diff --git a/dotfiles/.local/share/chezmoi/home/dot_local/share/ansible/plugins/lookup/symlink_jq.py.tmpl b/dotfiles/.local/share/chezmoi/home/dot_local/share/ansible/plugins/lookup/symlink_jq.py.tmpl new file mode 100644 index 00000000..d91dcab1 --- /dev/null +++ b/dotfiles/.local/share/chezmoi/home/dot_local/share/ansible/plugins/lookup/symlink_jq.py.tmpl @@ -0,0 +1,4 @@ +{{- if .host.qubes -}} +{{ .host.home }}/.local/src/ansible-qubes/lookup_plugins/jq.py +{{- end -}} + diff --git a/dotfiles/.local/share/chezmoi/home/dot_local/share/ansible/plugins/lookup/symlink_qubes-pass.py.tmpl b/dotfiles/.local/share/chezmoi/home/dot_local/share/ansible/plugins/lookup/symlink_qubes-pass.py.tmpl new file mode 100644 index 00000000..a99883e6 --- /dev/null +++ b/dotfiles/.local/share/chezmoi/home/dot_local/share/ansible/plugins/lookup/symlink_qubes-pass.py.tmpl @@ -0,0 +1,3 @@ +{{- if .host.qubes -}} +{{ .host.home }}/.local/src/ansible-qubes/lookup_plugins/qubes-pass.py +{{- end -}} diff --git a/dotfiles/.local/share/chezmoi/home/dot_local/share/ansible/roles/run_onchange_after_symlink-ansible-roles b/dotfiles/.local/share/chezmoi/home/dot_local/share/ansible/roles/run_onchange_after_symlink-ansible-roles new file mode 100644 index 00000000..777c8b54 --- /dev/null +++ b/dotfiles/.local/share/chezmoi/home/dot_local/share/ansible/roles/run_onchange_after_symlink-ansible-roles @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +{{ $roleDirs := (output "find" (joinPath .chezmoi.homeDir ".local" "src" "gas-station" "roles") "-mindepth" "2" "-maxdepth" "2" "-type" "d") -}} +{{- range $roleDir := splitList "\n" $roleDirs -}} +{{- if ne $roleDir "" -}} +# {{ $roleDir }} +{{ end -}} +{{- end }} + +find "$HOME/.local/src/gas-station/roles" -mindepth 2 -maxdepth 2 -type d | while read ROLE_PATH; do + ROLE_FOLDER="professormanhattan.$(echo "$ROLE_PATH" | sed 's/.*\/\([^\/]*\)$/\1/')" + ln -s "$ROLE_PATH" "$XDG_DATA_HOME/ansible/roles/$ROLE_FOLDER" +fi 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 new file mode 100644 index 00000000..1fec5a76 --- /dev/null +++ b/dotfiles/.local/share/chezmoi/home/dot_local/share/ansible/run_onchange_after_symlink-ansible-configs @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +### 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 "$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 "$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 "$HOME/.config/ansible/tasks" -type f | while read TASK_FILE; do + TASK_FILE_NAME="$(echo "$TASK_FILE" | sed 's/.*\/\([^\/]*\)$/\1/')" + 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 diff --git a/dotfiles/.local/share/chezmoi/home/dot_local/share/ansible/symlink_README.md.tmpl b/dotfiles/.local/share/chezmoi/home/dot_local/share/ansible/symlink_README.md.tmpl new file mode 100644 index 00000000..e2551961 --- /dev/null +++ b/dotfiles/.local/share/chezmoi/home/dot_local/share/ansible/symlink_README.md.tmpl @@ -0,0 +1,3 @@ +{{- if true -}} +{{ .host.home }}/.local/src/gas-station/README.md +{{- end -}} diff --git a/dotfiles/.local/share/chezmoi/home/dot_local/share/ansible/symlink_Vagrantfile.tmpl b/dotfiles/.local/share/chezmoi/home/dot_local/share/ansible/symlink_Vagrantfile.tmpl new file mode 100644 index 00000000..cc23a626 --- /dev/null +++ b/dotfiles/.local/share/chezmoi/home/dot_local/share/ansible/symlink_Vagrantfile.tmpl @@ -0,0 +1,3 @@ +{{- if true -}} +{{ .host.home }}/.local/src/gas-station/Vagrantfile +{{- end -}} diff --git a/dotfiles/.local/share/chezmoi/home/dot_local/share/ansible/symlink_ansible.cfg.tmpl b/dotfiles/.local/share/chezmoi/home/dot_local/share/ansible/symlink_ansible.cfg.tmpl new file mode 100644 index 00000000..59b063f8 --- /dev/null +++ b/dotfiles/.local/share/chezmoi/home/dot_local/share/ansible/symlink_ansible.cfg.tmpl @@ -0,0 +1,3 @@ +{{- if true -}} +{{ .host.home }}/.local/src/gas-station/ansible.cfg +{{- end -}} diff --git a/dotfiles/.local/share/chezmoi/home/dot_local/share/ansible/symlink_docs.tmpl b/dotfiles/.local/share/chezmoi/home/dot_local/share/ansible/symlink_docs.tmpl new file mode 100644 index 00000000..aa570473 --- /dev/null +++ b/dotfiles/.local/share/chezmoi/home/dot_local/share/ansible/symlink_docs.tmpl @@ -0,0 +1,3 @@ +{{- if true -}} +{{ .host.home }}/.local/src/gas-station/docs +{{- end -}} diff --git a/dotfiles/.local/share/chezmoi/home/dot_local/share/ansible/symlink_environments.tmpl b/dotfiles/.local/share/chezmoi/home/dot_local/share/ansible/symlink_environments.tmpl new file mode 100644 index 00000000..aa570473 --- /dev/null +++ b/dotfiles/.local/share/chezmoi/home/dot_local/share/ansible/symlink_environments.tmpl @@ -0,0 +1,3 @@ +{{- if true -}} +{{ .host.home }}/.local/src/gas-station/docs +{{- end -}} diff --git a/dotfiles/.local/share/chezmoi/home/dot_local/share/ansible/symlink_main.yml.tmpl b/dotfiles/.local/share/chezmoi/home/dot_local/share/ansible/symlink_main.yml.tmpl new file mode 100644 index 00000000..89e2af59 --- /dev/null +++ b/dotfiles/.local/share/chezmoi/home/dot_local/share/ansible/symlink_main.yml.tmpl @@ -0,0 +1,3 @@ +{{- if true -}} +{{ .host.home }}/.local/src/gas-station/main.yml +{{- end -}} diff --git a/dotfiles/.local/share/chezmoi/home/dot_local/share/ansible/symlink_playbooks.tmpl b/dotfiles/.local/share/chezmoi/home/dot_local/share/ansible/symlink_playbooks.tmpl new file mode 100644 index 00000000..7532ad47 --- /dev/null +++ b/dotfiles/.local/share/chezmoi/home/dot_local/share/ansible/symlink_playbooks.tmpl @@ -0,0 +1,3 @@ +{{- if true -}} +{{ .host.home }}/.local/src/gas-station/playbooks +{{- end -}} diff --git a/dotfiles/.local/share/chezmoi/home/dot_local/share/ansible/symlink_requirements.yml.tmpl b/dotfiles/.local/share/chezmoi/home/dot_local/share/ansible/symlink_requirements.yml.tmpl new file mode 100644 index 00000000..7532ad47 --- /dev/null +++ b/dotfiles/.local/share/chezmoi/home/dot_local/share/ansible/symlink_requirements.yml.tmpl @@ -0,0 +1,3 @@ +{{- if true -}} +{{ .host.home }}/.local/src/gas-station/playbooks +{{- end -}} diff --git a/dotfiles/.local/share/chezmoi/home/dot_local/share/ansible/tasks/symlink_qubes.tmpl b/dotfiles/.local/share/chezmoi/home/dot_local/share/ansible/tasks/symlink_qubes.tmpl new file mode 100644 index 00000000..c638fd2c --- /dev/null +++ b/dotfiles/.local/share/chezmoi/home/dot_local/share/ansible/tasks/symlink_qubes.tmpl @@ -0,0 +1,3 @@ +{{- if true -}} +{{ .host.home }}/.local/src/gas-station/tasks/qubes +{{- end -}} diff --git a/dotfiles/.local/share/chezmoi/home/private_dot_config/VirtualBox/VirtualBox.xml.tmpl b/dotfiles/.local/share/chezmoi/home/private_dot_config/VirtualBox/VirtualBox.xml.tmpl new file mode 100644 index 00000000..f51de8de --- /dev/null +++ b/dotfiles/.local/share/chezmoi/home/private_dot_config/VirtualBox/VirtualBox.xml.tmpl @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dotfiles/.local/share/chezmoi/home/private_dot_config/environments/desktop b/dotfiles/.local/share/chezmoi/home/private_dot_config/environments/desktop index 8b137891..53727843 100644 --- a/dotfiles/.local/share/chezmoi/home/private_dot_config/environments/desktop +++ b/dotfiles/.local/share/chezmoi/home/private_dot_config/environments/desktop @@ -1 +1,4 @@ - +cointop +google-assistant +translate-shell +qlplugins \ No newline at end of file diff --git a/dotfiles/.local/share/chezmoi/home/private_dot_config/environments/development b/dotfiles/.local/share/chezmoi/home/private_dot_config/environments/development index 8b137891..c1a50433 100644 --- a/dotfiles/.local/share/chezmoi/home/private_dot_config/environments/development +++ b/dotfiles/.local/share/chezmoi/home/private_dot_config/environments/development @@ -1 +1,76 @@ - +act +altair +android-studio +appium +aquasecurity/trivy/trivy +awscli +azure-cli +balenaetcher +bitwarden +bun +codeclimate +consul-template +dive +docker +docker-slim +exiftool +ffmpeg +firefox +gh +gimp +git-filter-repo +git-subrepo +gitlab-runner +gitleaks +glab +go +goodwithtech/r/dockle +goofys +google-chrome +google-cloud-sdk +gradle +hashicorp/tap/waypoint +helm +htmlq +hudochenkov/sshpass/sshpass +java +juju +kubectx +kubernetes-cli +lens +librsvg +macfuse +microsoft-teams +minio/stable/mc +mitmproxy +nomad +oq +packer +pandoc +parallels +pgcli +poetry +postman +python +ruby +scrcpy +sdkman +shc +skype +slack +teamviewer +teleport +terraform +tfenv +tokei +upx +vagrant +virtualbox +vscode +vmware +watchman +wireshark +wireshark +wkhtmltopdf +yank +yarn diff --git a/dotfiles/.local/share/chezmoi/home/private_dot_config/environments/terminal b/dotfiles/.local/share/chezmoi/home/private_dot_config/environments/terminal index 8b137891..cd4c93af 100644 --- a/dotfiles/.local/share/chezmoi/home/private_dot_config/environments/terminal +++ b/dotfiles/.local/share/chezmoi/home/private_dot_config/environments/terminal @@ -1 +1,99 @@ - +aria2 +asdf +automake +autorestic +bandwhich +bat +bitwarden-cli +cheat +chezmoi +choose +cloudflared +cmake +coreutils +croc +ctop +curl +curlie +dasel +deno +difftastic +direnv +duf +dust +etcd +exa +fd +ffsend +fq +fselect +fx +fzf +gist +git +git-delta +git-lfs +git-secret +gitui +glances +glow +go-task/tap/go-task +gomplate +googler +gping +grex +gron +gum +hexyl +hey +htop +hyperfine +imagemagick +jo +jq +jq +litecli +m-cli +mcfly +mkcert +mycli +nb +nmap +nnn +node +openssh +ots +pass +peco +pnpm +procs +pup +pywhat +rclone +restic +ripgrep +ripgrep-all +rm-improved +rsync +sd +shellcheck +sops +sqlite +ssh-vault +sysbench +t-rec +teller +tmux +tree +up +vault +vim +volta +watchexec +wget +whalebrew +yj +yq +zoxide +zsh +zx diff --git a/dotfiles/.local/share/chezmoi/home/private_dot_config/environments/work b/dotfiles/.local/share/chezmoi/home/private_dot_config/environments/work deleted file mode 100644 index 8b137891..00000000 --- a/dotfiles/.local/share/chezmoi/home/private_dot_config/environments/work +++ /dev/null @@ -1 +0,0 @@ - diff --git a/dotfiles/.local/share/chezmoi/home/private_dot_config/shell/aliases.tmpl b/dotfiles/.local/share/chezmoi/home/private_dot_config/shell/aliases.tmpl index 91219f78..ade0b7e9 100644 --- a/dotfiles/.local/share/chezmoi/home/private_dot_config/shell/aliases.tmpl +++ b/dotfiles/.local/share/chezmoi/home/private_dot_config/shell/aliases.tmpl @@ -110,7 +110,9 @@ alias myip='curl http://ipecho.net/plain; echo' alias mylocalip="ifconfig | grep -Eo 'inet (addr:|adr:)?([0-9]*\.){3}[0-9]*' | grep -Eo '([0-9]*\.){3}[0-9]*' | grep -v '127.0.0.1'" # Link pip to pip3 -alias pip='pip3' +if ! command -v pip > /dev/null; then + alias pip='pip3' +fi # Show open ports alias ports='sudo netstat -tulanp' diff --git a/dotfiles/.local/share/chezmoi/home/private_dot_config/shell/exports.tmpl b/dotfiles/.local/share/chezmoi/home/private_dot_config/shell/exports.tmpl index bf60332a..eff03aff 100644 --- a/dotfiles/.local/share/chezmoi/home/private_dot_config/shell/exports.tmpl +++ b/dotfiles/.local/share/chezmoi/home/private_dot_config/shell/exports.tmpl @@ -34,7 +34,7 @@ export GTK_RC_FILES="$XDG_CONFIG_HOME/gtk-1.0/gtkrc" export GTK2_RC_FILES="$XDG_CONFIG_HOME/gtk-2.0/gtkrc" ### PATH -export PATH="$PATH:$HOME/.local/bin" +export PATH="$HOME/.local/bin:$PATH" export SSH_KEY_PATH="~/.ssh/id_rsa" ### Homebrew @@ -63,6 +63,10 @@ fi {{ end }} export ANDROID_SDK_HOME="$XDG_DATA_HOME/android-sdk" +### Ansible +export ANSIBLE_CONFIG="$HOME/.local/ansible/ansible.cfg" +export ANSIBLE_HOME="$HOME/.local/ansible" + ### Aqua export AQUA_ROOT_DIR="$XDG_DATA_HOME/aqua" export AQUA_GLOBAL_CONFIG="$XDG_CONFIG_HOME/aqua/aqua.yaml" diff --git a/dotfiles/.local/share/chezmoi/system/.chezmoiexternal.toml b/dotfiles/.local/share/chezmoi/system/.chezmoiexternal.toml index 2ace0868..4e5fe8b4 100644 --- a/dotfiles/.local/share/chezmoi/system/.chezmoiexternal.toml +++ b/dotfiles/.local/share/chezmoi/system/.chezmoiexternal.toml @@ -3,3 +3,8 @@ url = "https://gitlab.com/megabyte-labs/cloud/nginx-configs.git" clone.args = ["--depth", "1"] pull.args = ["--ff-only"] + +["/var/lib/rundeck/libext/ansible-plugin-3.2.2.jar"] + type = "file" + url = "https://github.com/rundeck-plugins/ansible-plugin/releases/download/v3.2.2/ansible-plugin-3.2.2.jar" + refreshPeriod = "{{ $refreshPeriod }}" diff --git a/dotfiles/.local/share/chezmoi/system/etc/timeshift/timeshift.json b/dotfiles/.local/share/chezmoi/system/etc/timeshift/timeshift.json new file mode 100644 index 00000000..8fdb3ab1 --- /dev/null +++ b/dotfiles/.local/share/chezmoi/system/etc/timeshift/timeshift.json @@ -0,0 +1,24 @@ +{ + "backup_device_uuid" : "", + "parent_device_uuid" : "", + "do_first_run" : "true", + "btrfs_mode" : "true", + "include_btrfs_home" : "false", + "stop_cron_emails" : "true", + "schedule_monthly" : "false", + "schedule_weekly" : "false", + "schedule_daily" : "false", + "schedule_hourly" : "false", + "schedule_boot" : "false", + "count_monthly" : "0", + "count_weekly" : "2", + "count_daily" : "4", + "count_hourly" : "8", + "count_boot" : "0", + "snapshot_size" : "0", + "snapshot_count" : "0", + "exclude" : [ + ], + "exclude-apps" : [ + ] +} diff --git a/dotfiles/.local/share/chezmoi/software/Gasfile.yml b/dotfiles/.local/software/Gasfile.yml similarity index 100% rename from dotfiles/.local/share/chezmoi/software/Gasfile.yml rename to dotfiles/.local/software/Gasfile.yml diff --git a/dotfiles/.local/share/chezmoi/software/desktop/Brewfile b/dotfiles/.local/software/desktop/Brewfile similarity index 100% rename from dotfiles/.local/share/chezmoi/software/desktop/Brewfile rename to dotfiles/.local/software/desktop/Brewfile diff --git a/dotfiles/.local/share/chezmoi/software/desktop/Packages.config b/dotfiles/.local/software/desktop/Packages.config similarity index 100% rename from dotfiles/.local/share/chezmoi/software/desktop/Packages.config rename to dotfiles/.local/software/desktop/Packages.config diff --git a/dotfiles/.local/share/chezmoi/software/desktop/Wingetfile b/dotfiles/.local/software/desktop/Wingetfile similarity index 100% rename from dotfiles/.local/share/chezmoi/software/desktop/Wingetfile rename to dotfiles/.local/software/desktop/Wingetfile diff --git a/dotfiles/.local/share/chezmoi/software/development/Brewfile b/dotfiles/.local/software/development/Brewfile similarity index 90% rename from dotfiles/.local/share/chezmoi/software/development/Brewfile rename to dotfiles/.local/software/development/Brewfile index 8037dbd1..bdba5fea 100644 --- a/dotfiles/.local/share/chezmoi/software/development/Brewfile +++ b/dotfiles/.local/software/development/Brewfile @@ -166,20 +166,3 @@ cask "wireshark" # Pandoc optional dependency cask "basictex" -# Examples below -# 'brew install --with-rmtp', 'brew services restart' on version changes -# brew "denji/nginx/nginx-full", args: ["with-rmtp"], restart_service: :changed -# 'brew install', always 'brew services restart', 'brew link', 'brew unlink mysql' (if it is installed) -# brew "mysql@5.6", restart_service: true, link: true, conflicts_with: ["mysql"] -# 'brew install --cask' -# cask "google-chrome" -# 'brew install --cask --appdir=~/my-apps/Applications' -# cask "firefox", args: { appdir: "~/my-apps/Applications" } -# always upgrade auto-updated or unversioned cask to latest version even if already installed -# cask "opera", greedy: true -# 'brew install --cask' only if '/usr/libexec/java_home --failfast' fails -# cask "java" unless system "/usr/libexec/java_home --failfast" -# 'mas install' -# mas "1Password", id: 443987910 -# 'whalebrew install' -# whalebrew "whalebrew/wget" diff --git a/dotfiles/.local/share/chezmoi/software/development/Packages.config b/dotfiles/.local/software/development/Packages.config similarity index 100% rename from dotfiles/.local/share/chezmoi/software/development/Packages.config rename to dotfiles/.local/software/development/Packages.config diff --git a/dotfiles/.local/share/chezmoi/software/development/Scoopfile b/dotfiles/.local/software/development/Scoopfile similarity index 100% rename from dotfiles/.local/share/chezmoi/software/development/Scoopfile rename to dotfiles/.local/software/development/Scoopfile diff --git a/dotfiles/.local/share/chezmoi/software/terminal/Brewfile b/dotfiles/.local/software/terminal/Brewfile similarity index 100% rename from dotfiles/.local/share/chezmoi/software/terminal/Brewfile rename to dotfiles/.local/software/terminal/Brewfile diff --git a/dotfiles/.local/share/chezmoi/software/terminal/Packages.config b/dotfiles/.local/software/terminal/Packages.config similarity index 100% rename from dotfiles/.local/share/chezmoi/software/terminal/Packages.config rename to dotfiles/.local/software/terminal/Packages.config diff --git a/dotfiles/.local/share/chezmoi/software/terminal/Scoopfile b/dotfiles/.local/software/terminal/Scoopfile similarity index 100% rename from dotfiles/.local/share/chezmoi/software/terminal/Scoopfile rename to dotfiles/.local/software/terminal/Scoopfile