Compare commits

...

19 Commits

Author SHA1 Message Date
adecceda7a chore(scripts): eval scripts/shared.sh 2024-07-17 10:04:16 +03:00
8a3b2e703c feat(hosts): air wallpaper 2024-07-17 09:43:41 +03:00
1ee726e30c chore(shell): remove nvm plugin from zshrc 2024-07-17 09:43:18 +03:00
9857c8eb00 feat(asdf): move rust to asdf 2024-07-17 09:41:41 +03:00
a919d9544e chore: tweaks and reworked README 2024-07-17 09:40:53 +03:00
7bc7921a17 chore: rename scripts/shared 2024-07-17 09:39:57 +03:00
735807f245 chore: cleanup 2024-07-16 23:02:13 +03:00
6d531e2d40 chore(deps): update asdf packages 2024-07-16 23:01:52 +03:00
77f89c0f48 feat(asdf): manage go packages with asdf 2024-07-16 23:01:38 +03:00
7f3c7b7e1c feat: prettier-plugin-sh + tweaks and codefixes 2024-07-16 23:00:36 +03:00
fc16b8231e feat!: asdf is now a git submodule 2024-07-16 22:58:29 +03:00
64a626d5c4 chore(asdf): update deps 2024-07-13 20:56:39 +00:00
54816c2ce9 chore(shell): new aliases 2024-07-13 16:21:43 +03:00
3acaea5611 chore(asdf): update packages 2024-07-10 09:48:31 +00:00
e4a313abe7 chore(asdf): update packages 2024-07-10 11:05:30 +03:00
0b1c75cbdd chore(dotbot): create gnupg folder 2024-07-09 03:33:28 +03:00
cab0f4da49 chore(asdf): update asdfrc 2024-07-09 03:33:02 +03:00
cef15eddce chore(asdf): update tools, fix installer 2024-07-09 03:20:50 +03:00
f8987818b8 chore(asdf): cleanup 2024-07-08 10:15:48 +03:00
50 changed files with 293 additions and 226 deletions

View File

@@ -1 +1 @@
extends @ivuorinen/browserslist-config
extends @ivuorinen/browserslist-config

View File

@@ -27,3 +27,9 @@ space_redirects = true
keep_padding = false
function_next_line = true # --func-next-line
# Ignore the entire "third_party" directory when calling shfmt on directories,
# such as "shfmt -l -w .". When formatting files directly,
# like "shfmt -w third_party/foo.sh" or "shfmt --filename=third_party/foo.sh",
# the ignore logic is applied only when the --apply-ignore flag is given.
[{tools/**,local/bin/asdf/**,config/cheat/cheatsheets/**}]
ignore = true

58
.github/README.md vendored
View File

@@ -8,6 +8,9 @@ this repository will live accordingly.
Please for the love of everything good do not use these 1:1 as your own dotfiles,
fork or download the repo as a zip and go from there with your own configs.
It would be nice if you'd add an issue linking to your fork or repo so I can
see what interesing stuff you've done with it. Sharing is caring.
## Setup
### First time setup
@@ -35,7 +38,7 @@ fork or download the repo as a zip and go from there with your own configs.
| Path | Description |
| ------------------- | -------------------------------------------- |
| `.github` | GitHub Repository configuration files. |
| `.github` | GitHub Repository configuration files, meta. |
| `hosts/{hostname}/` | Configs that should apply to that host only. |
| `local/bin` | Helper scripts that I've collected or wrote. |
| `scripts` | Setup scripts. |
@@ -51,7 +54,9 @@ fork or download the repo as a zip and go from there with your own configs.
### dfm - the dotfiles manager
`.local/bin/dfm` is a shell script that has some tools that help with dotfiles management.
[`.local/bin/dfm`][dfm] is a shell script that has some tools that help with dotfiles management.
Running `dfm` gives you a list of available commands.
## Configuration
@@ -66,51 +71,8 @@ The folder structure follows [XDG Base Directory Specification][xdg] where possi
| `$XDG_DATA_HOME` | `$HOME/.local/share` | User-specific data files |
| `$XDG_STATE_HOME` | `$HOME/.local/state` | App state that should persist between restarts |
#### XDG_BIN_HOME (`$HOME/.local/bin`)
`$XDG_BIN_HOME` defines directory that contains local binaries.
User-specific executable files may be stored in `$HOME/.local/bin`.
Distributions should ensure this directory shows up in the UNIX `$PATH`
environment variable, at an appropriate place.
#### XDG_DATA_HOME (`$HOME/.local/share`)
`$XDG_DATA_HOME` defines the base directory relative to which
user-specific _data files_ should be stored.
If `$XDG_DATA_HOME` is either not set or empty,
a default equal to `$HOME/.local/share` should be used.
#### XDG_CONFIG_HOME (`$HOME/.config`)
`$XDG_CONFIG_HOME` defines the base directory relative to which
user-specific _configuration files_ should be stored.
If `$XDG_CONFIG_HOME` is either not set or empty,
a default equal to `$HOME/.config` should be used.
#### XDG_STATE_HOME (`$HOME/.local/state`)
`$XDG_STATE_HOME` defines the base directory relative to which
user-specific _state files_ should be stored.
If `$XDG_STATE_HOME` is either not set or empty,
a default equal to `$HOME/.local/state` should be used.
The `$XDG_STATE_HOME` contains _state data_ that should
_persist between (application) restarts_, but that is not important or
portable enough to the user that it should be stored in `$XDG_DATA_HOME`.
- It may contain:
- actions history (logs, history, recently used files, …)
- current state of the application that can be reused
on a restart (view, layout, open files, undo history, …)
#### XDG_DATA_DIRS
`$XDG_DATA_DIRS` defines the preference-ordered set of base directories
to search for data files in addition to the `$XDG_DATA_HOME` base directory.
The directories in `$XDG_DATA_DIRS` should be separated with a colon ':'.
Please see [docs/folders.md][docs-folders] for more information.
[dfm]: https://github.com/ivuorinen/dotfiles/blob/main/local/bin/dfm
[docs-folders]: https://github.com/ivuorinen/dotfiles/blob/main/docs/folders.md
[xdg]: https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html

3
.gitmodules vendored
View File

@@ -64,3 +64,6 @@
[submodule "tmux/tmux-dark-notify"]
path = config/tmux/plugins/tmux-dark-notify
url = https://github.com/erikw/tmux-dark-notify.git
[submodule "asdf"]
path = local/bin/asdf
url = https://github.com/asdf-vm/asdf.git

View File

@@ -1,8 +1,12 @@
.mypy_cache/*
tools/dotbot*
local/bin/antigen.zsh
config/cheat/cheatsheets/community
config/tmux/plugins/*
lazy-lock.json
Brewfile.lock.json
config/cheat/cheatsheets/community
config/cheat/cheatsheets/tldr
config/fzf/*
config/nvim-kickstart/*
config/tmux/plugins/*
config/zsh/*
lazy-lock.json
local/bin/antigen.zsh
local/bin/asdf
tools/dotbot*

View File

@@ -1,4 +1,5 @@
module.exports = {
plugins: ['prettier-plugin-sh'],
...require('@ivuorinen/prettier-config'),
trailingComma: 'all',
// Add custom options below:

View File

@@ -18,6 +18,8 @@ git submodule add --name cheat-community \
-f https://github.com/cheat/cheatsheets.git config/cheat/cheatsheets/community
git submodule add --name cheat-tldr \
-f https://github.com/ivuorinen/cheatsheet-tldr.git config/cheat/cheatsheets/tldr
git submodule add --name asdf \
-f https://github.com/asdf-vm/asdf.git local/bin/asdf
# tmux plugin manager and plugins
git submodule add --name tmux/tmux-continuum \

View File

@@ -1,7 +1,7 @@
# this is my bashrc config. there are many like it, but this one is mine.
# shellcheck shell=bash
source "$HOME/.dotfiles/config/shared"
source "$HOME/.dotfiles/config/shared.sh"
x-load-configs
@@ -16,8 +16,8 @@ x-have oh-my-posh && {
eval "$(oh-my-posh init bash --config "$DOTFILES/config/omp/own.toml")"
}
. "$HOME/.local/share/asdf/asdf.sh"
. "$HOME/.local/share/asdf/completions/asdf.bash"
. "$XDG_BIN_HOME/asdf/asdf.sh"
. "$XDG_BIN_HOME/asdf/completions/asdf.bash"
x-have antidot && {
eval "$(antidot init)"

View File

@@ -1,6 +1,4 @@
#!/bin/env bash
[ -z "$NVM_DIR" ] && export NVM_DIR="$HOME/.config/nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm

View File

@@ -16,6 +16,4 @@ export XDG_BIN_HOME="$HOME/.local/bin"
export XDG_CACHE_HOME="$HOME/.cache"
export XDG_RUNTIME_DIR="$HOME/.local/run"
source "$DOTFILES/config/exports"
source "$DOTFILES/config/alias"
eval "$DOTFILES/config/shared.sh"

View File

@@ -1,12 +1,11 @@
# this is my zsh config. there are many like it, but this one is mine.
# shellcheck shell=bash
source "$HOME/.dotfiles/config/shared"
eval "$HOME/.dotfiles/config/shared.sh"
x-load-configs
export PATH="$XDG_BIN_HOME:$DOTFILES/local/bin:$HOME/.local/go/bin:$XDG_DATA_HOME/bob/nvim-bin:$XDG_DATA_HOME/cargo/bin:/opt/homebrew/bin:/usr/local/bin:$PATH"
x-load-configs
x-have oh-my-posh && {
eval "$(oh-my-posh init zsh --config "$DOTFILES/config/omp/own.toml")"
}
@@ -38,15 +37,11 @@ export ZSH_TMUX_UNICODE=true
export ZSH_TMUX_AUTOQUIT=false
export ZSH_TMUX_DEFAULT_SESSION_NAME=main
export NVM_DIR="$XDG_CONFIG_HOME/nvm"
export NPM_CONFIG_USERCONFIG="$XDG_CONFIG_HOME"/npm/npmrc
# z, the zsh version
export ZSHZ_DATA="$XDG_STATE_HOME/z"
antigen bundle z
# these should be always available
antigen bundle asdf
antigen bundle tmux
antigen bundle colored-man-pages
antigen bundle ssh-agent
@@ -55,10 +50,6 @@ antigen bundle zsh-users/zsh-completions
x-have python && antigen bundle MichaelAquilina/zsh-autoswitch-virtualenv
# nvm is a strange beast
zstyle ':omz:plugins:nvm' autoload yes
antigen bundle nvm
# this needs to be the last item
antigen bundle zsh-users/zsh-syntax-highlighting
antigen apply
@@ -78,12 +69,12 @@ x-have pyenv && {
# Autoupdate tmux window name
TMUX_WINDOW_NAME_PLUGIN="$DOTFILES/config/tmux/plugins/tmux-window-name/scripts/rename_session_windows.py"
[ -f "$TMUX_WINDOW_NAME_PLUGIN" ] && {
tmux-window-name()
tmux_window_name()
{
($TMUX_WINDOW_NAME_PLUGIN &)
}
add-zsh-hook chpwd tmux-window-name
tmux-window-name
add-zsh-hook chpwd tmux_window_name
tmux_window_name
}
}
@@ -91,12 +82,10 @@ x-have antidot && {
eval "$(antidot init)"
}
source "$DOTFILES/config/alias"
# Herd checks for a few environment variables to inject PHP binaries and configurations.
# Herd injected PHP binary.
# export PATH="/Users/ivuorinen/Library/Application Support/Herd/bin/":$PATH
# export PATH="/Users/ivuorinen/Library/Application\ Support/Herd/bin/":$PATH
# Herd injected PHP 8.3 configuration.
# export HERD_PHP_83_INI_SCAN_DIR="/Users/ivuorinen/Library/Application Support/Herd/config/php/83/"
# export HERD_PHP_83_INI_SCAN_DIR="/Users/ivuorinen/Library/Application\ Support/Herd/config/php/83/"
# Herd injected PHP 7.4 configuration.
# export HERD_PHP_74_INI_SCAN_DIR="/Users/ivuorinen/Library/Application Support/Herd/config/php/74/"
# export HERD_PHP_74_INI_SCAN_DIR="/Users/ivuorinen/Library/Application\ Support/Herd/config/php/74/"

View File

@@ -17,6 +17,14 @@ alias ....="cd ../../.."
# cd to git root directory
alias cdgr='cd "$(git root)"'
# interesting folders, and shortcuts
alias .="cd $HOME"
alias .b="cd $XDG_BIN_HOME"
alias .c="cd $HOME/Code"
alias .d="cd $DOTFILES"
alias .dx="cd $DOTFILES;ks"
alias .l="cd $HOME/.local"
# Shortcuts for listing
alias ll="ls -la"
alias l="ls -a"
@@ -24,6 +32,7 @@ alias l="ls -a"
# Prevent common typos
alias cd..="cd .."
alias sl="ls"
alias ls-="ls -$1"
# List only directories
alias lsd="ls -lF | grep '^d'"
@@ -130,7 +139,7 @@ weather()
}
# Docker
ssh-docker()
ssh_docker()
{
docker exec -it "$@" bash
}

View File

@@ -1,8 +1,5 @@
# See the docs for explanations: https://asdf-vm.com/manage/configuration.html
legacy_version_file = yes
use_release_candidates = no
always_keep_download = no
plugin_repository_last_check_duration = 60
disable_plugin_short_name_repository = no
concurrency = auto
legacy_version_file=yes
use_release_candidates=no
concurrency=auto

View File

@@ -0,0 +1,21 @@
// A cargo subcommand for checking and applying
// updates to installed executables
cargo-update
// Cargo cache management utility
cargo-cache
// An incremental parsing system for programming tools
tree-sitter-cli
// a subprocess caching utility
bkt
// a structural diff that understands syntax
difftastic
// A simple, fast and user-friendly alternative to 'find'
fd-find
// recursively searches directories for a
// regex pattern while respecting your gitignore
ripgrep
// A version manager for neovim
bob-nvim
// bottom, btm - A cross-platform graphical process/system monitor with
// a customizable interface and a multitude of features.
bottom

View File

@@ -0,0 +1,21 @@
// These are golang packages I use,
// so they should be available with all versions
// sysadmin/scripting utilities, distributed as a single binary
github.com/skx/sysbox@release-0.18.0
// Git Profile allows you to switch between user profiles in git repos
github.com/dotzero/git-profile@v1.4.0
// An extensible command line tool or library to format yaml files.
github.com/google/yamlfmt/cmd/yamlfmt@v0.13.0
// Parsing HTML at the command line
github.com/ericchiang/pup@v0.4.0
// HTML to Markdown converter
github.com/suntong/html2md@v1.5.0
// cheat allows you to create and view interactive cheatsheets on the cli.
github.com/cheat/cheat/cmd/cheat@4.4.2
// Render markdown on the CLI, with pizzazz! 💅
github.com/charmbracelet/glow@v1.5.1
// Static checker for GitHub Actions workflow files
github.com/rhysd/actionlint/cmd/actionlint@v1.7.1
// Cleans up your $HOME from those pesky dotfiles
github.com/doron-cohen/antidot@v0.6.3

View File

@@ -15,6 +15,7 @@ nodejs https://github.com/asdf-vm/asdf-nodejs.git
pipx https://github.com/yozachar/asdf-pipx.git 31db618
pre-commit https://github.com/jonathanmorley/asdf-pre-commit.git 26bfc42
ripgrep https://gitlab.com/wt0f/asdf-ripgrep.git e836665
rust https://github.com/code-lever/asdf-rust.git 95acf4f
semgrep https://github.com/brentjanderson/asdf-semgrep.git 13ff78b
shellcheck https://github.com/luizm/asdf-shellcheck.git 780d78d
shfmt https://github.com/luizm/asdf-shfmt.git a42c5ff

View File

@@ -1,16 +1,29 @@
1password-cli 2.29.0
age 1.2.0
asdf-plugin-manager 1.3.1
bottom 0.9.6
eza 0.18.19
dotenv-linter 3.3.0
editorconfig-checker 2.8.0
eza 0.18.21
fd 10.1.0
github-cli 2.52.0
golang 1.22.5
hadolint 2.12.0
kubectl 1.30.2
lazygit 0.42.0
nodejs 22.3.0
lazygit 0.43.1
neovim system
nodejs 22.4.1
pipx 1.6.0
pre-commit 3.7.1
ripgrep 14.1.0
rust 1.79.0
semgrep system
shellcheck 0.10.0
shfmt 3.8.0
terraform-ls 0.33.3
terraform-lsp 0.0.12
terragrunt 0.62.1
tf-summarize 0.3.10
vault 1.17.0+ent
vault 1.17.2+ent
yamllint 1.35.1
yq 4.44.2
neovim system
asdf-plugin-manager 1.3.1

View File

@@ -37,14 +37,18 @@ have()
# function to run dark-notify and change alacritty theme
# it uses flock to prevent running multiple instances
# install flock with `brew install flock` on macOS
function darknotify-alacritty {
function darknotify_alacritty
{
have flock && [[ -f /tmp/dark-notify-alacritty.lock ]] && return
have dark-notify && {
# true is used to prevent the command show it was backgrounded
true & flock /tmp/dark-notify-alacritty.lock dark-notify -c "$HOME/.dotfiles/local/bin/x-change-alacritty-theme" &
true \
&& flock /tmp/dark-notify-alacritty.lock dark-notify -c "$HOME/.dotfiles/local/bin/x-change-alacritty-theme" &
}
return 0
}
darknotify-alacritty
darknotify_alacritty
brew_installed()
{

View File

@@ -23,7 +23,7 @@ export ANDROID_HOME="$XDG_DATA_HOME/android"
# asdf
# https://github.com/asdf-vm/asdf
export ASDF_DIR="${XDG_DATA_HOME}/asdf"
export ASDF_DIR="${XDG_BIN_HOME}/asdf"
export ASDF_CONFIG_FILE="${XDG_CONFIG_HOME}/asdf/asdfrc"
export ASDF_DATA_DIR="${ASDF_DIR}"
# This seems wrong, but `asdf info` and `versions.bash` differ on path resolution.
@@ -32,6 +32,9 @@ export ASDF_PLUGIN_MANAGER_PLUGIN_VERSIONS_FILENAME="${XDG_CONFIG_HOME}/asdf/plu
export ASDF_LOG_FILE="${XDG_CACHE_HOME}/asdf/asdf.log"
export ASDF_NODEJS_LEGACY_FILE_DYNAMIC_STRATEGY="latest_available"
export ASDF_NPM_DEFAULT_PACKAGES_FILE="${XDG_CONFIG_HOME}/asdf/npm-packages"
export ASDF_GOLANG_MOD_VERSION_ENABLED=true
export ASDF_GOLANG_DEFAULT_PACKAGES_FILE="${XDG_CONFIG_HOME}/asdf/golang-packages"
export ASDF_CRATE_DEFAULT_PACKAGES_FILE="${XDG_CONFIG_HOME}/asdf/cargo-packages"
export PATH="${ASDF_DIR}/bin:${PATH}"
# bob manages nvim versions
@@ -69,13 +72,13 @@ export GOBIN="$XDG_BIN_HOME"
# Herd, herd.laravel.com
# Herd injected PHP binary.
export PATH="$HOME/Library/Application Support/Herd/bin/":$PATH
export PATH="$HOME/Library/Application\ Support/Herd/bin/":$PATH
x-have herd && {
# Herd injected PHP 8.3 configuration.
export HERD_PHP_83_INI_SCAN_DIR="$HOME/Library/Application Support/Herd/config/php/83/"
export HERD_PHP_83_INI_SCAN_DIR="$HOME/Library/Application\ Support/Herd/config/php/83/"
# Herd injected PHP 7.4 configuration.
export HERD_PHP_74_INI_SCAN_DIR="$HOME/Library/Application Support/Herd/config/php/74/"
export HERD_PHP_74_INI_SCAN_DIR="$HOME/Library/Application\ Support/Herd/config/php/74/"
}
# nb, https://xwmx.github.io/nb/

View File

@@ -32,4 +32,4 @@
"NEWS.md": "6077"
},
"version": 6
}
}

View File

@@ -111,9 +111,7 @@
{
"background": "transparent",
"foreground": "lightGreen",
"foreground_templates": [
"{{ if gt .Code 0 }}red{{ end }}"
],
"foreground_templates": ["{{ if gt .Code 0 }}red{{ end }}"],
"properties": {
"always_enabled": true
},
@@ -128,9 +126,7 @@
"transient_prompt": {
"background": "transparent",
"foreground": "lightGreen",
"foreground_templates": [
"{{ if gt .Code 0 }}red{{ end }}"
],
"foreground_templates": ["{{ if gt .Code 0 }}red{{ end }}"],
"template": "\u279c "
},
"version": 2

1
config/shared → config/shared.sh Normal file → Executable file
View File

@@ -21,4 +21,3 @@ export PATH="$XDG_BIN_HOME:$DOTFILES/local/bin:$HOME/.local/go/bin:$XDG_DATA_HOM
source "$DOTFILES/config/exports"
source "$DOTFILES/config/functions"
source "$DOTFILES/config/alias"

53
docs/folders.md Normal file
View File

@@ -0,0 +1,53 @@
# Interesting folders
## XDG
XDG is a set of specifications that provide a standard for the organization
of user-specific files and directories. It is based on the _XDG Base Directory Specification_.
### XDG_BIN_HOME (`$HOME/.local/bin`)
`$XDG_BIN_HOME` defines directory that contains local binaries.
User-specific executable files may be stored in `$HOME/.local/bin`.
Distributions should ensure this directory shows up in the UNIX `$PATH`
environment variable, at an appropriate place.
### XDG_DATA_HOME (`$HOME/.local/share`)
`$XDG_DATA_HOME` defines the base directory relative to which
user-specific _data files_ should be stored.
If `$XDG_DATA_HOME` is either not set or empty,
a default equal to `$HOME/.local/share` should be used.
### XDG_CONFIG_HOME (`$HOME/.config`)
`$XDG_CONFIG_HOME` defines the base directory relative to which
user-specific _configuration files_ should be stored.
If `$XDG_CONFIG_HOME` is either not set or empty,
a default equal to `$HOME/.config` should be used.
### XDG_STATE_HOME (`$HOME/.local/state`)
`$XDG_STATE_HOME` defines the base directory relative to which
user-specific _state files_ should be stored.
If `$XDG_STATE_HOME` is either not set or empty,
a default equal to `$HOME/.local/state` should be used.
The `$XDG_STATE_HOME` contains _state data_ that should
_persist between (application) restarts_, but that is not important or
portable enough to the user that it should be stored in `$XDG_DATA_HOME`.
- It may contain:
- actions history (logs, history, recently used files, …)
- current state of the application that can be reused
on a restart (view, layout, open files, undo history, …)
### XDG_DATA_DIRS
`$XDG_DATA_DIRS` defines the preference-ordered set of base directories
to search for data files in addition to the `$XDG_DATA_HOME` base directory.
The directories in `$XDG_DATA_DIRS` should be separated with a colon ':'.

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

View File

@@ -16,6 +16,8 @@
~/.local/bin:
~/.local/run:
~/.local/share:
~/.local/share/gnupg:
mode: 0700
~/.local/state:
~/.ssh:
mode: 0700

1
local/bin/asdf Submodule

Submodule local/bin/asdf added at ccdd47df9b

View File

@@ -65,12 +65,12 @@ function section_install
$0 install asdf
# $0 install ohmybash
# $0 install pip
$0 install cargo
# $0 install cargo
$0 install composer
# $0 install dotenv
$0 install fzf
# $0 install gh
$0 install go
# $0 install go
$0 install cheat-databases
$0 install imagick
# $0 install neofetch

View File

@@ -2,12 +2,12 @@
# Load our configuration files
# Copyright (c) 2023 Ismo Vuorinen. All Rights Reserved.
set -euo pipefail
# Set verbosity with VERBOSE=1 x-load-configs
# Enable verbosity with VERBOSE=1 x-load-configs
VERBOSE="${VERBOSE:=0}"
# Enable debugging with DEBUG=1 x-load-configs
DEBUG="${DEBUG:=0}"
[ "$VERBOSE" = "1" ] && {
[ "$DEBUG" = "1" ] && {
set -x
}
@@ -37,7 +37,7 @@ loadConfigFiles()
HOST_FILE=$CONFIG_FILE-$HOST
SECRET_HOST=$HOST_FILE-secret
[ "$VERBOSE" = "1" ] && configMsg "?" "$CONFIG_FILE"
[ "$VERBOSE" = "1" ] && configMsg "Looking for" "$CONFIG_FILE"
# global (exports|alias|functions) FILENAME for all hosts
# shellcheck source=../config/exports
@@ -47,19 +47,19 @@ loadConfigFiles()
# global secret FILENAME, git ignored
# shellcheck source=../config/exports-secret
[ "$VERBOSE" = "1" ] && configMsg "?" "$SECRET_FILE"
[ "$VERBOSE" = "1" ] && configMsg "Looking for" "$SECRET_FILE"
[ -r "$SECRET_FILE" ] && {
source "$SECRET_FILE" && [ "$VERBOSE" = "1" ] && configMsg "Found" "$SECRET_FILE"
}
# host specific (exports|alias|functions) FILENAME
# shellcheck source=../config/exports
[ "$VERBOSE" = "1" ] && configMsg "?" "$HOST_FILE"
[ "$VERBOSE" = "1" ] && configMsg "Looking for" "$HOST_FILE"
[ -r "$HOST_FILE" ] && {
source "$HOST_FILE" && [ "$VERBOSE" = "1" ] && configMsg "Found" "$HOST_FILE"
}
# host specific (exports|alias|functions) FILENAME, git ignored
# shellcheck source=../config/exports
[ "$VERBOSE" = "1" ] && configMsg "?" "$SECRET_HOST"
[ "$VERBOSE" = "1" ] && configMsg "Looking for" "$SECRET_HOST"
[ -r "$SECRET_HOST" ] && {
source "$SECRET_HOST" \
&& [ "$VERBOSE" = "1" ] && configMsg "Found" "$SECRET_HOST"

View File

@@ -28,7 +28,8 @@
},
"homepage": "https://github.com/ivuorinen/dotfiles#readme",
"devDependencies": {
"@ivuorinen/base-configs": "^1.1.0"
"@ivuorinen/base-configs": "^1.1.0",
"prettier-plugin-sh": "^0.14.0"
},
"packageManager": "yarn@1.22.22"
}

View File

@@ -2,10 +2,7 @@
# Create file containing key mappings for Neovim
# Usage: ./create-nvim-keymaps.sh
source "$HOME/.dotfiles/scripts/shared.sh"
source "$HOME/.dotfiles/config/exports"
source "$HOME/.dotfiles/config/alias"
source "$HOME/.dotfiles/config/functions"
eval "$HOME/.dotfiles/scripts/shared.sh"
DEST="$HOME/.dotfiles/docs/nvim-keybindings.md"

View File

@@ -1,7 +1,7 @@
#!/usr/bin/env bash
#
# shellcheck source=shared.sh
source "$HOME/.dotfiles/scripts/shared.sh"
eval "$HOME/.dotfiles/scripts/shared.sh"
set -e
cd "$DOTFILES" || exit

View File

@@ -2,28 +2,14 @@
#
# Install asdf
source "${XDG_CONFIG_HOME}/exports"
source "${XDG_CONFIG_HOME}/alias"
source "${XDG_CONFIG_HOME}/functions"
source "${XDG_CONFIG_HOME}/shared.sh"
source "${DOTFILES}/scripts/shared.sh"
# Installation variables
ASDF_GIT="https://github.com/asdf-vm/asdf.git"
ASDF_PATH="${XDG_DATA_HOME}/asdf"
if [ ! -d "$ASDF_PATH" ]; then
git clone --depth 1 "$ASDF_GIT" "$ASDF_PATH" \
--branch v0.14.0
msg_done "asdf ($ASDF_PATH/) installed"
else
msg_done "asdf ($ASDF_PATH/) already installed"
fi
export PATH="${ASDF_PATH}/bin:$PATH"
export ASDF_DIR="${XDG_BIN_HOME}/asdf"
export PATH="${ASDF_DIR}/bin:$PATH"
msg "Sourcing asdf in your shell"
. "$ASDF_PATH/asdf.sh"
. "$ASDF_DIR/asdf.sh"
# Update asdf, and plugins
asdf update
@@ -32,47 +18,47 @@ asdf plugin add asdf-plugin-manager https://github.com/asdf-community/asdf-plugi
asdf install asdf-plugin-manager latest
asdf global asdf-plugin-manager "$(asdf latest asdf-plugin-manager)"
asdf-plugin-manager version
asdf-plugin-manager export > "${ASDF_PLUGIN_MANAGER_PLUGIN_VERSIONS_FILENAME}"
asdf-plugin-manager add-all
asdf install
# ASDF_INSTALLABLES=(
# "nodejs:github.com/asdf-vm/asdf-nodejs.git"
# "1password-cli:github.com/NeoHsu/asdf-1password-cli.git"
# "age:github.com/threkk/asdf-age.git"
# "bottom:github.com/carbonteq/asdf-btm.git"
# "dotenv-linter:github.com/wesleimp/asdf-dotenv-linter.git"
# "editorconfig-checker:github.com/gabitchov/asdf-editorconfig-checker.git"
# "eza:github.com/lwiechec/asdf-eza.git"
# "fd:gitlab.com/wt0f/asdf-fd.git"
# "github-cli:github.com/bartlomiejdanek/asdf-github-cli.git"
# "hadolint:github.com/devlincashman/asdf-hadolint.git"
# "kubectl:github.com/asdf-community/asdf-kubectl.git"
# "lazygit:github.com/nklmilojevic/asdf-lazygit.git"
# "pipx:github.com/yozachar/asdf-pipx.git"
# "pre-commit:github.com/jonathanmorley/asdf-pre-commit.git"
# "ripgrep:gitlab.com/wt0f/asdf-ripgrep.git"
# "semgrep:github.com/brentjanderson/asdf-semgrep.git"
# "terraform-ls:github.com/asdf-community/asdf-hashicorp.git"
# "vault:github.com/asdf-community/asdf-hashicorp.git"
# "shellcheck:github.com/luizm/asdf-shellcheck.git"
# "shfmt:github.com/luizm/asdf-shfmt.git"
# "terraform-lsp:github.com/bartlomiejdanek/asdf-terraform-lsp.git"
# "terragrunt:github.com/ohmer/asdf-terragrunt.git"
# "tf-summarize:github.com/adamcrews/asdf-tf-summarize.git"
# "yamllint:github.com/ericcornelissen/asdf-yamllint.git"
# "yq:github.com/sudermanjr/asdf-yq.git"
# )
#
# msg "Installing asdf plugins, if not already installed"
# for item in "${ASDF_INSTALLABLES[@]}"; do
# CMD=$(echo "${item}" | awk -F ":" '{print $1}')
# URL=$(echo "${item}" | awk -F ":" '{print $2}')
# asdf plugin add "${CMD}" "https://${URL}"
# asdf install "${CMD}" latest
# asdf global "${CMD}" "$(asdf latest "${CMD}")"
# done
ASDF_INSTALLABLES=(
"1password-cli:github.com/NeoHsu/asdf-1password-cli.git"
"age:github.com/threkk/asdf-age.git"
"bottom:github.com/carbonteq/asdf-btm.git"
"dotenv-linter:github.com/wesleimp/asdf-dotenv-linter.git"
"editorconfig-checker:github.com/gabitchov/asdf-editorconfig-checker.git"
"eza:github.com/lwiechec/asdf-eza.git"
"fd:gitlab.com/wt0f/asdf-fd.git"
"github-cli:github.com/bartlomiejdanek/asdf-github-cli.git"
"golang:github.com/asdf-community/asdf-golang.git"
"hadolint:github.com/devlincashman/asdf-hadolint.git"
"kubectl:github.com/asdf-community/asdf-kubectl.git"
"lazygit:github.com/nklmilojevic/asdf-lazygit.git"
"nodejs:github.com/asdf-vm/asdf-nodejs.git"
"pipx:github.com/yozachar/asdf-pipx.git"
"pre-commit:github.com/jonathanmorley/asdf-pre-commit.git"
"ripgrep:gitlab.com/wt0f/asdf-ripgrep.git"
"semgrep:github.com/brentjanderson/asdf-semgrep.git"
"shellcheck:github.com/luizm/asdf-shellcheck.git"
"shfmt:github.com/luizm/asdf-shfmt.git"
"terraform-ls:github.com/asdf-community/asdf-hashicorp.git"
"terraform-lsp:github.com/bartlomiejdanek/asdf-terraform-lsp.git"
"terragrunt:github.com/ohmer/asdf-terragrunt.git"
"tf-summarize:github.com/adamcrews/asdf-tf-summarize.git"
"vault:github.com/asdf-community/asdf-hashicorp.git"
"yamllint:github.com/ericcornelissen/asdf-yamllint.git"
"yq:github.com/sudermanjr/asdf-yq.git"
)
msg "Installing asdf plugins, if not already installed"
for item in "${ASDF_INSTALLABLES[@]}"; do
CMD=$(echo "${item}" | awk -F ":" '{print $1}')
URL=$(echo "${item}" | awk -F ":" '{print $2}')
asdf plugin add "${CMD}" "https://${URL}"
asdf install "${CMD}" latest
asdf global "${CMD}" "$(asdf latest "${CMD}")"
done
msg "Reshim asdf"
asdf reshim

View File

@@ -2,27 +2,12 @@
# Install cargo/rust packages.
#
# shellcheck source=shared.sh
source "$HOME/.dotfiles/config/exports"
source "$HOME/.dotfiles/config/alias"
source "$HOME/.dotfiles/config/functions"
source "$HOME/.dotfiles/scripts/shared.sh"
eval "$HOME/.dotfiles/scripts/shared.sh"
msg "Starting to install rust/cargo packages"
! x-have cargo && {
msg "cargo could not be found. installing cargo with rustup.rs"
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --no-modify-path -y
}
source "$CARGO_HOME/env"
! x-have rustup && {
msg_err "rustup could not be found. Aborting..."
exit 1
}
rustup default stable
# If we have cargo install-update, use it first
x-have cargo-install-update && {
msg_run "Updating cargo packages with cargo install-update"

View File

@@ -1,7 +1,7 @@
#!/usr/bin/env bash
# shellcheck disable=SC2231,SC2034,SC2181,SC2068
# shellcheck source=shared.sh
source "$HOME/.dotfiles/scripts/shared.sh"
eval "$HOME/.dotfiles/scripts/shared.sh"
PBB_REQUIRED_TOOLS=(git cheat)
for t in ${PBB_REQUIRED_TOOLS[@]}; do

View File

@@ -2,7 +2,7 @@
# Install PHP Package Manager Composer
#
# shellcheck source="shared.sh"
source "$HOME/.dotfiles/scripts/shared.sh"
eval "$HOME/.dotfiles/scripts/shared.sh"
! x-have "php" && msg_err "PHP Not Available, cannot install composer" && exit 0

View File

@@ -2,7 +2,7 @@
# Install NerdFonts
#
# shellcheck source="shared.sh"
source "$HOME/.dotfiles/scripts/shared.sh"
eval "$HOME/.dotfiles/scripts/shared.sh"
GIT_REPO="https://github.com/ryanoasis/nerd-fonts.git"
TMP_PATH="$XDG_CACHE_HOME/nerd-fonts"

View File

@@ -3,7 +3,7 @@
# Install fzf
#
# shellcheck source=shared.sh
source "$HOME/.dotfiles/scripts/shared.sh"
eval "$HOME/.dotfiles/scripts/shared.sh"
FZF_GIT="https://github.com/junegunn/fzf.git"
FZF_PATH="${XDG_CONFIG_HOME}/fzf"

View File

@@ -2,7 +2,7 @@
# Install GitHub CLI extensions
#
# shellcheck source="shared.sh"
source "$HOME/.dotfiles/scripts/shared.sh"
eval "$HOME/.dotfiles/scripts/shared.sh"
msg_run "Installing gh (GitHub Client) extensions"

View File

@@ -4,7 +4,7 @@
# NOTE: Experimental, wip
#
# shellcheck source=shared.sh
source "$HOME/.dotfiles/scripts/shared.sh"
eval "$HOME/.dotfiles/scripts/shared.sh"
msg_run "Installing git-crypt"

View File

@@ -2,7 +2,7 @@
# Install Go packages
#
# shellcheck source=shared.sh
source "$HOME/.dotfiles/scripts/shared.sh"
eval "$HOME/.dotfiles/scripts/shared.sh"
msg_run "Installing go packages"
@@ -53,7 +53,7 @@ x-have git-profile && {
x-have antidot && {
antidot update \
&& msg_ok "Updated antidot database"
&& msg_ok "Updated antidot database"
}
echo ""

View File

@@ -3,7 +3,7 @@
# Install neofetch from source
#
# shellcheck source=shared.sh
source "$HOME/.dotfiles/scripts/shared.sh"
eval "$HOME/.dotfiles/scripts/shared.sh"
NEOFETCH_VERSION="7.1.0"
NEOFETCH_REPO="https://github.com/dylanaraps/neofetch"

View File

@@ -2,7 +2,7 @@
# Install npm packages globally.
#
# shellcheck source=shared.sh
source "$HOME/.dotfiles/scripts/shared.sh"
eval "$HOME/.dotfiles/scripts/shared.sh"
msg "Starting to install npm packages"

View File

@@ -3,7 +3,7 @@
# Install ntfy
#
# shellcheck source=shared.sh
source "$HOME/.dotfiles/scripts/shared.sh"
eval "$HOME/.dotfiles/scripts/shared.sh"
set -e
x-have "ntfy" && msg "ntfy already installed" && exit 0

View File

@@ -3,7 +3,7 @@
# Install oh-my-bash
#
# shellcheck source=shared.sh
source "$HOME/.dotfiles/scripts/shared.sh"
eval "$HOME/.dotfiles/scripts/shared.sh"
export OSH="$HOME/.local/share/oh-my-bash"

View File

@@ -3,7 +3,7 @@
# Install oh-my-posh
#
# shellcheck source=shared.sh
source "$HOME/.dotfiles/scripts/shared.sh"
eval "$HOME/.dotfiles/scripts/shared.sh"
curl -s https://ohmyposh.dev/install.sh | bash -s -- -d ~/.local/bin

View File

@@ -2,7 +2,7 @@
# Install python/pip packages.
#
# shellcheck source=shared.sh
source "$HOME/.dotfiles/scripts/shared.sh"
eval "$HOME/.dotfiles/scripts/shared.sh"
msg "Starting to install pip packages"

View File

@@ -3,7 +3,7 @@
# Install z
#
# shellcheck source=shared.sh
source "$HOME/.dotfiles/scripts/shared.sh"
eval "$HOME/.dotfiles/scripts/shared.sh"
Z_GIT_PATH="https://github.com/rupa/z.git"
Z_BIN_PATH="$XDG_BIN_HOME/z"

View File

@@ -9,7 +9,7 @@
[ "$(uname)" != "Darwin" ] && echo "Not a macOS system" && exit 0
# shellcheck source=shared.sh
source "$HOME/.dotfiles/scripts/shared.sh"
eval "$HOME/.dotfiles/scripts/shared.sh"
msg_run "Starting to set macOS defaults, these require sudo privileges:"

View File

@@ -12,21 +12,11 @@
|| [[ -n $BASH_VERSION ]] && (return 0 2> /dev/null)
) && sourced=1 || sourced=0
export DOTFILES="$HOME/.dotfiles"
eval "$HOME/.dotfiles/config/shared.sh"
DOTFILES_CURRENT_SHELL=$(ps -p $$ -oargs=)
export DOTFILES_CURRENT_SHELL
# Explicitly set XDG folders
# https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
export XDG_CONFIG_HOME="$HOME/.config"
export XDG_DATA_HOME="$HOME/.local/share"
export XDG_STATE_HOME="$HOME/.local/state"
# custom variables
export XDG_BIN_HOME="$HOME/.local/bin"
export XDG_CACHE_HOME="$HOME/.cache"
export XDG_RUNTIME_DIR="$HOME/.local/run"
# Other variables
export OHMYPOSH_CFG="$HOME/.dotfiles/config/omp/own.toml"

View File

@@ -3418,6 +3418,11 @@ mute-stream@^1.0.0:
resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-1.0.0.tgz#e31bd9fe62f0aed23520aa4324ea6671531e013e"
integrity sha512-avsJQhyd+680gKXyG/sQc0nXaC6rBkPOfyHYcFb9+hdkqQkR9bdnkJ0AMZhke0oesPqIO+mFFJ+IdBc7mst4IA==
mvdan-sh@^0.10.1:
version "0.10.1"
resolved "https://registry.yarnpkg.com/mvdan-sh/-/mvdan-sh-0.10.1.tgz#5b3a4462a89cf20739b12d851589342c875f4d1f"
integrity sha512-kMbrH0EObaKmK3nVRKUIIya1dpASHIEusM13S4V1ViHFuxuNxCo+arxoa6j/dbV22YBGjl7UKJm9QQKJ2Crzhg==
mz@^2.4.0:
version "2.7.0"
resolved "https://registry.yarnpkg.com/mz/-/mz-2.7.0.tgz#95008057a56cafadc2bc63dde7f9ff6955948e32"
@@ -4008,6 +4013,14 @@ prelude-ls@^1.2.1:
resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396"
integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==
prettier-plugin-sh@^0.14.0:
version "0.14.0"
resolved "https://registry.yarnpkg.com/prettier-plugin-sh/-/prettier-plugin-sh-0.14.0.tgz#22b186adea79b36212ccd9faa8dd01f33ef34ff6"
integrity sha512-hfXulj5+zEl/ulrO5kMuuTPKmXvOg0bnLHY1hKFNN/N+/903iZbNp8NyZBTsgI8dtkSgFfAEIQq0IQTyP1ZVFQ==
dependencies:
mvdan-sh "^0.10.1"
sh-syntax "^0.4.1"
prettier@3.3.2:
version "3.3.2"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.3.2.tgz#03ff86dc7c835f2d2559ee76876a3914cec4a90a"
@@ -4353,6 +4366,13 @@ set-function-name@^2.0.1:
functions-have-names "^1.2.3"
has-property-descriptors "^1.0.2"
sh-syntax@^0.4.1:
version "0.4.2"
resolved "https://registry.yarnpkg.com/sh-syntax/-/sh-syntax-0.4.2.tgz#3bad5c6134b510e7b4c53b16f409ce4fd2a65245"
integrity sha512-/l2UZ5fhGZLVZa16XQM9/Vq/hezGGbdHeVEA01uWjOL1+7Ek/gt6FquW0iKKws4a9AYPYvlz6RyVvjh3JxOteg==
dependencies:
tslib "^2.6.2"
shebang-command@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea"
@@ -4796,6 +4816,11 @@ tsconfig-paths@^3.15.0:
minimist "^1.2.6"
strip-bom "^3.0.0"
tslib@^2.6.2:
version "2.6.3"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.3.tgz#0438f810ad7a9edcde7a241c3d80db693c8cbfe0"
integrity sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==
tuf-js@^2.2.1:
version "2.2.1"
resolved "https://registry.yarnpkg.com/tuf-js/-/tuf-js-2.2.1.tgz#fdd8794b644af1a75c7aaa2b197ddffeb2911b56"