diff options
| author | Eugene Triguba <hello@eugenetriguba.com> | 2025-11-26 09:01:56 -0500 |
|---|---|---|
| committer | Eugene Triguba <hello@eugenetriguba.com> | 2025-11-26 09:01:56 -0500 |
| commit | 1881b5c6cce58a9944bcad2b8c68a1b4efcf77b2 (patch) | |
| tree | 33cdba30255cb9699975b0ffd11d8bc29424aa96 | |
| parent | Add wallpapers (diff) | |
| download | dotfiles-1881b5c6cce58a9944bcad2b8c68a1b4efcf77b2.zip | |
Add support for openbsd
| -rwxr-xr-x | install.sh | 22 | ||||
| -rw-r--r-- | pkg/openbsd-packages.txt | 10 | ||||
| -rwxr-xr-x | pkg/update-openbsd-packages.sh | 4 | ||||
| -rw-r--r-- | shlib/bootstrap.sh | 7 | ||||
| -rw-r--r-- | shlib/log.sh | 6 | ||||
| -rw-r--r-- | shlib/os.sh | 4 |
6 files changed, 33 insertions, 20 deletions
@@ -8,31 +8,29 @@ set -e main() { if os_is_macos; then - if ! bootstrap_macos; then - log_error "Failed to bootstrap install script" - exit 1 - fi - elif os_is_linux; then - if ! bootstrap_linux; then - log_error "Failed to bootstrap install script" - exit 1 - fi + bootstrap_macos + elif os_is_openbsd; then + bootstrap_openbsd else log_error "Unexpected OS: $(os_print)" exit 1 - fi + fi || { + log_error "Failed to bootstrap install script" + exit 1 + } + if os_is_macos; then + stow ghostty + fi stow executables stow nvim stow zsh stow git stow gpg stow tmux - stow ghostty stow aerc stow isync stow msmtp - stow atuin stow lazygit log_success "Successfully linked all dotfiles." diff --git a/pkg/openbsd-packages.txt b/pkg/openbsd-packages.txt new file mode 100644 index 0000000..d4b9afd --- /dev/null +++ b/pkg/openbsd-packages.txt @@ -0,0 +1,10 @@ +firefox +git +gopls +neovim +node +quirks +shellcheck +shfmt +stow +zsh diff --git a/pkg/update-openbsd-packages.sh b/pkg/update-openbsd-packages.sh new file mode 100755 index 0000000..744847c --- /dev/null +++ b/pkg/update-openbsd-packages.sh @@ -0,0 +1,4 @@ +#!/bin/sh +set -e + +pkg_info -m | awk '{ print }' | grep -v 'firmware' | cut -d '-' -f 1 >openbsd-packages.txt diff --git a/shlib/bootstrap.sh b/shlib/bootstrap.sh index b2d6bb9..7db72ea 100644 --- a/shlib/bootstrap.sh +++ b/shlib/bootstrap.sh @@ -17,13 +17,14 @@ bootstrap_macos() { fi log_info "Found homebrew installation. Installing Brewfile.." - (cd homebrew && brew bundle) + (cd macos/homebrew && brew bundle) log_info "Brewfile successfully installed. Moving to linking dotfiles.." sudo ln -sf "$HOME/bin/get-password" /usr/local/bin/get-password sudo ln -sf "$(which op)" /usr/local/bin/op } -bootstrap_linux() { - return 0 +bootstrap_openbsd() { + log_info "Installing OpenBSD packages..." + doas pkg_add "$(dirname "$0")/pkg/openbsd-packages.txt" | tr '\n' ' ' } diff --git a/shlib/log.sh b/shlib/log.sh index 3fcf758..f4e46ff 100644 --- a/shlib/log.sh +++ b/shlib/log.sh @@ -1,5 +1,5 @@ -# shellcheck shell=bash -[[ -n "${DOTFILES_LOG_LOADED:-}" ]] && return +# shellcheck shell=sh +[ -n "${DOTFILES_LOG_LOADED:-}" ] && return readonly DOTFILES_LOG_LOADED=1 log_info() { @@ -19,7 +19,7 @@ log_success() { } log_debug() { - [[ "${DEBUG:-}" == "true" ]] && echo "[DEBUG] $*" >&2 + [ "${DEBUG:-}" == "true" ] && echo "[DEBUG] $*" >&2 } log_newline() { diff --git a/shlib/os.sh b/shlib/os.sh index 1ac4f04..9c3b62c 100644 --- a/shlib/os.sh +++ b/shlib/os.sh @@ -10,6 +10,6 @@ os_is_macos() { [ "$(os_print)" = "Darwin" ] } -os_is_linux() { - [ "$(os_print)" = "Linux" ] +os_is_openbsd() { + [ "$(os_print)" = "OpenBSD" ] } |