From f1b65e955e789989ab591a9a6f62a604bb5b7d03 Mon Sep 17 00:00:00 2001 From: Michael Housh Date: Mon, 10 Nov 2025 15:15:10 -0500 Subject: [PATCH] WIP: Adds more items to runs/after/system, adds missing package to runs/dev, adds runs/after/gopass to remove password store. --- TODO.md | 29 ++++++++++++++++------ env/.gnupg/gpg-agent.conf | 10 +------- runs/after/gopass | 10 ++++++++ runs/after/system | 51 +++++++++++++++++++++++++++++++++++++-- runs/dev | 1 + 5 files changed, 82 insertions(+), 19 deletions(-) create mode 100755 runs/after/gopass diff --git a/TODO.md b/TODO.md index f12f9d6..468f5af 100644 --- a/TODO.md +++ b/TODO.md @@ -1,5 +1,7 @@ # TODO +A list of in-progress and completed todo's. + ## Arch Todos - [ ] Update README, it's way out of date. @@ -10,28 +12,39 @@ config in the dotfiles, but works if I use the default config. Need to explore why (current thoughts are it has to do with creating the clipboard_history.json file and not letting clipse do it automatically). -- [ ] Need to confirm bootstrap does things properly with git submodules. +- [x] Need to add the following system packages for neovim/render-markdown.nvim + - [x] `libtexprintf` + +### Bootstrapping a new machine + +- [ ] Need to confirm bootstrap does things properly with git submodules. Currently the + system run handles installing packages needed for my yubikey, probably need to automate + installing the public key into the keyring. + - [x] Add gpg public key import into `runs/after/system` - [ ] Need to ensure ssh keys are setup before private submodules are loaded / installed, so I need to make sure that Yubikey setup runs early and works for ssh authentication. -- [ ] Need to add the following system packages for neovim/render-markdown.nvim - - [ ] `libtexprintf` ### Keyboard / kanata -- [ ] Move keyboard (kanata) systemd service to be started as a '--user' service, as +- [x] Move keyboard (kanata) systemd service to be started as a '--user' service, as it seems to not work when used on a desktop (mac mini) vs. laptop. - - [ ] Need to update kanatactl to generate udev rules, etc. (see + - [x] Need to update kanatactl to generate udev rules, etc. (see here)[https://github.com/jtroo/kanata/blob/main/docs/setup-linux.md] - [ ] Need to rethink symbol / number keyboard layers. - [ ] Move symbols to their own layer. - [ ] I would like to have a symbols layer that I can hold modifier keys with a symbol and would also like to possibly pass through underlying key / experiment so that I can use default keybinds in certain applications (i.e. neovim `[b`, etc.). +- [ ] Remove pkg sub-commands from kanatactl, it is available via package manager now. + ### Runs (package installs) -- [ ] Should runs just export / echo a list of packages, then the `run` script can handle the package +- [x] Should runs just export / echo a list of packages, then the `run` script can handle the package manager options / command. -- [ ] Think about adding an `after` directory for runs, so that they can perform setup tasks after +- [x] Think about adding a `before` and an `after` directory for runs, so that they can perform setup tasks after the packages are installed. - - [ ] The `after` file should have the same name as the `run` file. + - [x] The `before` and `after` file should have the same name as the `run` file. - [ ] This could allow to remove / move the `system` script into the `after` directory. +- [ ] Look into install packages with `nvim --headless`, not sure if this possible when using the new package + manager builtin to neovim as it prompts for user input to install packages. + - With lazy this was done with `nvim --headless "+Lazy! sync" +qa` diff --git a/env/.gnupg/gpg-agent.conf b/env/.gnupg/gpg-agent.conf index 2110d5e..6724ed5 100644 --- a/env/.gnupg/gpg-agent.conf +++ b/env/.gnupg/gpg-agent.conf @@ -2,13 +2,5 @@ # https://www.gnupg.org/documentation/manuals/gnupg/Agent-Options.html enable-ssh-support ttyname $GPG_TTY -default-cache-ttl 60 +default-cache-ttl 120 max-cache-ttl 120 -#pinentry-program /usr/bin/pinentry-curses -#pinentry-program /usr/bin/pinentry-gnome3 -#pinentry-program /bin/pinentry-tty -#pinentry-program /usr/bin/pinentry-x11 -#pinentry-program /usr/local/bin/pinentry-curses -#pinentry-program /bin/pinentry-dmenu - -#pinentry-program /opt/homebrew/bin/pinentry-mac diff --git a/runs/after/gopass b/runs/after/gopass new file mode 100755 index 0000000..fa0ce44 --- /dev/null +++ b/runs/after/gopass @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +XDG_DATA_HOME=${XDG_DATA_HOME:-"$HOME"/.local/share} + +uninstall() { + [[ -d "$XDG_DATA_HOME/gopass" ]] && rm -rf "$XDG_DATA_HOME/gopass" +} + +arg=${1:-""} +[[ $arg == "install" ]] && install diff --git a/runs/after/system b/runs/after/system index 30ca197..5e76db0 100755 --- a/runs/after/system +++ b/runs/after/system @@ -4,19 +4,66 @@ set -e set -o nounset set -o pipefail +# Set scripts to be in the DEV_ENV folder encase they have not been +# installed yet. SCRIPTS="${DEV_ENV}/env/.local/scripts" +_setup-mounts() { + local line="nas.housh.dev:/var/nfs/shared/michael_share /mnt/michael nfs defaults 0 0" + if sudo cat /etc/fstab | grep -vq "$line"; then + log " Setting up nas mount." + sudo mkdir -p /mnt/michael &>/dev/null + echo "$line" | sudo tee --append /etc/fstab + sudo systemctl daemon-reload + sudo mount -a || + log --warning "You will need to make sure this computer's ip is in the allow list, then run 'sudo mount -a'" + fi +} + +_setup-kanata() { + log " Setting up kanata udev rules." + sudo groupadd --system uinput + sudo usermod -aG input "$USER" + sudo usermod -aG uinput "$USER" + [[ ! -f /etc/udev/rules.d/99-input.rules ]] && + ( + echo 'KERNEL=="uinput", MODE="0660", GROUP="uinput", OPTIONS+="static_node=uinput"' | + sudo tee /etc/udev/rules.d/99-input.rules + ) && + sudo udevadm control --reload-rules && + sudo udevadm trigger && + sudo modprobe uinput + log " Setting up kanata, using kanatactl." + SCRIPTS="$SCRIPTS" "$SCRIPTS/kanatactl" service install --prompt +} + +_setup-gpg() { + log " Setting up gpg." + local dir=/tmp/gpg-public-key + mkdir -p ~/{.gnupg,.ssh} &>/dev/null + chmod 700 ~/.gnupg + chmod 700 ~/.ssh + git clone https://git.housh.dev/michael/gpg-public-key.git "$dir" + pushd "$dir" &>/dev/null || exit 1 + ( + source ./import + ) + popd &>/dev/null || exit 1 +} + install() { log " Setting user shell to 'zsh'." sudo chsh --shell "$(which zsh)" - log " Enabling up systemd services." + log " Enabling systemd services." sudo systemctl daemon-reload sudo systemctl enable --now pcscd.service sudo systemctl enable --now firewalld.service systemctl --user enable --now logout-task.service systemctl --user enable --now battery-monitor.timer systemctl --user enable --now tmux-kill-sessions.timer - SCRIPTS="$SCRIPTS" "$SCRIPTS/kanatactl" service install --prompt + _setup-kanata + _setup-mounts + _setup-gpg } arg=${1:-""} diff --git a/runs/dev b/runs/dev index 9b8e251..14d97fb 100644 --- a/runs/dev +++ b/runs/dev @@ -7,6 +7,7 @@ fzf git-lfs gum jq +libtexprintf neovim nodejs npm