Skip to content

Commit

Permalink
fix: update xdg related envs
Browse files Browse the repository at this point in the history
  • Loading branch information
blahspam committed Aug 28, 2024
1 parent 8fdc73f commit 49fcc5f
Show file tree
Hide file tree
Showing 10 changed files with 237 additions and 9 deletions.
16 changes: 16 additions & 0 deletions dot_bashrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#! /usr/bin/env bash

################################################################################
# XDG Support
################################################################################
export XDG_CONFIG_HOME="${HOME}/.config"
export XDG_CACHE_HOME="${HOME}/.cache"
export XDG_DATA_HOME="${HOME}/.local/share"
export XDG_STATE_HOME="${HOME}/.local/state"
export XDG_RUNTIME_DIR="${HOME}/tmp"

################################################################################
# Core Env Settings
################################################################################

export HISTFILE="${XDG_STATE_HOME}"/bash/history
194 changes: 194 additions & 0 deletions dot_config/colima/default/colima.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,194 @@
# Number of CPUs to be allocated to the virtual machine.
# Default: 2
cpu: 8

# Size of the disk in GiB to be allocated to the virtual machine.
# NOTE: changing this has no effect after the virtual machine has been created.
# Default: 60
disk: 60

# Size of the memory in GiB to be allocated to the virtual machine.
# Default: 2
memory: 8

# Architecture of the virtual machine (x86_64, aarch64, host).
# Default: host
arch: host

# Container runtime to be used (docker, containerd).
# Default: docker
runtime: docker

# Kubernetes configuration for the virtual machine.
kubernetes:
# Enable kubernetes.
# Default: false
enabled: false

# Kubernetes version to use.
# This needs to exactly match a k3s version https://github.com/k3s-io/k3s/releases
# Default: latest stable release
version: v1.24.3+k3s1

# Disable k3s features [coredns servicelb traefik local-storage metrics-server].
# All features are enabled unless disabled.
#
# EXAMPLE - disable traefik and metrics-server
# disable: [traefik, metrics-server]
#
# Default: [traefik]
disable:
- traefik

# Auto-activate on the Host for client access.
# Setting to true does the following on startup
# - sets as active Docker context (for Docker runtime).
# - sets as active Kubernetes context (if Kubernetes is enabled).
# Default: true
autoActivate: true

# Network configurations for the virtual machine.
network:
# Assign reachable IP address to the virtual machine.
# NOTE: this is currently macOS only and ignored on Linux.
# Default: false
address: false

# Custom DNS resolvers for the virtual machine.
#
# EXAMPLE
# dns: [8.8.8.8, 1.1.1.1]
#
# Default: []
dns: []

# DNS hostnames to resolve to custom targets using the internal resolver.
# This setting has no effect if a custom DNS resolver list is supplied above.
# It does not configure the /etc/hosts files of any machine or container.
# The value can be an IP address or another host.
#
# EXAMPLE
# dnsHosts:
# example.com: 1.2.3.4
dnsHosts:
host.docker.internal: host.lima.internal

# Network driver to use (slirp, gvproxy), (requires vmType `qemu`)
# - slirp is the default user mode networking provided by Qemu
# - gvproxy is an alternative to VPNKit based on gVisor https://github.com/containers/gvisor-tap-vsock
# Default: gvproxy
driver: gvproxy

# ===================================================================== #
# ADVANCED CONFIGURATION
# ===================================================================== #

# Forward the host's SSH agent to the virtual machine.
# Default: false
forwardAgent: false

# Docker daemon configuration that maps directly to daemon.json.
# https://docs.docker.com/engine/reference/commandline/dockerd/#daemon-configuration-file.
# NOTE: some settings may affect Colima's ability to start docker. e.g. `hosts`.
#
# EXAMPLE - disable buildkit
# docker:
# features:
# buildkit: false
#
# EXAMPLE - add insecure registries
# docker:
# insecure-registries:
# - myregistry.com:5000
# - host.docker.internal:5000
#
# Colima default behaviour: buildkit enabled
# Default: {}
docker: {}

# Virtual Machine type (qemu, vz)
# NOTE: this is macOS 13 only. For Linux and macOS <13.0, qemu is always used.
#
# vz is macOS virtualization framework and requires macOS 13
#
# Default: qemu
vmType: vz

# Utilise rosetta for amd64 emulation (requires m1 mac and vmType `vz`)
# Default: false
rosetta: false

# Volume mount driver for the virtual machine (virtiofs, 9p, sshfs).
#
# virtiofs is limited to macOS and vmType `vz`. It is the fastest of the options.
#
# 9p is the recommended and the most stable option for vmType `qemu`.
#
# sshfs is faster than 9p but the least reliable of the options (when there are lots
# of concurrent reads or writes).
#
# Default: virtiofs (for vz), sshfs (for qemu)
mountType: virtiofs

# The CPU type for the virtual machine (requires vmType `qemu`).
# Options available for host emulation can be checked with: `qemu-system-$(arch) -cpu help`.
# Instructions are also supported by appending to the cpu type e.g. "qemu64,+ssse3".
# Default: host
cpuType: host

# For a more general purpose virtual machine, Ubuntu container is optionally provided
# as a layer on the virtual machine.
# The underlying virtual machine is still accessible via `colima ssh --layer=false` or running `colima` in
# the Ubuntu session.
#
# Default: false
layer: false

# Custom provision scripts for the virtual machine.
# Provisioning scripts are executed on startup and therefore needs to be idempotent.
#
# EXAMPLE - script exected as root
# provision:
# - mode: system
# script: apk add htop vim
#
# EXAMPLE - script exected as user
# provision:
# - mode: user
# script: |
# [ -f ~/.provision ] && exit 0;
# echo provisioning as $USER...
# touch ~/.provision
#
# Default: []
provision: []

# Modify ~/.ssh/config automatically to include a SSH config for the virtual machine.
# SSH config will still be generated in ~/.colima/ssh_config regardless.
# Default: true
sshConfig: true

# Configure volume mounts for the virtual machine.
# Colima mounts user's home directory by default to provide a familiar
# user experience.
#
# EXAMPLE
# mounts:
# - location: ~/secrets
# writable: false
# - location: ~/projects
# writable: true
#
# Colima default behaviour: $HOME and /tmp/colima are mounted as writable.
# Default: []
mounts: []

# Environment variables for the virtual machine.
#
# EXAMPLE
# env:
# KEY: value
# ANOTHER_KEY: another value
#
# Default: {}
env: {}
1 change: 1 addition & 0 deletions dot_config/cups/lpoptions
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Default HP_Color_LaserJet
13 changes: 12 additions & 1 deletion dot_config/fish/config.fish.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -16,32 +16,43 @@ set -gx XDG_RUNTIME_DIR $HOME/.run

set -gx ADFS_USERNAME $(whoami)
set -gx ADFS_AWS_PROFILE comcast
set -gx ANDROID_USER_HOME $XDG_DATA_HOME/android
set -gx ANSIBLE_HOME $XDG_DATA_HOME/ansible
set -gx ARTIFACTORY_TOKEN {{ onepasswordRead "op://Private/Artifactory Token/credential" }}
set -gx AWS_SHARED_CREDENTIALS_FILE $XDG_CONFIG_HOME/aws/credentials
set -gx BUNDLE_USER_CONFIG $XDG_CONFIG_HOME/bundle
set -gx BUNDLE_USER_CACHE $XDG_CACHE_HOME/bundle
set -gx BUNDLE_USER_PLUGIN $XDG_DATA_HOME/bundle
set -gx CDPATH . ~/Develop
set -gx CP_HOME_DIR $XDG_DATA_HOME/cocoapods
set -gx DOCKER_CONFIG $XDG_CONFIG_HOME/docker
set -gx EDITOR nvim
set -gx GHE_TOKEN {{ onepasswordRead "op://Private/GHE Token/credential" }}
set -gx GHEC_TOKEN {{ onepasswordRead "op://Private/GHEC Token/credential"}}
set -gx GIT_EDITOR nvim
set -gx GITHUB_TOKEN {{ onepasswordRead "op://Private/Github/token" }}
set -gx GNUPGHOME $XDG_DATA_HOME/gnupg
set -gx GOPATH $HOME/Develop/go
set -gx GOBIN $GOPATH/bin
set -gx GRADLE_USER_HOME $XDG_DATA_HOME/gradle
set -gx HOMEBREW_HOME /opt/homebrew
set -gx HOMEBREW_BUNDLE_FILE $XDG_CONFIG_HOME/homebrew-bundle/Brewfile
set -gx JAVA_HOME $HOMEBREW_HOME/opt/openjdk/libexec/openjdk.jdk/Contents/Home
set -gx LESSHISTFILE $XDG_DATA_HOME/less/history
set -gx MINIKUBE_HOME $XDG_DATA_HOME/minikube
set -gx NTUSER $(whoami)
set -gx PGPASSFILE $XDG_CONFIG_HOME/psql/pgpass
set -gx PGSERVICEFILE $XDG_CONFIG_HOME/psql/pg_service.conf
set -gx PM_USER {{ onepasswordRead "op://Private/Proxmox/username" }}
set -gx PM_PASS {{ onepasswordRead "op://Private/Proxmox/password" }}
set -gx PSQLRC $XDG_CONFIG_HOME/psql/psqlrc
set -gx PSQL_HISTORY $XDG_DATA_HOME/psql/history
set -gx RBENV_ROOT $XDG_DATA_HOME/rbenv
set -gx RDEI_TOKEN {{ onepasswordRead "op://Private/RDEI Token/credential" }}
set -gx SOPS_AGE_KEY_FILE $XDG_CONFIG_HOME/sops/age/keys.txt
set -gx TF_CLI_CONFIG_FILE $XDG_CONFIG_HOME/terraform/config
set -gx TF_TOKEN_artifactory_comcast_com $ARTIFACTORY_TOKEN

set -gx TLDR_CACHE_DIR $XDG_CACHE_HOME/tldr
################################################################################
# Path
################################################################################
Expand Down
3 changes: 3 additions & 0 deletions dot_config/fish/functions/mvn.fish
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
function mvn --wraps mvn
command mvn -gs $XDG_CONFIG_HOME/maven/settings.xml $argv
end
2 changes: 1 addition & 1 deletion dot_config/git/comcast_config
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
gpgsign = true

[core]
sshCommand = ssh -i ~/.ssh/comcast -o IdentitiesOnly=yes -F /dev/null
sshCommand = ssh -i ~/.ssh/comcast -o IdentitiesOnly=yes -o ConnectionTimeout=10 -F /dev/null

[github]
user = jbailey223_comcast
Expand Down
7 changes: 5 additions & 2 deletions dot_config/homebrew-bundle/Brewfile
Original file line number Diff line number Diff line change
Expand Up @@ -63,21 +63,24 @@ brew 'neovim'
brew 'node'
brew 'npm'
brew 'openssl'
brew 'postgresql@15', restart_service: :changed
brew 'opentofu'
brew 'postgis'
brew 'postgresql@14', restart_service: :changed
brew 'pre-commit'
brew 'prettier'
brew 'python3'
brew 'python3-venv'
brew 'qemu'
brew 'qrencode'
brew 'rg'
brew 'ruby'
brew 'sd'
brew 'sops'
brew 'stern'
brew 'sqlfluff'
brew 'sqlite'
brew 'svn'
brew 'terraform'
# brew 'terraform'
brew 'terragrunt'
brew 'tflint'
brew 'tinted-builder-rust'
Expand Down
1 change: 1 addition & 0 deletions dot_config/maven/settings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<localRepository>${env.XDG_CACHE_HOME}/maven/repository</localRepository>
8 changes: 3 additions & 5 deletions dot_config/npm/npmrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#shellcheck disable=SC2034,SC2148
cache=${XDG_CACHE_HOME}/npm
loglevel="warn"
prefix=${XDG_DATA_HOME}/npm
progress=false
# init-module=${XDG_CONFIG_HOME}/npm/config/npm-init.js
cache=${XDG_CACHE_HOME}/npm
init-module=${XDG_CONFIG_HOME}/npm/config/npm-init.js
tmp=${XDG_RUNTIME_DIR}/npm
1 change: 1 addition & 0 deletions dot_zshenv.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export TF_CLI_CONFIG_FILE=${XDG_CONFIG_HOME}/terraform
export GOPATH="${HOME}/Develop/go"
export GOBIN="${GOPATH}/bin"
export RDEI_TOKEN="{{ (onepasswordDetailsFields "RDEI Token").credential.value }}"
export ZDOTDIR="${XDG_CONFIG_HOME}/zsh"

# path
typeset -U path
Expand Down

0 comments on commit 49fcc5f

Please sign in to comment.