aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEugene Triguba <hello@eugenetriguba.com>2025-11-26 09:01:56 -0500
committerEugene Triguba <hello@eugenetriguba.com>2025-11-26 09:01:56 -0500
commit1881b5c6cce58a9944bcad2b8c68a1b4efcf77b2 (patch)
tree33cdba30255cb9699975b0ffd11d8bc29424aa96
parentAdd wallpapers (diff)
downloaddotfiles-1881b5c6cce58a9944bcad2b8c68a1b4efcf77b2.zip
Add support for openbsd
-rwxr-xr-xinstall.sh22
-rw-r--r--pkg/openbsd-packages.txt10
-rwxr-xr-xpkg/update-openbsd-packages.sh4
-rw-r--r--shlib/bootstrap.sh7
-rw-r--r--shlib/log.sh6
-rw-r--r--shlib/os.sh4
6 files changed, 33 insertions, 20 deletions
diff --git a/install.sh b/install.sh
index 96b8fa8..f569512 100755
--- a/install.sh
+++ b/install.sh
@@ -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" ]
}