mirror of
https://github.com/ivuorinen/dotfiles.git
synced 2026-01-31 21:42:51 +00:00
Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 9621c67866 | |||
| 5e59893281 | |||
| ea292de853 | |||
| d2cedd0fee | |||
| 995cc569e7 | |||
| cceeba3f8e | |||
| dd3640586e | |||
|
|
11969bf791 | ||
|
|
bb3f4a8f6c |
@@ -11,9 +11,21 @@ trim_trailing_whitespace = true
|
|||||||
[*.lua]
|
[*.lua]
|
||||||
insert_final_newline = true
|
insert_final_newline = true
|
||||||
|
|
||||||
[*.yaml,*.yml]
|
[*.yaml]
|
||||||
indent_size = 2
|
indent_size = 2
|
||||||
insert_final_newline = true
|
insert_final_newline = true
|
||||||
|
|
||||||
[local/bin/antigen.zsh]
|
[*.yml]
|
||||||
ignore = true
|
indent_size = 2
|
||||||
|
insert_final_newline = true
|
||||||
|
|
||||||
|
[*.sh]
|
||||||
|
indent_size = 2
|
||||||
|
indent_style = space
|
||||||
|
insert_final_newline = true
|
||||||
|
shell_variant = bash # --language-variant
|
||||||
|
binary_next_line = true
|
||||||
|
switch_case_indent = true # --case-indent
|
||||||
|
space_redirects = false
|
||||||
|
keep_padding = false
|
||||||
|
function_next_line = true # --func-next-line
|
||||||
|
|||||||
6
.github/workflows/linters.yml
vendored
6
.github/workflows/linters.yml
vendored
@@ -1,30 +1,26 @@
|
|||||||
name: reviewdog
|
name: reviewdog
|
||||||
on: [ push ]
|
on: [push]
|
||||||
jobs:
|
jobs:
|
||||||
linters:
|
linters:
|
||||||
name: Linters
|
name: Linters
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: GitHub Actions
|
- name: GitHub Actions
|
||||||
uses: reviewdog/action-actionlint@v1
|
uses: reviewdog/action-actionlint@v1
|
||||||
with:
|
with:
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
reporter: github-pr-review
|
reporter: github-pr-review
|
||||||
|
|
||||||
- name: detect-secrets
|
- name: detect-secrets
|
||||||
uses: reviewdog/action-detect-secrets@master
|
uses: reviewdog/action-detect-secrets@master
|
||||||
with:
|
with:
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
reporter: github-pr-review
|
reporter: github-pr-review
|
||||||
|
|
||||||
- name: markdownlint
|
- name: markdownlint
|
||||||
uses: reviewdog/action-markdownlint@v0
|
uses: reviewdog/action-markdownlint@v0
|
||||||
with:
|
with:
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
reporter: github-pr-review
|
reporter: github-pr-review
|
||||||
|
|
||||||
- name: shfmt
|
- name: shfmt
|
||||||
uses: reviewdog/action-shfmt@v1
|
uses: reviewdog/action-shfmt@v1
|
||||||
with:
|
with:
|
||||||
|
|||||||
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1,3 +1,6 @@
|
|||||||
Brewfile.lock.json
|
Brewfile.lock.json
|
||||||
*.log
|
*.log
|
||||||
*-secret
|
*-secret
|
||||||
|
.idea
|
||||||
|
.vscode
|
||||||
|
|
||||||
|
|||||||
16
.gitmodules
vendored
16
.gitmodules
vendored
@@ -8,24 +8,14 @@
|
|||||||
url = https://github.com/wren/dotbot-brew.git
|
url = https://github.com/wren/dotbot-brew.git
|
||||||
ignore = dirty
|
ignore = dirty
|
||||||
|
|
||||||
[submodule "dotbot-if"]
|
|
||||||
path = dotbot-if
|
|
||||||
url = https://github.com/wonderbeyond/dotbot-if.git
|
|
||||||
ignore = dirty
|
|
||||||
|
|
||||||
[submodule "dotbot-ifplatform"]
|
|
||||||
path = dotbot-ifplatform
|
|
||||||
url = https://github.com/ssbanerje/dotbot-ifplatform.git
|
|
||||||
ignore = dirty
|
|
||||||
|
|
||||||
[submodule "dotbot-gh-extension"]
|
[submodule "dotbot-gh-extension"]
|
||||||
path = dotbot-gh-extension
|
path = dotbot-gh-extension
|
||||||
url = https://github.com/fundor333/dotbot-gh-extension.git
|
url = https://github.com/fundor333/dotbot-gh-extension.git
|
||||||
ignore = dirty
|
ignore = dirty
|
||||||
|
|
||||||
[submodule "dotbot-golang"]
|
[submodule "dotbot-include"]
|
||||||
path = dotbot-golang
|
path = dotbot-include
|
||||||
url = https://github.com/delicb/dotbot-golang.git
|
url = https://gitlab.com/gnfzdz/dotbot-include.git
|
||||||
ignore = dirty
|
ignore = dirty
|
||||||
|
|
||||||
[submodule "config/nvim"]
|
[submodule "config/nvim"]
|
||||||
|
|||||||
1
.python-version
Normal file
1
.python-version
Normal file
@@ -0,0 +1 @@
|
|||||||
|
3
|
||||||
25
.yamlfmt
Normal file
25
.yamlfmt
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
formatter:
|
||||||
|
type: basic
|
||||||
|
indent: 2
|
||||||
|
retain_line_breaks: false
|
||||||
|
disallow_anchors: false
|
||||||
|
max_line_length: 0
|
||||||
|
scan_folded_as_literal: false
|
||||||
|
indentless_arrays: false
|
||||||
|
|
||||||
|
doublestar: true
|
||||||
|
|
||||||
|
extensions:
|
||||||
|
- yaml
|
||||||
|
- yml
|
||||||
|
|
||||||
|
include:
|
||||||
|
- ./*.{yml,yaml}
|
||||||
|
- ./**/*.{yml,yaml}
|
||||||
|
|
||||||
|
exclude:
|
||||||
|
- ./dotbot/**
|
||||||
|
- ./dotbot-*/**
|
||||||
|
- ./config/astronvim/**
|
||||||
|
- ./config/nvim/**
|
||||||
|
|
||||||
61
Brewfile
61
Brewfile
@@ -10,14 +10,21 @@ tap "homebrew/cask"
|
|||||||
tap "homebrew/cask-fonts"
|
tap "homebrew/cask-fonts"
|
||||||
tap "homebrew/core"
|
tap "homebrew/core"
|
||||||
tap "homebrew/services"
|
tap "homebrew/services"
|
||||||
|
tap "jesseduffield/lazygit"
|
||||||
tap "mongodb/brew"
|
tap "mongodb/brew"
|
||||||
tap "shivammathur/extensions"
|
tap "shivammathur/extensions"
|
||||||
tap "shivammathur/php"
|
tap "shivammathur/php"
|
||||||
tap "teamookla/speedtest"
|
tap "teamookla/speedtest"
|
||||||
|
# Interpreted, interactive, object-oriented programming language
|
||||||
|
brew "python@3.11"
|
||||||
# Automate deployment, configuration, and upgrading
|
# Automate deployment, configuration, and upgrading
|
||||||
brew "ansible"
|
brew "ansible"
|
||||||
|
# Checks ansible playbooks for practices and behaviour
|
||||||
|
brew "ansible-lint"
|
||||||
# Zstandard is a real-time compression algorithm
|
# Zstandard is a real-time compression algorithm
|
||||||
brew "zstd"
|
brew "zstd"
|
||||||
|
# Open Source Kubernetes Marketplace
|
||||||
|
brew "arkade"
|
||||||
# Spell checker with better logic than ispell
|
# Spell checker with better logic than ispell
|
||||||
brew "aspell"
|
brew "aspell"
|
||||||
# Automatic configure script builder
|
# Automatic configure script builder
|
||||||
@@ -26,6 +33,10 @@ brew "autoconf"
|
|||||||
brew "awscli"
|
brew "awscli"
|
||||||
# Terminal bandwidth utilization tool
|
# Terminal bandwidth utilization tool
|
||||||
brew "bandwhich"
|
brew "bandwhich"
|
||||||
|
# Clone of cat(1) with syntax highlighting and Git integration
|
||||||
|
brew "bat"
|
||||||
|
# Yet another cross-platform graphical process/system monitor
|
||||||
|
brew "bottom"
|
||||||
# Switch Apache / Valet / CLI configs between PHP versions
|
# Switch Apache / Valet / CLI configs between PHP versions
|
||||||
brew "brew-php-switcher"
|
brew "brew-php-switcher"
|
||||||
# Core application library for C
|
# Core application library for C
|
||||||
@@ -34,30 +45,22 @@ brew "glib"
|
|||||||
brew "pkg-config"
|
brew "pkg-config"
|
||||||
# Cross-platform make
|
# Cross-platform make
|
||||||
brew "cmake"
|
brew "cmake"
|
||||||
# Open source suite of directory software
|
|
||||||
brew "openldap"
|
|
||||||
# Get a file from an HTTP, HTTPS or FTP server
|
|
||||||
brew "curl"
|
|
||||||
# Libraries to talk to Microsoft SQL Server and Sybase databases
|
|
||||||
brew "freetds"
|
|
||||||
# C/C++ and Java libraries for Unicode and globalization
|
|
||||||
brew "icu4c"
|
|
||||||
# Postgres C API library
|
|
||||||
brew "libpq"
|
|
||||||
# General-purpose scripting language
|
|
||||||
brew "php"
|
|
||||||
# Dependency Manager for PHP
|
|
||||||
brew "composer"
|
|
||||||
# GNU File, Shell, and Text utilities
|
# GNU File, Shell, and Text utilities
|
||||||
brew "coreutils"
|
brew "coreutils"
|
||||||
# Get, unpack, build, and install modules from CPAN
|
# Get, unpack, build, and install modules from CPAN
|
||||||
brew "cpanminus"
|
brew "cpanminus"
|
||||||
|
# Open source suite of directory software
|
||||||
|
brew "openldap"
|
||||||
|
# Get a file from an HTTP, HTTPS or FTP server
|
||||||
|
brew "curl"
|
||||||
# Diff that understands syntax
|
# Diff that understands syntax
|
||||||
brew "difftastic"
|
brew "difftastic"
|
||||||
# Tool for exploring each layer in a docker image
|
# Tool for exploring each layer in a docker image
|
||||||
brew "dive"
|
brew "dive"
|
||||||
# Command-line DNS client
|
# Command-line DNS client
|
||||||
brew "dog"
|
brew "dog"
|
||||||
|
# Lightning-fast linter for .env files written in Rust
|
||||||
|
brew "dotenv-linter"
|
||||||
# Tool to verify that your files are in harmony with your .editorconfig
|
# Tool to verify that your files are in harmony with your .editorconfig
|
||||||
brew "editorconfig-checker"
|
brew "editorconfig-checker"
|
||||||
# Useful examples at the command-line
|
# Useful examples at the command-line
|
||||||
@@ -66,8 +69,12 @@ brew "eg-examples"
|
|||||||
brew "faas-cli"
|
brew "faas-cli"
|
||||||
# Simple, fast and user-friendly alternative to find
|
# Simple, fast and user-friendly alternative to find
|
||||||
brew "fd"
|
brew "fd"
|
||||||
|
# Libraries to talk to Microsoft SQL Server and Sybase databases
|
||||||
|
brew "freetds"
|
||||||
# Monitor a directory for changes and run a shell command
|
# Monitor a directory for changes and run a shell command
|
||||||
brew "fswatch"
|
brew "fswatch"
|
||||||
|
# Disk usage analyzer with console interface written in Go
|
||||||
|
brew "gdu", link: false
|
||||||
# GitHub command-line tool
|
# GitHub command-line tool
|
||||||
brew "gh"
|
brew "gh"
|
||||||
# Distributed revision control system
|
# Distributed revision control system
|
||||||
@@ -92,8 +99,12 @@ brew "gnupg"
|
|||||||
brew "go"
|
brew "go"
|
||||||
# Image manipulation
|
# Image manipulation
|
||||||
brew "netpbm"
|
brew "netpbm"
|
||||||
|
# C/C++ and Java libraries for Unicode and globalization
|
||||||
|
brew "icu4c"
|
||||||
# OpenType text shaping engine
|
# OpenType text shaping engine
|
||||||
brew "harfbuzz"
|
brew "harfbuzz"
|
||||||
|
# Framework for layout and rendering of i18n text
|
||||||
|
brew "pango"
|
||||||
# Library to render SVG files using Cairo
|
# Library to render SVG files using Cairo
|
||||||
brew "librsvg"
|
brew "librsvg"
|
||||||
# Graph visualization software from AT&T and Bell Labs
|
# Graph visualization software from AT&T and Bell Labs
|
||||||
@@ -114,6 +125,8 @@ brew "imagemagick"
|
|||||||
brew "jq"
|
brew "jq"
|
||||||
# Lazier way to manage everything docker
|
# Lazier way to manage everything docker
|
||||||
brew "lazydocker"
|
brew "lazydocker"
|
||||||
|
# Postgres C API library
|
||||||
|
brew "libpq"
|
||||||
# Linguistic software and Finnish dictionary
|
# Linguistic software and Finnish dictionary
|
||||||
brew "libvoikko"
|
brew "libvoikko"
|
||||||
# Package manager for the Lua programming language
|
# Package manager for the Lua programming language
|
||||||
@@ -140,6 +153,14 @@ brew "openapi-generator"
|
|||||||
brew "pandoc"
|
brew "pandoc"
|
||||||
# Highly capable, feature-rich programming language
|
# Highly capable, feature-rich programming language
|
||||||
brew "perl"
|
brew "perl"
|
||||||
|
# General-purpose scripting language
|
||||||
|
brew "php@8.1"
|
||||||
|
# Python version management
|
||||||
|
brew "pyenv"
|
||||||
|
# Migrate pip packages from one Python version to another
|
||||||
|
brew "pyenv-pip-migrate"
|
||||||
|
# Pyenv plugin to manage virtualenv
|
||||||
|
brew "pyenv-virtualenv"
|
||||||
# Interpreted, interactive, object-oriented programming language
|
# Interpreted, interactive, object-oriented programming language
|
||||||
brew "python@3.10"
|
brew "python@3.10"
|
||||||
# Interpreted, interactive, object-oriented programming language
|
# Interpreted, interactive, object-oriented programming language
|
||||||
@@ -168,6 +189,8 @@ brew "terragrunt"
|
|||||||
brew "testssl"
|
brew "testssl"
|
||||||
# Terraform version manager inspired by rbenv
|
# Terraform version manager inspired by rbenv
|
||||||
brew "tfenv"
|
brew "tfenv"
|
||||||
|
# Static analysis security scanner for your terraform code
|
||||||
|
brew "tfsec"
|
||||||
# Programmatically correct mistyped console commands
|
# Programmatically correct mistyped console commands
|
||||||
brew "thefuck"
|
brew "thefuck"
|
||||||
# Simplified and community-driven man pages
|
# Simplified and community-driven man pages
|
||||||
@@ -176,8 +199,12 @@ brew "tldr"
|
|||||||
brew "tmux"
|
brew "tmux"
|
||||||
# Display directories as trees (with optional color/HTML output)
|
# Display directories as trees (with optional color/HTML output)
|
||||||
brew "tree"
|
brew "tree"
|
||||||
|
# Vulnerability scanner for container images, file systems, and Git repos
|
||||||
|
brew "trivy"
|
||||||
# Modern watch command
|
# Modern watch command
|
||||||
brew "viddy"
|
brew "viddy"
|
||||||
|
# Tool for creating isolated virtual python environments
|
||||||
|
brew "virtualenv"
|
||||||
# Command-line interface to the WakaTime api
|
# Command-line interface to the WakaTime api
|
||||||
brew "wakatime-cli"
|
brew "wakatime-cli"
|
||||||
# Executes a program periodically, showing output fullscreen
|
# Executes a program periodically, showing output fullscreen
|
||||||
@@ -188,14 +215,14 @@ brew "wget"
|
|||||||
brew "wtfutil"
|
brew "wtfutil"
|
||||||
# JavaScript package manager
|
# JavaScript package manager
|
||||||
brew "yarn"
|
brew "yarn"
|
||||||
# Tracks most-used directories to make cd smarter
|
|
||||||
brew "z"
|
|
||||||
# A vulnerability scanner for container images and filesystems
|
# A vulnerability scanner for container images and filesystems
|
||||||
brew "anchore/grype/grype"
|
brew "anchore/grype/grype"
|
||||||
# High-performance load testing tool, written in Golang.
|
# High-performance load testing tool, written in Golang.
|
||||||
brew "ddosify/tap/ddosify"
|
brew "ddosify/tap/ddosify"
|
||||||
# lets you quickly switch between multiple git user profiles
|
# lets you quickly switch between multiple git user profiles
|
||||||
brew "gesquive/tap/git-user"
|
brew "gesquive/tap/git-user"
|
||||||
|
# A simple terminal UI for git commands, written in Go
|
||||||
|
brew "jesseduffield/lazygit/lazygit"
|
||||||
# High-performance, schema-free, document-oriented database
|
# High-performance, schema-free, document-oriented database
|
||||||
brew "mongodb/brew/mongodb-community"
|
brew "mongodb/brew/mongodb-community"
|
||||||
# Xdebug PHP extension
|
# Xdebug PHP extension
|
||||||
@@ -246,6 +273,8 @@ cask "insomnia"
|
|||||||
cask "jetbrains-toolbox"
|
cask "jetbrains-toolbox"
|
||||||
# Kubernetes IDE
|
# Kubernetes IDE
|
||||||
cask "lens"
|
cask "lens"
|
||||||
|
# Neovim Client
|
||||||
|
cask "neovide"
|
||||||
# Reverse proxy, secure introspectable tunnels to localhost
|
# Reverse proxy, secure introspectable tunnels to localhost
|
||||||
cask "ngrok"
|
cask "ngrok"
|
||||||
# Collaboration platform for API development
|
# Collaboration platform for API development
|
||||||
|
|||||||
@@ -2,6 +2,4 @@
|
|||||||
|
|
||||||
git submodule add --name dotbot-brew -f https://github.com/wren/dotbot-brew.git dotbot-brew
|
git submodule add --name dotbot-brew -f https://github.com/wren/dotbot-brew.git dotbot-brew
|
||||||
git submodule add --name dotbot-gh-extension -f https://github.com/fundor333/dotbot-gh-extension.git dotbot-gh-extension
|
git submodule add --name dotbot-gh-extension -f https://github.com/fundor333/dotbot-gh-extension.git dotbot-gh-extension
|
||||||
git submodule add --name dotbot-golang -f https://github.com/delicb/dotbot-golang.git dotbot-golang
|
git submodule add --name dotbot-include -f https://gitlab.com/gnfzdz/dotbot-include.git dotbot-include
|
||||||
git submodule add --name dotbot-if -f https://github.com/wonderbeyond/dotbot-if.git dotbot-if
|
|
||||||
git submodule add --name dotbot-ifplatform -f https://github.com/ssbanerje/dotbot-ifplatform.git dotbot-ifplatform
|
|
||||||
|
|||||||
6
base/angular-config.json
Normal file
6
base/angular-config.json
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"version": 1,
|
||||||
|
"cli": {
|
||||||
|
"analytics": false
|
||||||
|
}
|
||||||
|
}
|
||||||
94
base/bashrc
94
base/bashrc
@@ -1,76 +1,9 @@
|
|||||||
|
# this is my bashrc config. there are many like it, but this one is mine.
|
||||||
# shellcheck shell=bash
|
# shellcheck shell=bash
|
||||||
|
|
||||||
# Defaults
|
# Defaults
|
||||||
export DOTFILES="$HOME/.dotfiles"
|
export DOTFILES="$HOME/.dotfiles"
|
||||||
|
|
||||||
# Explicitly set XDG folders
|
|
||||||
# https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
|
|
||||||
export XDG_DATA_HOME="$HOME/.local/share"
|
|
||||||
export XDG_CONFIG_HOME="$HOME/.config"
|
|
||||||
export XDG_STATE_HOME="$HOME/.local/state"
|
|
||||||
export XDG_BIN_HOME="$HOME/.local/bin" # this one is custom
|
|
||||||
|
|
||||||
# Homebrew configuration
|
|
||||||
export HOMEBREW="/opt/homebrew"
|
|
||||||
export HOMEBREW_BIN="$HOMEBREW/bin"
|
|
||||||
export HOMEBREW_SBIN="$HOMEBREW/sbin"
|
|
||||||
export HOMEBREW_PKG="$HOMEBREW/opt"
|
|
||||||
export HOMEBREW_NO_ENV_HINTS=1
|
|
||||||
|
|
||||||
export PATH="$XDG_BIN_HOME:$HOMEBREW_BIN:$HOMEBREW_SBIN:/usr/local/sbin:$PATH"
|
|
||||||
|
|
||||||
# brew, https://brew.sh
|
|
||||||
if command -v brew &> /dev/null; then
|
|
||||||
BREW_BIN=$(brew --prefix)/bin
|
|
||||||
BREW_SBIN=$(brew --prefix)/sbin
|
|
||||||
|
|
||||||
BREW_PYTHON=$(brew --prefix python@3.8)/bin
|
|
||||||
GNUBIN_DIR=$(brew --prefix coreutils)/libexec/gnubin
|
|
||||||
BREW_RUBY=$(brew --prefix ruby)/bin
|
|
||||||
BREW_GEMS=$(gem environment gemdir)/bin
|
|
||||||
|
|
||||||
export PATH="$BREW_PYTHON:$GNUBIN_DIR:$BREW_GEMS:$BREW_RUBY:$BREW_BIN:$BREW_SBIN:$PATH"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# nvm, the node version manager
|
|
||||||
export NVM_LAZY_LOAD=true
|
|
||||||
export NVM_COMPLETION=true
|
|
||||||
export NVM_AUTO_USE=true
|
|
||||||
export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
|
|
||||||
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
|
|
||||||
|
|
||||||
# If we have go packages, include them to the PATH
|
|
||||||
if command -v go &> /dev/null; then
|
|
||||||
export GOPATH=$(go env GOPATH);
|
|
||||||
if [ -d "$GOPATH/bin" ]; then
|
|
||||||
export PATH="$GOPATH/bin:$PATH"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
if command -v nvim &> /dev/null; then
|
|
||||||
export EDITOR="nvim"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# z, https://github.com/rupa/z
|
|
||||||
export _Z_DATA="$XDG_STATE_HOME/z"
|
|
||||||
|
|
||||||
# composer, https://getcomposer.org/
|
|
||||||
if command -v composer &> /dev/null; then
|
|
||||||
export COMPOSER_HOME="$XDG_STATE_HOME/composer"
|
|
||||||
export COMPOSER_BIN="$COMPOSER_HOME/vendor/bin"
|
|
||||||
export PATH="$COMPOSER_BIN:$PATH"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# gem, rubygems
|
|
||||||
if command -v gem &>/dev/null; then
|
|
||||||
export GEM_HOME="$XDG_STATE_HOME/gem"
|
|
||||||
export GEM_PATH="$XDG_STATE_HOME/gem"
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
# wakatime, https://github.com/wakatime/wakatime-cli
|
|
||||||
export WAKATIME_HOME="$XDG_STATE_HOME/wakatime"
|
|
||||||
|
|
||||||
# Run x-load-configs in your terminal to reload the files.
|
# Run x-load-configs in your terminal to reload the files.
|
||||||
function x-load-configs()
|
function x-load-configs()
|
||||||
{
|
{
|
||||||
@@ -86,28 +19,3 @@ x-load-configs
|
|||||||
|
|
||||||
# Import ssh keys in keychain
|
# Import ssh keys in keychain
|
||||||
ssh-add -A 2>/dev/null;
|
ssh-add -A 2>/dev/null;
|
||||||
|
|
||||||
# op (1Password cli) is present
|
|
||||||
if hash op 2>/dev/null; then
|
|
||||||
export OP_CACHE="$XDG_STATE_HOME/1password"
|
|
||||||
mkdir -p "$OP_CACHE";
|
|
||||||
eval "$(op completion zsh)"; compdef _op op
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Ansible configuration
|
|
||||||
# https://docs.ansible.com/ansible/latest/reference_appendices/config.html
|
|
||||||
if hash ansible 2>/dev/null; then
|
|
||||||
export ANSIBLE_HOME="$XDG_STATE_HOME/ansible"
|
|
||||||
mkdir -p "$ANSIBLE_HOME"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# gcloud is present
|
|
||||||
#if hash gcloud 2>/dev/null; then
|
|
||||||
# GCLOUD_LOC=$(gcloud info --format="value(installation.sdk_root)" --quiet)
|
|
||||||
# [[ -f "$GCLOUD_LOC/path.zsh.inc" ]] && builtin source "$GCLOUD_LOC/path.zsh.inc"
|
|
||||||
# [[ -f "$GCLOUD_LOC/completion.zsh.inc" ]] && builtin source "$GCLOUD_LOC/completion.zsh.inc"
|
|
||||||
#fi
|
|
||||||
|
|
||||||
# Load iterm2 shell integration
|
|
||||||
# https://iterm2.com/documentation-shell-integration.html
|
|
||||||
[[ -f "$XDG_BIN_HOME/iterm2_shell_integration.zsh" ]] && source "$XDG_BIN_HOME/iterm2_shell_integration.zsh"
|
|
||||||
|
|||||||
@@ -5,4 +5,3 @@ email = ismo.vuorinen@vincit.fi
|
|||||||
[home]
|
[home]
|
||||||
name = Ismo Vuorinen
|
name = Ismo Vuorinen
|
||||||
email = ismo@vuorinen.net
|
email = ismo@vuorinen.net
|
||||||
|
|
||||||
|
|||||||
153
base/zshrc
153
base/zshrc
@@ -7,161 +7,34 @@ colors
|
|||||||
# Defaults
|
# Defaults
|
||||||
export DOTFILES="$HOME/.dotfiles"
|
export DOTFILES="$HOME/.dotfiles"
|
||||||
|
|
||||||
# Explicitly set XDG folders
|
|
||||||
# https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
|
|
||||||
export XDG_DATA_HOME="$HOME/.local/share"
|
|
||||||
export XDG_CONFIG_HOME="$HOME/.config"
|
|
||||||
export XDG_STATE_HOME="$HOME/.local/state"
|
|
||||||
export XDG_BIN_HOME="$HOME/.local/bin" # this one is custom
|
|
||||||
|
|
||||||
# Homebrew configuration
|
|
||||||
export HOMEBREW="/opt/homebrew"
|
|
||||||
export HOMEBREW_BIN="$HOMEBREW/bin"
|
|
||||||
export HOMEBREW_SBIN="$HOMEBREW/sbin"
|
|
||||||
export HOMEBREW_PKG="$HOMEBREW/opt"
|
|
||||||
export HOMEBREW_NO_ENV_HINTS=1
|
|
||||||
|
|
||||||
export PATH="$XDG_BIN_HOME:$HOMEBREW_BIN:$HOMEBREW_SBIN:/usr/local/sbin:$PATH"
|
|
||||||
|
|
||||||
# brew, https://brew.sh
|
|
||||||
if [ command -v brew &> /dev/null ]; then
|
|
||||||
BREW_BIN=$(brew --prefix)/bin
|
|
||||||
BREW_SBIN=$(brew --prefix)/sbin
|
|
||||||
|
|
||||||
BREW_PYTHON=$(brew --prefix python@3.8)/bin
|
|
||||||
GNUBIN_DIR=$(brew --prefix coreutils)/libexec/gnubin
|
|
||||||
BREW_RUBY=$(brew --prefix ruby)/bin
|
|
||||||
BREW_GEMS=$(gem environment gemdir)/bin
|
|
||||||
|
|
||||||
export PATH="$BREW_PYTHON:$GNUBIN_DIR:$BREW_GEMS:$BREW_RUBY:$BREW_BIN:$BREW_SBIN:$PATH"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# nvm, the node version manager
|
|
||||||
export NVM_LAZY_LOAD=true
|
|
||||||
export NVM_COMPLETION=true
|
|
||||||
export NVM_AUTO_USE=true
|
|
||||||
export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/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
|
|
||||||
|
|
||||||
# If we have go packages, include them to the PATH
|
|
||||||
if command -v go &> /dev/null; then
|
|
||||||
export GOPATH="$XDG_DATA_HOME/go";
|
|
||||||
mkdir -p "$GOPATH"
|
|
||||||
if [ -d "$GOPATH/bin" ]; then
|
|
||||||
export PATH="$GOPATH/bin:$PATH"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
if command -v nvim &> /dev/null; then
|
|
||||||
export EDITOR="nvim"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# z, https://github.com/rupa/z
|
|
||||||
export _Z_DATA="$XDG_STATE_HOME/z"
|
|
||||||
|
|
||||||
# composer, https://getcomposer.org/
|
|
||||||
if command -v composer &> /dev/null; then
|
|
||||||
export COMPOSER_HOME="$XDG_STATE_HOME/composer"
|
|
||||||
export COMPOSER_BIN="$COMPOSER_HOME/vendor/bin"
|
|
||||||
export PATH="$COMPOSER_BIN:$PATH"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# gem, rubygems
|
|
||||||
if command -v gem &>/dev/null; then
|
|
||||||
export GEM_HOME="$XDG_STATE_HOME/gem"
|
|
||||||
export GEM_PATH="$XDG_STATE_HOME/gem"
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
# wakatime, https://github.com/wakatime/wakatime-cli
|
|
||||||
export WAKATIME_HOME="$XDG_STATE_HOME/wakatime"
|
|
||||||
|
|
||||||
# Run x-load-configs in your terminal to reload the files.
|
# Run x-load-configs in your terminal to reload the files.
|
||||||
function x-load-configs()
|
function x-load-configs()
|
||||||
{
|
{
|
||||||
# Load the shell dotfiles, and then some:
|
# Load the shell dotfiles, and then some:
|
||||||
for file in $DOTFILES/config/{exports,alias,functions}; do
|
for file in $DOTFILES/config/{exports,alias,functions}; do
|
||||||
[ -r "$file" ] && [ -f "$file" ] && source "$file"
|
[ -f "$file" ] && source "$file"
|
||||||
[ -r "$file-secret" ] && [ -f "$file-secret" ] && source "$file-secret"
|
[ -f "$file-secret" ] && source "$file-secret"
|
||||||
[ -r "$file-$HOSTNAME" ] && [ -f "$file-$HOSTNAME" ] && source "$file-$HOSTNAME"
|
[ -f "$file-$HOSTNAME" ] && source "$file-$HOSTNAME"
|
||||||
[ -r "$file-$HOSTNAME-secret" ] && [ -f "$file-$HOSTNAME-secret" ] && source "$file-$HOSTNAME-secret"
|
[ -f "$file-$HOSTNAME-secret" ] && source "$file-$HOSTNAME-secret"
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
x-load-configs
|
x-load-configs
|
||||||
|
|
||||||
# Import ssh keys in keychain
|
# Import ssh keys in keychain
|
||||||
ssh-add -A 2>/dev/null;
|
ssh-add -A 2>/dev/null;
|
||||||
|
|
||||||
# Antigen configuration
|
|
||||||
# https://github.com/zsh-users/antigen/wiki/Configuration
|
|
||||||
export ADOTDIR="$XDG_DATA_HOME/antigen"
|
|
||||||
export ANTIGEN_SYSTEM_RECEIPT_F=".local/share/antigen/antigen_system_lastupdate"
|
|
||||||
export ANTIGEN_PLUGIN_RECEIPT_F=".local/share/antigen/antigen_plugin_lastupdate"
|
|
||||||
|
|
||||||
# Try to load antigen, if present
|
# Try to load antigen, if present
|
||||||
[[ -f "$XDG_BIN_HOME/antigen.zsh" ]] && source "$XDG_BIN_HOME/antigen.zsh"
|
ANTIGEN_ZSH_PATH="$XDG_BIN_HOME/antigen.zsh"
|
||||||
|
[[ -f "$ANTIGEN_ZSH_PATH" ]] && source "$ANTIGEN_ZSH_PATH"
|
||||||
|
|
||||||
# antigen is present
|
# antigen is present
|
||||||
if command -v antigen &> /dev/null; then
|
if command -v antigen &> /dev/null; then
|
||||||
antigen use oh-my-zsh
|
antigen use oh-my-zsh
|
||||||
|
|
||||||
antigen bundle ssh-agent
|
# config/functions
|
||||||
antigen bundle colored-man-pages
|
x-default-antigen-bundles
|
||||||
antigen bundle jreese/zsh-titles
|
|
||||||
antigen bundle zsh-users/zsh-syntax-highlighting
|
|
||||||
antigen bundle zsh-users/zsh-completions
|
|
||||||
antigen bundle MichaelAquilina/zsh-you-should-use
|
|
||||||
antigen bundle unixorn/autoupdate-antigen.zshplugin
|
|
||||||
antigen bundle Sparragus/zsh-auto-nvm-use
|
|
||||||
|
|
||||||
hash php 2>/dev/null && antigen bundle php
|
antigen apply
|
||||||
hash nvm 2>/dev/null && antigen bundle nvm
|
|
||||||
hash docker 2>/dev/null && antigen bundle docker
|
|
||||||
hash python 2>/dev/null && antigen bundle MichaelAquilina/zsh-autoswitch-virtualenv
|
|
||||||
hash jq 2>/dev/null && antigen bundle reegnz/jq-zsh-plugin
|
|
||||||
hash docker-compose 2>/dev/null && antigen bundle sroze/docker-compose-zsh-plugin
|
|
||||||
|
|
||||||
# Platform dependant bundles
|
|
||||||
if [[ $(uname) == 'Linux' ]]; then
|
|
||||||
antigen bundle command-not-found
|
|
||||||
elif [[ $(uname) == 'Darwin' ]]; then
|
|
||||||
# If we have brew installed
|
|
||||||
if command -v brew &> /dev/null; then
|
|
||||||
# Only enable brew plugin if brew exists
|
|
||||||
antigen bundle brew
|
|
||||||
# load Z
|
|
||||||
[[ -f "$(brew --prefix z)/etc/profile.d/z.sh" ]] && source "$(brew --prefix z)/etc/profile.d/z.sh"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
antigen apply
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# op (1Password cli) is present
|
|
||||||
if hash op 2>/dev/null; then
|
|
||||||
export OP_CACHE="$XDG_STATE_HOME/1password"
|
|
||||||
mkdir -p $OP_CACHE;
|
|
||||||
eval "$(op completion zsh)"; compdef _op op
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Ansible configuration
|
|
||||||
# https://docs.ansible.com/ansible/latest/reference_appendices/config.html
|
|
||||||
if hash ansible 2>/dev/null; then
|
|
||||||
export ANSIBLE_HOME="$XDG_STATE_HOME/ansible"
|
|
||||||
mkdir -p "$ANSIBLE_HOME"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# gcloud is present
|
|
||||||
#if hash gcloud 2>/dev/null; then
|
|
||||||
# GCLOUD_LOC=$(gcloud info --format="value(installation.sdk_root)" --quiet)
|
|
||||||
# [[ -f "$GCLOUD_LOC/path.zsh.inc" ]] && builtin source "$GCLOUD_LOC/path.zsh.inc"
|
|
||||||
# [[ -f "$GCLOUD_LOC/completion.zsh.inc" ]] && builtin source "$GCLOUD_LOC/completion.zsh.inc"
|
|
||||||
#fi
|
|
||||||
|
|
||||||
# Load iterm2 shell integration
|
|
||||||
# https://iterm2.com/documentation-shell-integration.html
|
|
||||||
[[ -f "$XDG_BIN_HOME/iterm2_shell_integration.zsh" ]] && source "$XDG_BIN_HOME/iterm2_shell_integration.zsh"
|
|
||||||
|
|
||||||
eval "$(starship init zsh)"
|
eval "$(starship init zsh)"
|
||||||
|
|
||||||
|
|||||||
30
config/alias
Normal file → Executable file
30
config/alias
Normal file → Executable file
@@ -1,5 +1,4 @@
|
|||||||
# shellcheck shell=bash
|
#!/usr/bin/env bash
|
||||||
# macOS specific
|
|
||||||
|
|
||||||
# Get installed php versions from brew and setup aliases
|
# Get installed php versions from brew and setup aliases
|
||||||
function x-set-php-aliases
|
function x-set-php-aliases
|
||||||
@@ -26,14 +25,14 @@ function x-set-php-aliases
|
|||||||
# shellcheck disable=SC2139
|
# shellcheck disable=SC2139
|
||||||
alias "${php_alias}"r="$php_exec"
|
alias "${php_alias}"r="$php_exec"
|
||||||
# PHP with error_reporting flag.
|
# PHP with error_reporting flag.
|
||||||
# shellcheck disable=SC2139
|
# shellcheck disable=SC2139,SC2140
|
||||||
alias "$php_alias"="$php_exec $php_error_reporting"
|
alias "$php_alias"="$php_exec $php_error_reporting"
|
||||||
# Local PHP Server.
|
# Local PHP Server.
|
||||||
# shellcheck disable=SC2139
|
# shellcheck disable=SC2139,SC2140
|
||||||
alias "${php_alias}"s="$php_exec -S localhost:9000"
|
alias "${php_alias}s"="$php_exec -S localhost:9000"
|
||||||
# Use composer with specific PHP and error_reporting flag on.
|
# Use composer with specific PHP and error_reporting flag on.
|
||||||
# shellcheck disable=SC2139
|
# shellcheck disable=SC2139,SC2140
|
||||||
alias "${php_alias}"c="$php_exec $php_error_reporting $(which composer)"
|
alias "${php_alias}c"="$php_exec $php_error_reporting $(which composer)"
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
@@ -42,6 +41,7 @@ if [[ $(uname) == 'Darwin' ]]; then
|
|||||||
|
|
||||||
x-set-php-aliases
|
x-set-php-aliases
|
||||||
|
|
||||||
|
# Laravel Sail shortcut
|
||||||
alias sail='[ -f sail ] && bash sail || bash vendor/bin/sail'
|
alias sail='[ -f sail ] && bash sail || bash vendor/bin/sail'
|
||||||
|
|
||||||
# Flush Directory Service cache
|
# Flush Directory Service cache
|
||||||
@@ -60,15 +60,12 @@ alias zapds='find . -name ".DS_Store" -print -delete'
|
|||||||
alias t='tail -f' # tail with follow flag on
|
alias t='tail -f' # tail with follow flag on
|
||||||
alias dn='du -chd1' # directory usage, return only the total
|
alias dn='du -chd1' # directory usage, return only the total
|
||||||
|
|
||||||
alias code_scanner="docker run \
|
alias code_scanner='docker run
|
||||||
--env SOURCE_CODE='${PWD}' \
|
--env SOURCE_CODE="$PWD"
|
||||||
--volume '${PWD}':/code \
|
--volume "${PWD}":/code
|
||||||
--volume /var/run/docker.sock:/var/run/docker.sock \
|
--volume /var/run/docker.sock:/var/run/docker.sock
|
||||||
registry.gitlab.com/gitlab-org/ci-cd/codequality:${CODEQUALITY_VERSION:-latest} \
|
registry.gitlab.com/gitlab-org/ci-cd/codequality:"${CODEQUALITY_VERSION:-latest}"
|
||||||
/code"
|
/code'
|
||||||
|
|
||||||
alias composerUp='composer global update'
|
|
||||||
alias npmUp='npm -g up'
|
|
||||||
|
|
||||||
alias zedit='$EDITOR ~/.dotfiles'
|
alias zedit='$EDITOR ~/.dotfiles'
|
||||||
|
|
||||||
@@ -76,4 +73,3 @@ if [[ -f "$HOME/.aliases.local" ]]; then
|
|||||||
# shellcheck disable=SC1091
|
# shellcheck disable=SC1091
|
||||||
source "$HOME/.aliases.local"
|
source "$HOME/.aliases.local"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
120
config/exports
Normal file → Executable file
120
config/exports
Normal file → Executable file
@@ -1,17 +1,22 @@
|
|||||||
# shellcheck shell=bash
|
# shellcheck shell=bash
|
||||||
|
|
||||||
export HIST_STAMPS="yyyy-mm-dd"
|
# Explicitly set XDG folders
|
||||||
|
# https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
|
||||||
|
export XDG_DATA_HOME="$HOME/.local/share"
|
||||||
|
export XDG_CONFIG_HOME="$HOME/.config"
|
||||||
|
export XDG_STATE_HOME="$HOME/.local/state"
|
||||||
|
export XDG_BIN_HOME="$HOME/.local/bin" # this one is custom
|
||||||
|
|
||||||
|
# History env variables
|
||||||
|
export HIST_STAMPS="yyyy-mm-dd"
|
||||||
# Larger bash history (allow 32³ entries; default is 500)
|
# Larger bash history (allow 32³ entries; default is 500)
|
||||||
export HISTSIZE=32768
|
export HISTSIZE=32768
|
||||||
export HISTFILESIZE=$HISTSIZE
|
export HISTFILESIZE=$HISTSIZE
|
||||||
# don't put duplicate lines or lines starting with space in the history.
|
# don't put duplicate lines or lines starting with space in the history.
|
||||||
# See bash(1) for more options
|
# See bash(1) for more options
|
||||||
export HISTCONTROL=ignoreboth
|
export HISTCONTROL=ignoreboth
|
||||||
|
|
||||||
# Make some commands not show up in history
|
# Make some commands not show up in history
|
||||||
export HISTIGNORE="ls:cd:cd -:pwd:exit:date:* --help"
|
export HISTIGNORE="ls:cd:cd -:pwd:exit:date:* --help"
|
||||||
|
|
||||||
# And include the parameter for ZSH
|
# And include the parameter for ZSH
|
||||||
export HISTORY_IGNORE="(ls|cd|cd -|pwd|exit|date|* --help)"
|
export HISTORY_IGNORE="(ls|cd|cd -|pwd|exit|date|* --help)"
|
||||||
|
|
||||||
@@ -26,6 +31,113 @@ export GREP_OPTIONS="--color=auto"
|
|||||||
|
|
||||||
# check the window size after each command and, if necessary,
|
# check the window size after each command and, if necessary,
|
||||||
# update the values of LINES and COLUMNS.
|
# update the values of LINES and COLUMNS.
|
||||||
shopt -s checkwinsize
|
hash shopt 2> /dev/null && shopt -s checkwinsize
|
||||||
|
|
||||||
|
export LC_ALL=fi_FI.utf8
|
||||||
|
|
||||||
|
# Antigen configuration
|
||||||
|
# https://github.com/zsh-users/antigen/wiki/Configuration
|
||||||
|
export ADOTDIR="$XDG_DATA_HOME/antigen"
|
||||||
|
export ANTIGEN_SYSTEM_RECEIPT_F=".local/share/antigen/antigen_system_lastupdate"
|
||||||
|
export ANTIGEN_PLUGIN_RECEIPT_F=".local/share/antigen/antigen_plugin_lastupdate"
|
||||||
|
|
||||||
|
# Homebrew configuration
|
||||||
|
export HOMEBREW="/opt/homebrew"
|
||||||
|
export HOMEBREW_BIN="$HOMEBREW/bin"
|
||||||
|
export HOMEBREW_SBIN="$HOMEBREW/sbin"
|
||||||
|
export HOMEBREW_PKG="$HOMEBREW/opt"
|
||||||
|
export HOMEBREW_NO_ENV_HINTS=1
|
||||||
|
|
||||||
|
export PATH="$XDG_BIN_HOME:$HOMEBREW_BIN:$HOMEBREW_SBIN:/usr/local/sbin:$PATH"
|
||||||
|
|
||||||
|
# brew, https://brew.sh
|
||||||
|
if command -v brew &> /dev/null; then
|
||||||
|
BREW_PYTHON=$(brew --prefix python)/bin
|
||||||
|
GNUBIN_DIR=$(brew --prefix coreutils)/libexec/gnubin
|
||||||
|
BREW_RUBY=$(brew --prefix ruby)/bin
|
||||||
|
BREW_GEMS=$(gem environment gemdir)/bin
|
||||||
|
|
||||||
|
export PATH="$BREW_PYTHON:$GNUBIN_DIR:$BREW_GEMS:$BREW_RUBY:$PATH"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# nvm, the node version manager
|
||||||
|
export NVM_LAZY_LOAD=true
|
||||||
|
export NVM_COMPLETION=true
|
||||||
|
export NVM_AUTO_USE=true
|
||||||
|
export NVM_DIR="${XDG_CONFIG_HOME}/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
|
||||||
|
|
||||||
|
# If we have go packages, include them to the PATH
|
||||||
|
if command -v go &> /dev/null; then
|
||||||
|
export GOPATH="$XDG_DATA_HOME/go"
|
||||||
|
export GOBIN="$XDG_BIN_HOME"
|
||||||
|
mkdir -p "$GOPATH"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if command -v nvim &> /dev/null; then
|
||||||
|
export EDITOR="nvim"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# docker, https://docs.docker.com/engine/reference/commandline/cli/
|
||||||
|
if command -v docker &> /dev/null; then
|
||||||
|
export DOCKER_CONFIG="$XDG_CONFIG_HOME/docker"
|
||||||
|
mkdir -p "$DOCKER_CONFIG"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# z, https://github.com/rupa/z
|
||||||
|
export _Z_DATA="$XDG_STATE_HOME/z"
|
||||||
|
[[ -f "$XDG_BIN_HOME/z/z.sh" ]] && source "$XDG_BIN_HOME/z/z.sh"
|
||||||
|
|
||||||
|
# composer, https://getcomposer.org/
|
||||||
|
if command -v composer &> /dev/null; then
|
||||||
|
export COMPOSER_HOME="$XDG_STATE_HOME/composer"
|
||||||
|
export COMPOSER_BIN="$COMPOSER_HOME/vendor/bin"
|
||||||
|
export PATH="$COMPOSER_BIN:$PATH"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# gem, rubygems
|
||||||
|
if command -v gem &> /dev/null; then
|
||||||
|
export GEM_HOME="$XDG_STATE_HOME/gem"
|
||||||
|
export GEM_PATH="$XDG_STATE_HOME/gem"
|
||||||
|
export PATH="$GEM_HOME/bin:$PATH"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# pyenv, python environments
|
||||||
|
export PYENV_ROOT="$XDG_STATE_HOME/pyenv"
|
||||||
|
mkdir -p "$PYENV_ROOT"
|
||||||
|
export PATH="$PYENV_ROOT/bin:$PATH"
|
||||||
|
|
||||||
|
if command -v pyenv &> /dev/null; then
|
||||||
|
eval "$(pyenv init -)"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# wakatime, https://github.com/wakatime/wakatime-cli
|
||||||
|
export WAKATIME_HOME="$XDG_STATE_HOME/wakatime"
|
||||||
|
|
||||||
|
# op (1Password cli) is present
|
||||||
|
if hash op 2> /dev/null; then
|
||||||
|
export OP_CACHE="$XDG_STATE_HOME/1password"
|
||||||
|
mkdir -p "$OP_CACHE"
|
||||||
|
eval "$(op completion zsh)"
|
||||||
|
compdef _op op
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Ansible configuration
|
||||||
|
# https://docs.ansible.com/ansible/latest/reference_appendices/config.html
|
||||||
|
if hash ansible 2> /dev/null; then
|
||||||
|
export ANSIBLE_HOME="$XDG_STATE_HOME/ansible"
|
||||||
|
mkdir -p "$ANSIBLE_HOME"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# gcloud is present
|
||||||
|
#if hash gcloud 2>/dev/null; then
|
||||||
|
# GCLOUD_LOC=$(gcloud info --format="value(installation.sdk_root)" --quiet)
|
||||||
|
# [[ -f "$GCLOUD_LOC/path.zsh.inc" ]] && builtin source "$GCLOUD_LOC/path.zsh.inc"
|
||||||
|
# [[ -f "$GCLOUD_LOC/completion.zsh.inc" ]] && builtin source "$GCLOUD_LOC/completion.zsh.inc"
|
||||||
|
#fi
|
||||||
|
|
||||||
|
# Load iterm2 shell integration
|
||||||
|
# https://iterm2.com/documentation-shell-integration.html
|
||||||
|
[[ -f "$XDG_BIN_HOME/iterm2_shell_integration.zsh" ]] \
|
||||||
|
&& source "$XDG_BIN_HOME/iterm2_shell_integration.zsh"
|
||||||
|
|||||||
27
config/functions
Normal file → Executable file
27
config/functions
Normal file → Executable file
@@ -1,4 +1,4 @@
|
|||||||
# shellcheck shell=bash
|
#!/usr/bin/env bash
|
||||||
#
|
#
|
||||||
# shell functions
|
# shell functions
|
||||||
#
|
#
|
||||||
@@ -66,3 +66,28 @@ function silent
|
|||||||
"$@" >&/dev/null
|
"$@" >&/dev/null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Defines default antigen bundles
|
||||||
|
function x-default-antigen-bundles
|
||||||
|
{
|
||||||
|
# these should be always available
|
||||||
|
antigen bundle colored-man-pages
|
||||||
|
antigen bundle command-not-found
|
||||||
|
antigen bundle ssh-agent
|
||||||
|
antigen bundle MichaelAquilina/zsh-you-should-use
|
||||||
|
antigen bundle Sparragus/zsh-auto-nvm-use
|
||||||
|
antigen bundle jreese/zsh-titles
|
||||||
|
antigen bundle unixorn/autoupdate-antigen.zshplugin
|
||||||
|
antigen bundle zsh-users/zsh-completions
|
||||||
|
antigen bundle zsh-users/zsh-syntax-highlighting
|
||||||
|
|
||||||
|
# these should be available if there's need
|
||||||
|
hash git 2> /dev/null && antigen bundle git
|
||||||
|
hash brew 2> /dev/null && antigen bundle brew
|
||||||
|
hash docker 2> /dev/null && antigen bundle docker
|
||||||
|
hash docker-compose 2> /dev/null && antigen bundle sroze/docker-compose-zsh-plugin
|
||||||
|
hash jq 2> /dev/null && antigen bundle reegnz/jq-zsh-plugin
|
||||||
|
hash nvm 2> /dev/null && antigen bundle nvm
|
||||||
|
hash php 2> /dev/null && antigen bundle php
|
||||||
|
hash python 2> /dev/null && antigen bundle MichaelAquilina/zsh-autoswitch-virtualenv
|
||||||
|
hash rvm 2> /dev/null && antigen bundle unixorn/rvm-plugin
|
||||||
|
}
|
||||||
|
|||||||
@@ -2,6 +2,10 @@
|
|||||||
name = Ismo Vuorinen
|
name = Ismo Vuorinen
|
||||||
email = ismo@ivuorinen.net
|
email = ismo@ivuorinen.net
|
||||||
|
|
||||||
|
[credential]
|
||||||
|
helper = store --file ~/.cache/git/git-credentials
|
||||||
|
helper = cache --timeout 30000
|
||||||
|
|
||||||
[core]
|
[core]
|
||||||
excludesfile = ~/.config/git/gitignore
|
excludesfile = ~/.config/git/gitignore
|
||||||
|
|
||||||
|
|||||||
9
config/nvm/default-packages
Normal file
9
config/nvm/default-packages
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
blade-formatter
|
||||||
|
corepack
|
||||||
|
editorconfig-checker
|
||||||
|
github-release-notes
|
||||||
|
js-debug
|
||||||
|
neovim
|
||||||
|
prettier
|
||||||
|
standardjs
|
||||||
|
stylelint-lsp
|
||||||
@@ -4,6 +4,9 @@
|
|||||||
# Inserts a blank line between shell prompts
|
# Inserts a blank line between shell prompts
|
||||||
add_newline = true
|
add_newline = true
|
||||||
|
|
||||||
|
# Timeout for commands executed by starship (in milliseconds).
|
||||||
|
command_timeout = 1000
|
||||||
|
|
||||||
# Replace the '❯' symbol in the prompt with '➜'
|
# Replace the '❯' symbol in the prompt with '➜'
|
||||||
[character] # The name of the module we are configuring is 'character'
|
[character] # The name of the module we are configuring is 'character'
|
||||||
success_symbol = '[➜](bold green)' # The 'success_symbol' segment is being set to '➜' with the color 'bold green'
|
success_symbol = '[➜](bold green)' # The 'success_symbol' segment is being set to '➜' with the color 'bold green'
|
||||||
@@ -32,4 +35,3 @@ version_format = '${major}.${minor}'
|
|||||||
[nodejs]
|
[nodejs]
|
||||||
format = '[$symbol($version )]($style)'
|
format = '[$symbol($version )]($style)'
|
||||||
version_format = '${major}.${minor}'
|
version_format = '${major}.${minor}'
|
||||||
|
|
||||||
|
|||||||
@@ -177,4 +177,4 @@ wtf:
|
|||||||
left: 1
|
left: 1
|
||||||
height: 1
|
height: 1
|
||||||
width: 3
|
width: 3
|
||||||
refreshInterval: 3600
|
refreshInterval: 3600
|
||||||
|
|||||||
Submodule dotbot-golang deleted from 4fa60bd487
Submodule dotbot-if deleted from 2b4dc56943
Submodule dotbot-ifplatform deleted from e35b5c0d71
1
dotbot-include
Submodule
1
dotbot-include
Submodule
Submodule dotbot-include added at 6943c52125
0
hosts/air/base/.gitkeep
Normal file
0
hosts/air/base/.gitkeep
Normal file
0
hosts/air/config/.gitkeep
Normal file
0
hosts/air/config/.gitkeep
Normal file
15
hosts/air/install.conf.yaml
Normal file
15
hosts/air/install.conf.yaml
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
- include: 'hosts/defaults.yaml'
|
||||||
|
- shell:
|
||||||
|
- echo "Configuring air"
|
||||||
|
- brewfile:
|
||||||
|
- Brewfile
|
||||||
|
- link:
|
||||||
|
~/:
|
||||||
|
force: true
|
||||||
|
glob: true
|
||||||
|
path: hosts/air/base/**
|
||||||
|
prefix: "."
|
||||||
|
~/.config/:
|
||||||
|
glob: true
|
||||||
|
force: true
|
||||||
|
path: hosts/air/config/**
|
||||||
9
hosts/defaults.yaml
Normal file
9
hosts/defaults.yaml
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
- defaults:
|
||||||
|
create:
|
||||||
|
mode: 0755
|
||||||
|
link:
|
||||||
|
create: true
|
||||||
|
relink: true
|
||||||
|
exclude: ["*.md", "*renovate*"]
|
||||||
|
shell:
|
||||||
|
stdout: true
|
||||||
0
hosts/lakka/base/.gitkeep
Normal file
0
hosts/lakka/base/.gitkeep
Normal file
50
hosts/lakka/base/zshrc
Normal file
50
hosts/lakka/base/zshrc
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
# Lakka zsh configuration.
|
||||||
|
#
|
||||||
|
# shellcheck shell=bash
|
||||||
|
export PATH="$HOME/bin:/usr/local/bin:/usr/bin:/usr/sbin:$PATH"
|
||||||
|
|
||||||
|
# Defaults
|
||||||
|
export DOTFILES="$HOME/.dotfiles"
|
||||||
|
|
||||||
|
# Run x-load-configs in your terminal to reload the files.
|
||||||
|
function x-load-configs()
|
||||||
|
{
|
||||||
|
# Load the shell dotfiles, and then some:
|
||||||
|
for file in $DOTFILES/config/{exports,alias,functions}; do
|
||||||
|
[ -r "$file" ] && [ -f "$file" ] && source "$file"
|
||||||
|
[ -r "$file-secret" ] && [ -f "$file-secret" ] && source "$file-secret"
|
||||||
|
[ -r "$file-$HOSTNAME" ] && [ -f "$file-$HOSTNAME" ] && source "$file-$HOSTNAME"
|
||||||
|
[ -r "$file-$HOSTNAME-secret" ] && [ -f "$file-$HOSTNAME-secret" ] && source "$file-$HOSTNAME-secret"
|
||||||
|
done
|
||||||
|
}
|
||||||
|
x-load-configs
|
||||||
|
|
||||||
|
export PATH="$XDG_BIN_HOME:$PATH"
|
||||||
|
export LC_ALL=fi_FI.utf8
|
||||||
|
|
||||||
|
export RVM_PATH="$HOME/.rvm"
|
||||||
|
export PATH="$RVM_PATH/bin:$PATH"
|
||||||
|
[[ -s "$RVM_PATH/scripts/rvm" ]] && source "$RVM_PATH/scripts/rvm" # Load RVM into a shell session *as a function*
|
||||||
|
|
||||||
|
# Try to load antigen, if present
|
||||||
|
ANTIGEN_ZSH_PATH="$XDG_BIN_HOME/antigen.zsh"
|
||||||
|
[[ -f "$ANTIGEN_ZSH_PATH" ]] && source "$ANTIGEN_ZSH_PATH"
|
||||||
|
|
||||||
|
# If antigen was loaded
|
||||||
|
if command -v antigen &> /dev/null; then
|
||||||
|
antigen use oh-my-zsh
|
||||||
|
|
||||||
|
# config/functions
|
||||||
|
x-default-antigen-bundles
|
||||||
|
|
||||||
|
antigen theme oskarkrawczyk/honukai-iterm-zsh honukai
|
||||||
|
|
||||||
|
antigen apply
|
||||||
|
fi
|
||||||
|
|
||||||
|
alias logrotate='/usr/sbin/logrotate -s $HOME/logs/state'
|
||||||
|
alias nano='nano -wS -$'
|
||||||
|
alias gpg=gpg2
|
||||||
|
|
||||||
|
ACME_PATH="$HOME/.acme.sh"
|
||||||
|
[[ -s "$ACME_PATH/acme.sh.env" ]] && . "$ACME_PATH/acme.sh.env"
|
||||||
0
hosts/lakka/config/.gitkeep
Normal file
0
hosts/lakka/config/.gitkeep
Normal file
17
hosts/lakka/install.conf.yaml
Normal file
17
hosts/lakka/install.conf.yaml
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
- include: 'hosts/defaults.yaml'
|
||||||
|
- shell:
|
||||||
|
- echo "Configuring lakka"
|
||||||
|
- link:
|
||||||
|
~/:
|
||||||
|
force: true
|
||||||
|
glob: true
|
||||||
|
path: hosts/lakka/base/**
|
||||||
|
prefix: "."
|
||||||
|
~/.config/:
|
||||||
|
glob: true
|
||||||
|
force: true
|
||||||
|
path: hosts/lakka/config/**
|
||||||
|
~/.irssi/:
|
||||||
|
glob: true
|
||||||
|
force: true
|
||||||
|
path: hosts/lakka/irssi/**
|
||||||
@@ -1,72 +0,0 @@
|
|||||||
# Lakka zsh configuration.
|
|
||||||
#
|
|
||||||
# shellcheck shell=bash
|
|
||||||
export PATH="/usr/local/bin:/usr/bin:/usr/sbin:$PATH"
|
|
||||||
|
|
||||||
# Defaults
|
|
||||||
export DOTFILES="$HOME/.dotfiles"
|
|
||||||
|
|
||||||
# Explicitly set XDG folders
|
|
||||||
# https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
|
|
||||||
export XDG_DATA_HOME="$HOME/.local/share"
|
|
||||||
export XDG_CONFIG_HOME="$HOME/.config"
|
|
||||||
export XDG_STATE_HOME="$HOME/.local/state"
|
|
||||||
export XDG_BIN_HOME="$HOME/.local/bin" # this one is custom
|
|
||||||
|
|
||||||
# z, https://github.com/rupa/z
|
|
||||||
export _Z_DATA="$XDG_STATE_HOME/z"
|
|
||||||
|
|
||||||
# composer, https://getcomposer.org/
|
|
||||||
if command -v composer &> /dev/null; then
|
|
||||||
export COMPOSER_HOME="$XDG_STATE_HOME/composer"
|
|
||||||
export COMPOSER_BIN="$COMPOSER_HOME/vendor/bin"
|
|
||||||
export PATH="$COMPOSER_BIN:$PATH"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# gem, rubygems
|
|
||||||
if command -v gem &>/dev/null; then
|
|
||||||
export GEM_HOME="$XDG_STATE_HOME/gem"
|
|
||||||
export PATH="$GEM_HOME/bin:$PATH"
|
|
||||||
fi
|
|
||||||
|
|
||||||
export PATH="$XDG_BIN_HOME:$HOME/bin:$HOME/.rvm/bin:$PATH"
|
|
||||||
export LC_ALL=fi_FI.utf8
|
|
||||||
|
|
||||||
# Antigen configuration
|
|
||||||
# https://github.com/zsh-users/antigen/wiki/Configuration
|
|
||||||
export ADOTDIR="$XDG_DATA_HOME/antigen"
|
|
||||||
export ANTIGEN_SYSTEM_RECEIPT_F=".local/share/antigen/antigen_system_lastupdate"
|
|
||||||
export ANTIGEN_PLUGIN_RECEIPT_F=".local/share/antigen/antigen_plugin_lastupdate"
|
|
||||||
|
|
||||||
# Try to load antigen, if present
|
|
||||||
[[ -f "$XDG_BIN_HOME/antigen.zsh" ]] && source "$XDG_BIN_HOME/antigen.zsh"
|
|
||||||
|
|
||||||
# If antigen was loaded
|
|
||||||
if command -v antigen &> /dev/null; then
|
|
||||||
antigen use oh-my-zsh
|
|
||||||
|
|
||||||
hash git 2>/dev/null && antigen bundle git
|
|
||||||
hash php 2>/dev/null && antigen bundle php
|
|
||||||
|
|
||||||
antigen bundle autojump
|
|
||||||
antigen bundle command-not-found
|
|
||||||
antigen bundle jreese/zsh-titles
|
|
||||||
antigen bundle zsh-users/zsh-syntax-highlighting
|
|
||||||
antigen bundle zsh-users/zsh-completions
|
|
||||||
antigen bundle unixorn/rvm-plugin
|
|
||||||
antigen bundle unixorn/autoupdate-antigen.zshplugin
|
|
||||||
|
|
||||||
antigen theme oskarkrawczyk/honukai-iterm-zsh honukai
|
|
||||||
|
|
||||||
antigen apply
|
|
||||||
fi
|
|
||||||
|
|
||||||
alias t='tail -f'
|
|
||||||
alias logrotate='/usr/sbin/logrotate -s $HOME/logs/state'
|
|
||||||
alias dn='du -chd1'
|
|
||||||
alias nano='nano -wS -$'
|
|
||||||
alias gpg=gpg2
|
|
||||||
|
|
||||||
export PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scripting
|
|
||||||
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" ]] # Load RVM into a shell session *as a function*
|
|
||||||
. "$HOME/.acme.sh/acme.sh.env"
|
|
||||||
0
hosts/tunkki/base/.gitkeep
Normal file
0
hosts/tunkki/base/.gitkeep
Normal file
@@ -1,118 +0,0 @@
|
|||||||
# ~/.bashrc: executed by bash(1) for non-login shells.
|
|
||||||
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
|
|
||||||
# for examples
|
|
||||||
|
|
||||||
# If not running interactively, don't do anything
|
|
||||||
case $- in
|
|
||||||
*i*) ;;
|
|
||||||
*) return;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# don't put duplicate lines or lines starting with space in the history.
|
|
||||||
# See bash(1) for more options
|
|
||||||
HISTCONTROL=ignoreboth
|
|
||||||
|
|
||||||
# append to the history file, don't overwrite it
|
|
||||||
shopt -s histappend
|
|
||||||
|
|
||||||
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
|
|
||||||
HISTSIZE=1000
|
|
||||||
HISTFILESIZE=2000
|
|
||||||
|
|
||||||
# check the window size after each command and, if necessary,
|
|
||||||
# update the values of LINES and COLUMNS.
|
|
||||||
shopt -s checkwinsize
|
|
||||||
|
|
||||||
# If set, the pattern "**" used in a pathname expansion context will
|
|
||||||
# match all files and zero or more directories and subdirectories.
|
|
||||||
#shopt -s globstar
|
|
||||||
|
|
||||||
# make less more friendly for non-text input files, see lesspipe(1)
|
|
||||||
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
|
|
||||||
|
|
||||||
# set variable identifying the chroot you work in (used in the prompt below)
|
|
||||||
if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
|
|
||||||
debian_chroot=$(cat /etc/debian_chroot)
|
|
||||||
fi
|
|
||||||
|
|
||||||
# set a fancy prompt (non-color, unless we know we "want" color)
|
|
||||||
case "$TERM" in
|
|
||||||
xterm-color|*-256color) color_prompt=yes;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# uncomment for a colored prompt, if the terminal has the capability; turned
|
|
||||||
# off by default to not distract the user: the focus in a terminal window
|
|
||||||
# should be on the output of commands, not on the prompt
|
|
||||||
#force_color_prompt=yes
|
|
||||||
|
|
||||||
if [ -n "$force_color_prompt" ]; then
|
|
||||||
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
|
|
||||||
# We have color support; assume it's compliant with Ecma-48
|
|
||||||
# (ISO/IEC-6429). (Lack of such support is extremely rare, and such
|
|
||||||
# a case would tend to support setf rather than setaf.)
|
|
||||||
color_prompt=yes
|
|
||||||
else
|
|
||||||
color_prompt=
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$color_prompt" = yes ]; then
|
|
||||||
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
|
|
||||||
else
|
|
||||||
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
|
|
||||||
fi
|
|
||||||
unset color_prompt force_color_prompt
|
|
||||||
|
|
||||||
# If this is an xterm set the title to user@host:dir
|
|
||||||
case "$TERM" in
|
|
||||||
xterm*|rxvt*)
|
|
||||||
PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# enable color support of ls and also add handy aliases
|
|
||||||
if [ -x /usr/bin/dircolors ]; then
|
|
||||||
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
|
|
||||||
alias ls='ls --color=auto'
|
|
||||||
#alias dir='dir --color=auto'
|
|
||||||
#alias vdir='vdir --color=auto'
|
|
||||||
|
|
||||||
alias grep='grep --color=auto'
|
|
||||||
alias fgrep='fgrep --color=auto'
|
|
||||||
alias egrep='egrep --color=auto'
|
|
||||||
fi
|
|
||||||
|
|
||||||
# colored GCC warnings and errors
|
|
||||||
#export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'
|
|
||||||
|
|
||||||
# some more ls aliases
|
|
||||||
alias ll='ls -alF'
|
|
||||||
alias la='ls -A'
|
|
||||||
alias l='ls -CF'
|
|
||||||
|
|
||||||
# Add an "alert" alias for long running commands. Use like so:
|
|
||||||
# sleep 10; alert
|
|
||||||
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
|
|
||||||
|
|
||||||
# Alias definitions.
|
|
||||||
# You may want to put all your additions into a separate file like
|
|
||||||
# ~/.bash_aliases, instead of adding them here directly.
|
|
||||||
# See /usr/share/doc/bash-doc/examples in the bash-doc package.
|
|
||||||
|
|
||||||
if [ -f ~/.bash_aliases ]; then
|
|
||||||
. ~/.bash_aliases
|
|
||||||
fi
|
|
||||||
|
|
||||||
# enable programmable completion features (you don't need to enable
|
|
||||||
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
|
|
||||||
# sources /etc/bash.bashrc).
|
|
||||||
if ! shopt -oq posix; then
|
|
||||||
if [ -f /usr/share/bash-completion/bash_completion ]; then
|
|
||||||
. /usr/share/bash-completion/bash_completion
|
|
||||||
elif [ -f /etc/bash_completion ]; then
|
|
||||||
. /etc/bash_completion
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
0
hosts/tunkki/config/.gitkeep
Normal file
0
hosts/tunkki/config/.gitkeep
Normal file
13
hosts/tunkki/install.conf.yaml
Normal file
13
hosts/tunkki/install.conf.yaml
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
- include: 'hosts/defaults.yaml'
|
||||||
|
- shell:
|
||||||
|
- echo "Configuring tunkki"
|
||||||
|
- link:
|
||||||
|
~/:
|
||||||
|
force: true
|
||||||
|
glob: true
|
||||||
|
path: hosts/tunkki/base/**
|
||||||
|
prefix: "."
|
||||||
|
~/.config/:
|
||||||
|
glob: true
|
||||||
|
force: true
|
||||||
|
path: hosts/tunkki/config/**
|
||||||
0
hosts/v/base/.gitkeep
Normal file
0
hosts/v/base/.gitkeep
Normal file
0
hosts/v/config/.gitkeep
Normal file
0
hosts/v/config/.gitkeep
Normal file
15
hosts/v/install.conf.yaml
Normal file
15
hosts/v/install.conf.yaml
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
- include: 'hosts/defaults.yaml'
|
||||||
|
- shell:
|
||||||
|
- echo "Configuring v"
|
||||||
|
- brewfile:
|
||||||
|
- Brewfile
|
||||||
|
- link:
|
||||||
|
~/:
|
||||||
|
force: true
|
||||||
|
glob: true
|
||||||
|
path: hosts/v/base/**
|
||||||
|
prefix: "."
|
||||||
|
~/.config/:
|
||||||
|
glob: true
|
||||||
|
force: true
|
||||||
|
path: hosts/v/config/**
|
||||||
22
install
22
install
@@ -7,17 +7,31 @@ DOTBOT_DIR="dotbot"
|
|||||||
|
|
||||||
DOTBOT_BIN="bin/dotbot"
|
DOTBOT_BIN="bin/dotbot"
|
||||||
BASEDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
BASEDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||||
|
DOTBOT_BIN_PATH="${BASEDIR}/${DOTBOT_DIR}/${DOTBOT_BIN}"
|
||||||
|
DOTBOT_HOST="$(hostname -s)" || ''
|
||||||
|
|
||||||
cd "$BASEDIR"
|
cd "$BASEDIR"
|
||||||
git submodule sync --quiet --recursive
|
git submodule sync --quiet --recursive
|
||||||
git submodule update --init --recursive
|
git submodule update --init --recursive
|
||||||
|
|
||||||
"${BASEDIR}/${DOTBOT_DIR}/${DOTBOT_BIN}" \
|
"${DOTBOT_BIN_PATH}" \
|
||||||
-d "${BASEDIR}" \
|
-d "${BASEDIR}" \
|
||||||
--plugin-dir=dotbot-brew \
|
--plugin-dir=dotbot-brew \
|
||||||
--plugin-dir=dotbot-gh-extension \
|
--plugin-dir=dotbot-gh-extension \
|
||||||
--plugin-dir=dotbot-golang \
|
--plugin-dir=dotbot-include \
|
||||||
--plugin-dir=dotbot-if \
|
|
||||||
--plugin-dir=dotbot-ifplatform \
|
|
||||||
-c "${CONFIG}" \
|
-c "${CONFIG}" \
|
||||||
"${@}"
|
"${@}"
|
||||||
|
|
||||||
|
if [ "${DOTBOT_HOST}" != "" ]; then
|
||||||
|
DOTBOT_HOST_CONFIG="${BASEDIR}/hosts/${DOTBOT_HOST}/${CONFIG}"
|
||||||
|
echo "-> Trying if host config can be found: ${DOTBOT_HOST_CONFIG}"
|
||||||
|
[ -r "$DOTBOT_HOST_CONFIG" ] && [ -f "$DOTBOT_HOST_CONFIG" ] \
|
||||||
|
&& echo "(!) Found $DOTBOT_HOST_CONFIG" \
|
||||||
|
&& "$DOTBOT_BIN_PATH" \
|
||||||
|
-d "$BASEDIR" \
|
||||||
|
--plugin-dir=dotbot-brew \
|
||||||
|
--plugin-dir=dotbot-gh-extension \
|
||||||
|
--plugin-dir=dotbot-include \
|
||||||
|
-c "$DOTBOT_HOST_CONFIG" \
|
||||||
|
"${@}"
|
||||||
|
fi
|
||||||
|
|||||||
@@ -7,20 +7,27 @@ DOTBOT_DIR="dotbot"
|
|||||||
|
|
||||||
DOTBOT_BIN="bin/dotbot"
|
DOTBOT_BIN="bin/dotbot"
|
||||||
BASEDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
BASEDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||||
|
DOTBOT_HOST="$(hostname -s)" || ''
|
||||||
|
DOTBOT_BIN_PATH="${BASEDIR}/${DOTBOT_DIR}/${DOTBOT_BIN}"
|
||||||
|
|
||||||
cd "$BASEDIR"
|
cd "$BASEDIR"
|
||||||
git submodule sync --quiet --recursive
|
git submodule sync --quiet --recursive
|
||||||
git submodule update --init --recursive
|
git submodule update --init --recursive
|
||||||
|
|
||||||
"${BASEDIR}/${DOTBOT_DIR}/${DOTBOT_BIN}" \
|
"${DOTBOT_BIN_PATH}" \
|
||||||
-d "${BASEDIR}" \
|
-d "${BASEDIR}" \
|
||||||
|
--plugin-dir=dotbot-include \
|
||||||
-c "${CONFIG}" \
|
-c "${CONFIG}" \
|
||||||
"${@}"
|
"${@}"
|
||||||
|
|
||||||
# --plugin-dir=dotbot-plugins/dotbot-brew \
|
if [ "${DOTBOT_HOST}" != "" ]; then
|
||||||
# --plugin-dir=dotbot-plugins/dotbot-gh-extension \
|
DOTBOT_HOST_CONFIG="${BASEDIR}/hosts/${DOTBOT_HOST}/${CONFIG}"
|
||||||
# --plugin-dir=dotbot-plugins/dotbot-golang \
|
echo "-> Trying if host config can be found: ${DOTBOT_HOST_CONFIG}"
|
||||||
# --plugin-dir=dotbot-plugins/dotbot-if \
|
[ -r "$DOTBOT_HOST_CONFIG" ] && [ -f "$DOTBOT_HOST_CONFIG" ] \
|
||||||
# --plugin-dir=dotbot-plugins/dotbot-ifplatform \
|
&& echo "(!) Found $DOTBOT_HOST_CONFIG" \
|
||||||
# -p dotbot-plugins/dotbot-if/if.py \
|
&& "$DOTBOT_BIN_PATH" \
|
||||||
|
-d "$BASEDIR" \
|
||||||
|
--plugin-dir=dotbot-include \
|
||||||
|
-c "$DOTBOT_HOST_CONFIG" \
|
||||||
|
"${@}"
|
||||||
|
fi
|
||||||
|
|||||||
@@ -1,100 +1,40 @@
|
|||||||
---
|
- include: 'hosts/defaults.yaml'
|
||||||
- defaults:
|
|
||||||
brewfile:
|
|
||||||
stderr: true
|
|
||||||
stdout: true
|
|
||||||
create:
|
|
||||||
mode: 755
|
|
||||||
link:
|
|
||||||
create: true
|
|
||||||
relink: true
|
|
||||||
|
|
||||||
- clean:
|
- clean:
|
||||||
~/:
|
~/:
|
||||||
~/.config:
|
~/.config:
|
||||||
recursive: true
|
recursive: true
|
||||||
~/.local:
|
~/.local:
|
||||||
recursive: true
|
recursive: true
|
||||||
|
|
||||||
- create:
|
- create:
|
||||||
|
~/.cache:
|
||||||
|
~/.cache/git:
|
||||||
~/.config:
|
~/.config:
|
||||||
~/.local:
|
~/.local:
|
||||||
~/.local/share:
|
~/.local/share:
|
||||||
~/.local/state:
|
~/.local/state:
|
||||||
~/.ssh:
|
~/.ssh:
|
||||||
mode: 700
|
mode: 0700
|
||||||
~/Code:
|
~/Code:
|
||||||
|
|
||||||
- link:
|
- link:
|
||||||
~/.config/:
|
|
||||||
glob: true
|
|
||||||
path: config/*
|
|
||||||
~/.local/bin/:
|
|
||||||
glob: true
|
|
||||||
path: local/bin/*
|
|
||||||
~/.ssh/:
|
|
||||||
force: true
|
|
||||||
glob: true
|
|
||||||
mode: 600
|
|
||||||
path: ssh/*
|
|
||||||
~/:
|
~/:
|
||||||
force: true
|
force: true
|
||||||
glob: true
|
glob: true
|
||||||
path: base/*
|
path: base/**
|
||||||
prefix: "."
|
prefix: "."
|
||||||
|
~/.config/:
|
||||||
|
glob: true
|
||||||
|
path: config/**
|
||||||
|
~/.local/bin/:
|
||||||
|
glob: true
|
||||||
|
path: local/bin/**
|
||||||
|
~/.ssh/:
|
||||||
|
force: true
|
||||||
|
glob: true
|
||||||
|
mode: 0600
|
||||||
|
path: ssh/**
|
||||||
- shell:
|
- shell:
|
||||||
- [git submodule update --init --recursive --force]
|
- git submodule update --init --recursive --force
|
||||||
- [bash scripts/install-npm-packages.sh]
|
- bash local/bin/dfm install all
|
||||||
|
|
||||||
- ifmacos:
|
|
||||||
- shell:
|
|
||||||
- [bash scripts/set-macos-defaults.sh]
|
|
||||||
- brewfile:
|
|
||||||
- Brewfile
|
|
||||||
|
|
||||||
# hosts: air
|
|
||||||
- if:
|
|
||||||
- cond: "[[ $(hostname) = air ]]"
|
|
||||||
met:
|
|
||||||
- go:
|
|
||||||
- github.com/skx/sysbox@latest
|
|
||||||
- github.com/dotzero/git-profile
|
|
||||||
|
|
||||||
# hosts: v
|
|
||||||
- if:
|
|
||||||
- cond: "[[ $(hostname) = v ]]"
|
|
||||||
met:
|
|
||||||
- link:
|
|
||||||
~/.config/:
|
|
||||||
glob: true
|
|
||||||
force: true
|
|
||||||
path: hosts/v/config/**
|
|
||||||
- go:
|
|
||||||
- github.com/skx/sysbox@latest
|
|
||||||
- github.com/dotzero/git-profile
|
|
||||||
|
|
||||||
# hosts tunkki
|
|
||||||
- if:
|
|
||||||
- cond: "[[ $(hostname) = tunkki ]]"
|
|
||||||
met:
|
|
||||||
- go:
|
|
||||||
- github.com/skx/sysbox@latest
|
|
||||||
- github.com/dotzero/git-profile
|
|
||||||
|
|
||||||
# hosts: lakka
|
|
||||||
- if:
|
|
||||||
- cond: "[[ $(hostname) = lakka ]]"
|
|
||||||
met:
|
|
||||||
- link:
|
|
||||||
~/.irssi/*:
|
|
||||||
force: true
|
|
||||||
glob: true
|
|
||||||
path: hosts/lakka/irssi/**
|
|
||||||
~/.zshrc:
|
|
||||||
force: true
|
|
||||||
path: hosts/lakka/zshrc
|
|
||||||
|
|
||||||
# GitHub CLI Extensions
|
# GitHub CLI Extensions
|
||||||
- ghe:
|
- ghe:
|
||||||
# GitHub CLI extension for generating a report on repository dependencies.
|
# GitHub CLI extension for generating a report on repository dependencies.
|
||||||
@@ -114,4 +54,5 @@
|
|||||||
# being an extension to view the overall health of
|
# being an extension to view the overall health of
|
||||||
# an organization's use of actions
|
# an organization's use of actions
|
||||||
- rsese/gh-actions-status
|
- rsese/gh-actions-status
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|||||||
@@ -24,38 +24,61 @@ function section_install
|
|||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
all)
|
all)
|
||||||
|
$0 install macos
|
||||||
$0 install antigen
|
$0 install antigen
|
||||||
$0 install starship
|
$0 install starship
|
||||||
|
$0 brew install
|
||||||
|
$0 install composer
|
||||||
$0 install nvm
|
$0 install nvm
|
||||||
$0 install macos
|
|
||||||
$0 install npm
|
$0 install npm
|
||||||
|
$0 install ntfy
|
||||||
|
$0 install z
|
||||||
;;
|
;;
|
||||||
antigen)
|
antigen)
|
||||||
curl -L git.io/antigen > "$DOTFILES/local/bin/antigen.zsh" && msg_done "🎉 New antigen installed!"
|
curl -L git.io/antigen > "$DOTFILES/local/bin/antigen.zsh" \
|
||||||
|
&& msg_done "🎉 New antigen installed!"
|
||||||
|
;;
|
||||||
|
composer)
|
||||||
|
bash "$DOTFILES/scripts/install-composer.sh" \
|
||||||
|
&& msg_done "🎉 composer installed!"
|
||||||
;;
|
;;
|
||||||
starship)
|
starship)
|
||||||
curl -sS https://starship.rs/install.sh | sh -s -- --bin-dir ~/.local/bin && msg_done "🎉 starship installed!"
|
curl -sS https://starship.rs/install.sh | sh -s -- --bin-dir ~/.local/bin \
|
||||||
;;
|
&& msg_done "🎉 starship installed!"
|
||||||
nvm)
|
|
||||||
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash && msg_done " ^=^n^i nvm installed!"
|
|
||||||
;;
|
;;
|
||||||
macos)
|
macos)
|
||||||
bash "$DOTFILES/scripts/set-macos-defaults.sh" && msg_done "🎉 Brewfile defined apps has been installed!"
|
bash "$DOTFILES/scripts/set-macos-defaults.sh" \
|
||||||
|
&& msg_done "🎉 Brewfile defined apps has been installed!"
|
||||||
|
;;
|
||||||
|
nvm)
|
||||||
|
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash \
|
||||||
|
&& git checkout "$HOME/.zshrc" \
|
||||||
|
&& nvm install --lts --latest-npm --default \
|
||||||
|
&& msg_done "🎉 nvm installed!"
|
||||||
;;
|
;;
|
||||||
npm)
|
npm)
|
||||||
bash "$DOTFILES/scripts/install-npm-packages.sh" && msg_done "NPM Packages have been installed!"
|
bash "$DOTFILES/scripts/install-npm-packages.sh" \
|
||||||
|
&& msg_done "🎉 NPM Packages have been installed!"
|
||||||
;;
|
;;
|
||||||
settler)
|
ntfy)
|
||||||
bash "$DOTFILES/scripts/settler.sh" && msg_done "🎉 Settler has been run!"
|
bash "$DOTFILES/scripts/install-ntfy.sh" \
|
||||||
|
&& msg_done "🎉 ntfy installed!"
|
||||||
|
;;
|
||||||
|
z)
|
||||||
|
bash "$DOTFILES/scripts/install-z.sh" \
|
||||||
|
&& msg_done "🎉 Z has been installed!"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
menu_section "$USAGE_PREFIX" "all | antigen | starship | npm | macos | settler"
|
menu_section "$USAGE_PREFIX" "all | antigen | composer | starship | macos | nvm | npm"
|
||||||
menu_item "all" "Installs antigen, macos, brew and ext_gh"
|
menu_item "all" "Installs macos defaults, antigen, starship, brew, nvm and npm packages"
|
||||||
menu_item "antigen" "Updates the antigen.zsh file"
|
menu_item "antigen" "Updates the antigen.zsh file"
|
||||||
|
menu_item "composer" "Install composer"
|
||||||
menu_item "starship" "Install starship.rs"
|
menu_item "starship" "Install starship.rs"
|
||||||
menu_item "npm" "Install NPM Packages"
|
|
||||||
menu_item "macos" "Setup nice macOS defaults"
|
menu_item "macos" "Setup nice macOS defaults"
|
||||||
menu_item "settler" "Runs the WIP settler.sh"
|
menu_item "nvm" "Install Node Version Manager (nvm)"
|
||||||
|
menu_item "npm" "Install NPM Packages"
|
||||||
|
menu_item "ntfy" "Install ntfy"
|
||||||
|
menu_item "z" "Install z"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
@@ -117,21 +140,36 @@ function section_dotfiles
|
|||||||
ln -s ~/.dotfiles/config/astronvim ~/.config/astronvim
|
ln -s ~/.dotfiles/config/astronvim ~/.config/astronvim
|
||||||
ln -s ~/.dotfiles/config/nvim ~/.config/nvim
|
ln -s ~/.dotfiles/config/nvim ~/.config/nvim
|
||||||
msg_ok "Linked nvim and astronvim"
|
msg_ok "Linked nvim and astronvim"
|
||||||
hash npm 2>/dev/null && $0 install npm
|
hash npm 2> /dev/null && $0 install npm
|
||||||
msg_ok "Installed packages"
|
msg_ok "Installed packages"
|
||||||
msg_done "...and we are done!"
|
msg_done "nvim reset!"
|
||||||
|
;;
|
||||||
|
yamlfmt)
|
||||||
|
# format yaml files
|
||||||
|
yamlfmt -conf "$DOTFILES/.yamlfmt"
|
||||||
;;
|
;;
|
||||||
shfmt)
|
shfmt)
|
||||||
# Format shell scripts according to following rules.
|
# Format shell scripts according to following rules.
|
||||||
find "$DOTFILES" \
|
find "$DOTFILES" \
|
||||||
\( -name '*.sh' -or -name '*.zsh' -or -name 'x-*' \) \
|
-type f -perm +111 \
|
||||||
-exec shfmt -fn -l -w -i 2 -ci -sr -bn {} \;
|
-not -path '*/.git/*' \
|
||||||
msg_done "🎉 dotfiles have been formatted!"
|
-not -path '*dotbot*' \
|
||||||
|
-not -name '*.pl' \
|
||||||
|
-not -name '*.py' \
|
||||||
|
-not -name '*.php' \
|
||||||
|
-not -name '*.zsh' \
|
||||||
|
-exec shfmt \
|
||||||
|
--language-dialect bash \
|
||||||
|
--func-next-line --list --write \
|
||||||
|
--indent 2 --case-indent --space-redirects \
|
||||||
|
--binary-next-line {} \;
|
||||||
|
msg_done "🎉 dotfiles have been shfmt formatted!"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
menu_section "$USAGE_PREFIX" "reset_all | reset_nvim | shfmt"
|
menu_section "$USAGE_PREFIX" "reset_all | reset_nvim | yamlfmt | shfmt"
|
||||||
menu_item "reset_all" "Reset everything, runs all configured reset actions"
|
menu_item "reset_all" "Reset everything, runs all configured reset actions"
|
||||||
menu_item "reset_nvim" "Resets nvim. Deletes caches, removes nvim folders and relinks nvim folders"
|
menu_item "reset_nvim" "Resets nvim. Deletes caches, removes nvim folders and relinks nvim folders"
|
||||||
|
menu_item "yamlfmt" "Run yamlfmt to all dotfiles, which are in our control"
|
||||||
menu_item "shfmt" "Run shfmt to all dotfiles"
|
menu_item "shfmt" "Run shfmt to all dotfiles"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
@@ -144,11 +182,11 @@ function section_check
|
|||||||
X_ARCH=$(uname)
|
X_ARCH=$(uname)
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
a|arch)
|
a | arch)
|
||||||
[[ "$2" = "" ]] && echo "$X_ARCH" && exit 0
|
[[ "$2" = "" ]] && echo "$X_ARCH" && exit 0
|
||||||
[[ $X_ARCH = "$2" ]] && exit 0 || exit 1
|
[[ $X_ARCH = "$2" ]] && exit 0 || exit 1
|
||||||
;;
|
;;
|
||||||
h|host|hostname)
|
h | host | hostname)
|
||||||
[[ "$2" = "" ]] && echo "$X_HOSTNAME" && exit 0
|
[[ "$2" = "" ]] && echo "$X_HOSTNAME" && exit 0
|
||||||
[[ $X_HOSTNAME = "$2" ]] && exit 0 || exit 1
|
[[ $X_HOSTNAME = "$2" ]] && exit 0 || exit 1
|
||||||
;;
|
;;
|
||||||
@@ -209,4 +247,3 @@ case "$1" in
|
|||||||
tests) section_tests "$2" ;;
|
tests) section_tests "$2" ;;
|
||||||
*) usage && exit 0 ;;
|
*) usage && exit 0 ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
|||||||
@@ -80,4 +80,3 @@ trap 'case $? in
|
|||||||
esac' EXIT
|
esac' EXIT
|
||||||
|
|
||||||
gitdirtyrepos "$GIT_DIRTY_DIR"
|
gitdirtyrepos "$GIT_DIRTY_DIR"
|
||||||
|
|
||||||
|
|||||||
@@ -2,12 +2,12 @@
|
|||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
# as published by the Free Software Foundation; either version 2
|
# as published by the Free Software Foundation; either version 2
|
||||||
# of the License, or (at your option) any later version.
|
# of the License, or (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# This program is distributed in the hope that it will be useful,
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the Free Software
|
# along with this program; if not, write to the Free Software
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
@@ -17,7 +17,8 @@ if [[ -o interactive ]]; then
|
|||||||
ITERM_SHELL_INTEGRATION_INSTALLED=Yes
|
ITERM_SHELL_INTEGRATION_INSTALLED=Yes
|
||||||
ITERM2_SHOULD_DECORATE_PROMPT="1"
|
ITERM2_SHOULD_DECORATE_PROMPT="1"
|
||||||
# Indicates start of command output. Runs just before command executes.
|
# Indicates start of command output. Runs just before command executes.
|
||||||
iterm2_before_cmd_executes() {
|
iterm2_before_cmd_executes()
|
||||||
|
{
|
||||||
if [ "$TERM_PROGRAM" = "iTerm.app" ]; then
|
if [ "$TERM_PROGRAM" = "iTerm.app" ]; then
|
||||||
printf "\033]133;C;\r\007"
|
printf "\033]133;C;\r\007"
|
||||||
else
|
else
|
||||||
@@ -25,7 +26,8 @@ if [[ -o interactive ]]; then
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
iterm2_set_user_var() {
|
iterm2_set_user_var()
|
||||||
|
{
|
||||||
printf "\033]1337;SetUserVar=%s=%s\007" "$1" $(printf "%s" "$2" | base64 | tr -d '\n')
|
printf "\033]1337;SetUserVar=%s=%s\007" "$1" $(printf "%s" "$2" | base64 | tr -d '\n')
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -36,15 +38,17 @@ if [[ -o interactive ]]; then
|
|||||||
# \(user.currentDirectory).
|
# \(user.currentDirectory).
|
||||||
whence -v iterm2_print_user_vars > /dev/null 2>&1
|
whence -v iterm2_print_user_vars > /dev/null 2>&1
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
iterm2_print_user_vars() {
|
iterm2_print_user_vars()
|
||||||
true
|
{
|
||||||
|
true
|
||||||
}
|
}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
iterm2_print_state_data() {
|
iterm2_print_state_data()
|
||||||
|
{
|
||||||
local _iterm2_hostname="${iterm2_hostname-}"
|
local _iterm2_hostname="${iterm2_hostname-}"
|
||||||
if [ -z "${iterm2_hostname:-}" ]; then
|
if [ -z "${iterm2_hostname:-}" ]; then
|
||||||
_iterm2_hostname=$(hostname -f 2>/dev/null)
|
_iterm2_hostname=$(hostname -f 2> /dev/null)
|
||||||
fi
|
fi
|
||||||
printf "\033]1337;RemoteHost=%s@%s\007" "$USER" "${_iterm2_hostname-}"
|
printf "\033]1337;RemoteHost=%s@%s\007" "$USER" "${_iterm2_hostname-}"
|
||||||
printf "\033]1337;CurrentDir=%s\007" "$PWD"
|
printf "\033]1337;CurrentDir=%s\007" "$PWD"
|
||||||
@@ -52,18 +56,21 @@ if [[ -o interactive ]]; then
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Report return code of command; runs after command finishes but before prompt
|
# Report return code of command; runs after command finishes but before prompt
|
||||||
iterm2_after_cmd_executes() {
|
iterm2_after_cmd_executes()
|
||||||
|
{
|
||||||
printf "\033]133;D;%s\007" "$STATUS"
|
printf "\033]133;D;%s\007" "$STATUS"
|
||||||
iterm2_print_state_data
|
iterm2_print_state_data
|
||||||
}
|
}
|
||||||
|
|
||||||
# Mark start of prompt
|
# Mark start of prompt
|
||||||
iterm2_prompt_mark() {
|
iterm2_prompt_mark()
|
||||||
|
{
|
||||||
printf "\033]133;A\007"
|
printf "\033]133;A\007"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Mark end of prompt
|
# Mark end of prompt
|
||||||
iterm2_prompt_end() {
|
iterm2_prompt_end()
|
||||||
|
{
|
||||||
printf "\033]133;B\007"
|
printf "\033]133;B\007"
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -105,7 +112,8 @@ if [[ -o interactive ]]; then
|
|||||||
# * PS1 does not have our escape sequences during command execution
|
# * PS1 does not have our escape sequences during command execution
|
||||||
# * After the command executes but before a new one begins, PS1 has escape sequences and
|
# * After the command executes but before a new one begins, PS1 has escape sequences and
|
||||||
# ITERM2_PRECMD_PS1 has PS1's original value.
|
# ITERM2_PRECMD_PS1 has PS1's original value.
|
||||||
iterm2_decorate_prompt() {
|
iterm2_decorate_prompt()
|
||||||
|
{
|
||||||
# This should be a raw PS1 without iTerm2's stuff. It could be changed during command
|
# This should be a raw PS1 without iTerm2's stuff. It could be changed during command
|
||||||
# execution.
|
# execution.
|
||||||
ITERM2_PRECMD_PS1="$PS1"
|
ITERM2_PRECMD_PS1="$PS1"
|
||||||
@@ -126,7 +134,8 @@ if [[ -o interactive ]]; then
|
|||||||
ITERM2_DECORATED_PS1="$PS1"
|
ITERM2_DECORATED_PS1="$PS1"
|
||||||
}
|
}
|
||||||
|
|
||||||
iterm2_precmd() {
|
iterm2_precmd()
|
||||||
|
{
|
||||||
local STATUS="$?"
|
local STATUS="$?"
|
||||||
if [ -z "${ITERM2_SHOULD_DECORATE_PROMPT-}" ]; then
|
if [ -z "${ITERM2_SHOULD_DECORATE_PROMPT-}" ]; then
|
||||||
# You pressed ^C while entering a command (iterm2_preexec did not run)
|
# You pressed ^C while entering a command (iterm2_preexec did not run)
|
||||||
@@ -145,7 +154,8 @@ if [[ -o interactive ]]; then
|
|||||||
}
|
}
|
||||||
|
|
||||||
# This is not run if you press ^C while entering a command.
|
# This is not run if you press ^C while entering a command.
|
||||||
iterm2_preexec() {
|
iterm2_preexec()
|
||||||
|
{
|
||||||
# Set PS1 back to its raw value prior to executing the command.
|
# Set PS1 back to its raw value prior to executing the command.
|
||||||
PS1="$ITERM2_PRECMD_PS1"
|
PS1="$ITERM2_PRECMD_PS1"
|
||||||
ITERM2_SHOULD_DECORATE_PROMPT="1"
|
ITERM2_SHOULD_DECORATE_PROMPT="1"
|
||||||
@@ -158,10 +168,10 @@ if [[ -o interactive ]]; then
|
|||||||
# to a VPN.
|
# to a VPN.
|
||||||
if [ -z "${iterm2_hostname-}" ]; then
|
if [ -z "${iterm2_hostname-}" ]; then
|
||||||
if [ "$(uname)" != "Darwin" ]; then
|
if [ "$(uname)" != "Darwin" ]; then
|
||||||
iterm2_hostname=`hostname -f 2>/dev/null`
|
iterm2_hostname=$(hostname -f 2> /dev/null)
|
||||||
# Some flavors of BSD (i.e. NetBSD and OpenBSD) don't have the -f option.
|
# Some flavors of BSD (i.e. NetBSD and OpenBSD) don't have the -f option.
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
iterm2_hostname=`hostname`
|
iterm2_hostname=$(hostname)
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -10,14 +10,14 @@ if [ -z "${DIRECTORY}" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "${FILENAME}" ]; then
|
if [ -z "${FILENAME}" ]; then
|
||||||
FILENAME=$DIRECTORY
|
FILENAME=$DIRECTORY
|
||||||
fi
|
fi
|
||||||
|
|
||||||
FILENAME=${FILENAME} | \
|
FILENAME=${FILENAME} \
|
||||||
tr '/' _ | \
|
| tr '/' _ \
|
||||||
iconv -t ascii//TRANSLIT | \
|
| iconv -t ascii//TRANSLIT \
|
||||||
sed -r s/[^a-zA-Z0-9]+/_/g | \
|
| sed -r s/[^a-zA-Z0-9]+/_/g \
|
||||||
sed -r s/^_+\|-+$//g
|
| sed -r s/^_+\|-+$//g
|
||||||
|
|
||||||
TIMESTAMP=$(date "+%Y%m%d_%H%M%S")
|
TIMESTAMP=$(date "+%Y%m%d_%H%M%S")
|
||||||
FILENAME_TIMESTAMP="${FILENAME}_${TIMESTAMP}"
|
FILENAME_TIMESTAMP="${FILENAME}_${TIMESTAMP}"
|
||||||
|
|||||||
@@ -41,4 +41,3 @@ mysqldump \
|
|||||||
| mysql "${DATABASE}" \
|
| mysql "${DATABASE}" \
|
||||||
| sed '/Tables_in/d'
|
| sed '/Tables_in/d'
|
||||||
)" > "${FILENAME_TIMESTAMP}"
|
)" > "${FILENAME_TIMESTAMP}"
|
||||||
|
|
||||||
|
|||||||
@@ -17,4 +17,3 @@ if [[ "$missing_attributes" ]]; then
|
|||||||
else
|
else
|
||||||
echo "All files have a corresponding rule in .gitattributes"
|
echo "All files have a corresponding rule in .gitattributes"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -14,4 +14,3 @@ for dir in $($cmd); do
|
|||||||
eval "$@" # allow multiple commands like "foo && bar"
|
eval "$@" # allow multiple commands like "foo && bar"
|
||||||
)
|
)
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|||||||
@@ -19,4 +19,3 @@ lsof -i 4 -P -n +c 0 \
|
|||||||
| uniq
|
| uniq
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
|
|||||||
@@ -104,4 +104,3 @@ for name in "$@"; do
|
|||||||
echo " Days: ${diff}"
|
echo " Days: ${diff}"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|||||||
@@ -10,4 +10,3 @@
|
|||||||
while [ $? -eq 0 ]; do
|
while [ $? -eq 0 ]; do
|
||||||
"$@"
|
"$@"
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|||||||
@@ -22,4 +22,3 @@
|
|||||||
while [ $? -ne 0 ]; do
|
while [ $? -ne 0 ]; do
|
||||||
"$@"
|
"$@"
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|||||||
@@ -50,4 +50,3 @@ elif [ "$(get_sha256sum "$filename")" = "$file_hash" ]; then
|
|||||||
else
|
else
|
||||||
error "$filename doesn't match provided sha256sum"
|
error "$filename doesn't match provided sha256sum"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -30,4 +30,3 @@ done
|
|||||||
shift
|
shift
|
||||||
|
|
||||||
"$@"
|
"$@"
|
||||||
|
|
||||||
|
|||||||
@@ -43,4 +43,3 @@ if [ "$1" != "ssh" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
"$@"
|
"$@"
|
||||||
|
|
||||||
|
|||||||
19
scripts/install-composer.sh
Executable file
19
scripts/install-composer.sh
Executable file
@@ -0,0 +1,19 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
if command -v php &> /dev/null; then
|
||||||
|
EXPECTED_CHECKSUM="$(php -r 'copy("https://composer.github.io/installer.sig", "php://stdout");')"
|
||||||
|
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
|
||||||
|
ACTUAL_CHECKSUM="$(php -r "echo hash_file('sha384', 'composer-setup.php');")"
|
||||||
|
|
||||||
|
if [ "$EXPECTED_CHECKSUM" != "$ACTUAL_CHECKSUM" ]; then
|
||||||
|
echo >&2 'ERROR: Invalid installer checksum'
|
||||||
|
rm composer-setup.php
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
php composer-setup.php --quiet
|
||||||
|
RESULT=$?
|
||||||
|
rm composer-setup.php
|
||||||
|
mv composer.phar ~/.local/bin/composer
|
||||||
|
exit $RESULT
|
||||||
|
fi
|
||||||
30
scripts/install-go-packages.sh
Executable file
30
scripts/install-go-packages.sh
Executable file
@@ -0,0 +1,30 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# Install Go packages
|
||||||
|
#
|
||||||
|
# shellcheck source=shared.sh
|
||||||
|
source "$HOME/.dotfiles/scripts/shared.sh"
|
||||||
|
|
||||||
|
if ! command -v go &> /dev/null; then
|
||||||
|
msg "go hasn't been installed yet."
|
||||||
|
else
|
||||||
|
packages=(
|
||||||
|
# sysadmin/scripting utilities, distributed as a single binary
|
||||||
|
github.com/skx/sysbox@latest
|
||||||
|
github.com/dotzero/git-profile@latest
|
||||||
|
github.com/google/yamlfmt/cmd/yamlfmt@latest
|
||||||
|
)
|
||||||
|
|
||||||
|
for pkg in "${packages[@]}"; do
|
||||||
|
# Trim spaces
|
||||||
|
pkg=${pkg// /}
|
||||||
|
# Skip comments
|
||||||
|
if [[ ${pkg:0:1} == "#" ]]; then continue; fi
|
||||||
|
|
||||||
|
msg_run "Installing go package:" "$pkg"
|
||||||
|
go install "$pkg"
|
||||||
|
echo ""
|
||||||
|
done
|
||||||
|
|
||||||
|
msg_ok "Done"
|
||||||
|
|
||||||
|
fi
|
||||||
@@ -36,4 +36,3 @@ else
|
|||||||
echo ""
|
echo ""
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
33
scripts/install-ntfy.sh
Executable file
33
scripts/install-ntfy.sh
Executable file
@@ -0,0 +1,33 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
if ! command -v ntfy &> /dev/null; then
|
||||||
|
case $(dfm check arch) in
|
||||||
|
Linux)
|
||||||
|
NTFY_ARCH="linux_$(arch)"
|
||||||
|
;;
|
||||||
|
Darwin)
|
||||||
|
NTFY_ARCH="macOS_all"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
NTFY_VERSION=2.2.0
|
||||||
|
NTFY_URL="https://github.com/binwiederhier/ntfy"
|
||||||
|
NTFY_DEST="ntfy_${NTFY_VERSION}_${NTFY_ARCH}"
|
||||||
|
|
||||||
|
curl -L "$NTFY_URL/releases/download/v${NTFY_VERSION}/${NTFY_DEST}.tar.gz" \
|
||||||
|
> "${NTFY_DEST}.tar.gz"
|
||||||
|
tar zxvf "${NTFY_DEST}.tar.gz"
|
||||||
|
cp -a "${NTFY_DEST}/ntfy" ~/.local/bin/ntfy
|
||||||
|
mkdir -p ~/.config/ntfy
|
||||||
|
|
||||||
|
# copy config only if it does not exist
|
||||||
|
if [ ! -f "$HOME/.config/ntfy/client.yml" ]; then
|
||||||
|
cp "${NTFY_DEST}/client/client.yml" ~/.config/ntfy/client.yml
|
||||||
|
fi
|
||||||
|
|
||||||
|
rm -rf "${NTFY_DEST}" "${NTFY_DEST}.tar.gz"
|
||||||
|
else
|
||||||
|
echo "ntfy already installed"
|
||||||
|
fi
|
||||||
10
scripts/install-z.sh
Executable file
10
scripts/install-z.sh
Executable file
@@ -0,0 +1,10 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
Z_GIT_PATH="https://github.com/rupa/z.git"
|
||||||
|
Z_BIN_PATH="$XDG_BIN_HOME/z"
|
||||||
|
|
||||||
|
if [ ! -d "$Z_BIN_PATH" ]; then
|
||||||
|
git clone "$Z_GIT_PATH" "$Z_BIN_PATH"
|
||||||
|
else
|
||||||
|
echo "z ($Z_BIN_PATH/) already installed"
|
||||||
|
fi
|
||||||
@@ -6,7 +6,7 @@
|
|||||||
# - https://github.com/freekmurze/dotfiles/blob/main/macos/set-defaults.sh
|
# - https://github.com/freekmurze/dotfiles/blob/main/macos/set-defaults.sh
|
||||||
#
|
#
|
||||||
|
|
||||||
[ "$(uname)" != "Darwin" ] && echo "Not a macOS system" && exit 0;
|
[ "$(uname)" != "Darwin" ] && echo "Not a macOS system" && exit 0
|
||||||
|
|
||||||
# Ask for the administrator password upfront
|
# Ask for the administrator password upfront
|
||||||
sudo -v
|
sudo -v
|
||||||
@@ -19,6 +19,11 @@ while true; do
|
|||||||
kill -0 "$$" || exit
|
kill -0 "$$" || exit
|
||||||
done 2> /dev/null &
|
done 2> /dev/null &
|
||||||
|
|
||||||
|
# Change user shell to zsh if not that already.
|
||||||
|
if hash zsh 2> /dev/null; then
|
||||||
|
[[ "$SHELL" != $(which zsh) ]] && chsh -s "$(which zsh)"
|
||||||
|
fi
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# General UI/UX #
|
# General UI/UX #
|
||||||
###############################################################################
|
###############################################################################
|
||||||
@@ -299,4 +304,3 @@ for app in "Activity Monitor" "Address Book" "Calendar" "Contacts" "cfprefsd" \
|
|||||||
killall "${app}" > /dev/null 2>&1
|
killall "${app}" > /dev/null 2>&1
|
||||||
done
|
done
|
||||||
echo "Done. Note that some of these changes require a logout/restart to take effect."
|
echo "Done. Note that some of these changes require a logout/restart to take effect."
|
||||||
|
|
||||||
|
|||||||
@@ -111,4 +111,3 @@ function fn_exists()
|
|||||||
declare -f -F "$1" > /dev/null
|
declare -f -F "$1" > /dev/null
|
||||||
return $?
|
return $?
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user