Merge branch 'master' of ssh://git.mvl.sh/vleeuwenmenno/dotfiles
This commit is contained in:
202
.bashrc
202
.bashrc
@@ -1,202 +0,0 @@
|
||||
# HISTFILE Configuration (Bash equivalent)
|
||||
HISTFILE=~/.bash_history
|
||||
HISTSIZE=1000
|
||||
HISTFILESIZE=2000 # Adjusted to match both histfile and size criteria
|
||||
|
||||
if [ -f /etc/os-release ]; then
|
||||
distro=$(awk -F= '/^NAME/{print $ssss2}' /etc/os-release | tr -d '"')
|
||||
if [[ "$distro" == *"Pop!_OS"* ]]; then
|
||||
export CGO_CFLAGS="-I/usr/include"
|
||||
fi
|
||||
fi
|
||||
|
||||
# For microsoft-standard-WSL2 in uname -a
|
||||
if [[ "$(uname -a)" == *"microsoft-standard-WSL2"* ]]; then
|
||||
source $HOME/.agent-bridge.sh
|
||||
alias winget='winget.exe'
|
||||
fi
|
||||
|
||||
# Set SSH_AUTH_SOCK to ~/.1password/agent.sock, but only if we don't already have a SSH_AUTH_SOCK
|
||||
if [ -z "$SSH_AUTH_SOCK" ]; then
|
||||
export SSH_AUTH_SOCK=~/.1password/agent.sock
|
||||
fi
|
||||
|
||||
# If brave is available as browser set CHROME_EXECUTABLE to that.
|
||||
if command -v brave-browser &> /dev/null; then
|
||||
export CHROME_EXECUTABLE=/usr/bin/brave-browser
|
||||
fi
|
||||
|
||||
# Docker Compose Alias (Mostly for old shell scripts)
|
||||
alias docker-compose='docker compose'
|
||||
|
||||
# Modern tools aliases
|
||||
alias l="eza --header --long --git --group-directories-first --group --icons --color=always --sort=name --hyperlink -o --no-permissions"
|
||||
alias ll='l'
|
||||
alias la='l -a'
|
||||
alias cat='bat'
|
||||
alias du='dust'
|
||||
alias df='duf'
|
||||
alias augp='sudo apt update && sudo apt upgrade -y && sudo apt autopurge -y && sudo apt autoclean'
|
||||
|
||||
# Docker Aliases
|
||||
alias d='docker'
|
||||
alias dc='docker compose'
|
||||
alias dce='docker compose exec'
|
||||
alias dcl='docker compose logs'
|
||||
alias dcd='docker compose down'
|
||||
alias dcu='docker compose up'
|
||||
alias dcp='docker compose ps'
|
||||
alias dcps='docker compose ps'
|
||||
alias dcpr='dcp && dcd && dcu -d && dcl -f'
|
||||
alias dcr='dcd && dcu -d && dcl -f'
|
||||
alias ddpul='docker compose down && docker compose pull && docker compose up -d && docker compose logs -f'
|
||||
alias docker-nuke='docker kill $(docker ps -q) && docker rm $(docker ps -a -q) && docker system prune --all --volumes --force && docker volume prune --force'
|
||||
|
||||
# Git aliases
|
||||
alias g='git'
|
||||
alias gg='git pull'
|
||||
alias gl='git log --stat'
|
||||
alias gp='git push'
|
||||
alias gs='git status -s'
|
||||
alias gst='git status'
|
||||
alias ga='git add'
|
||||
alias gc='git commit'
|
||||
alias gcm='git commit -m'
|
||||
alias gco='git checkout'
|
||||
alias gcb='git checkout -b'
|
||||
|
||||
# Kubernetes aliases (Minikube)
|
||||
alias kubectl="minikube kubectl --"
|
||||
alias zeditor=~/.local/bin/zed
|
||||
alias zed=~/.local/bin/zed
|
||||
alias ssh="~/.local/bin/smart-ssh"
|
||||
|
||||
# random string (Syntax: random <length>)
|
||||
alias random='openssl rand -base64'
|
||||
|
||||
# Alias for ls to l but only if it's an interactive shell because we don't want to override ls in scripts which could blow up in our face
|
||||
if [ -t 1 ]; then
|
||||
alias ls='l'
|
||||
fi
|
||||
|
||||
# PATH Manipulation
|
||||
export DOTFILES_PATH=$HOME/.dotfiles
|
||||
export PATH=$PATH:$HOME/.local/bin
|
||||
export PATH=$PATH:$HOME/.cargo/bin
|
||||
export PATH=$PATH:$DOTFILES_PATH/bin
|
||||
export PATH="/usr/bin:$PATH"
|
||||
|
||||
if [ -d /usr/lib/pkgconfig ]; then
|
||||
export PKG_CONFIG_PATH=/usr/lib/pkgconfig:/usr/share/pkgconfig:$PKG_CONFIG_PATH
|
||||
fi
|
||||
|
||||
# Include spicetify if it exists
|
||||
if [ -d "$HOME/.spicetify" ]; then
|
||||
export PATH=$PATH:$HOME/.spicetify
|
||||
fi
|
||||
|
||||
# Include pyenv if it exists
|
||||
if [ -d "$HOME/.pyenv" ]; then
|
||||
export PYENV_ROOT="$HOME/.pyenv"
|
||||
[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"
|
||||
eval "$(pyenv init - bash)"
|
||||
fi
|
||||
|
||||
# Include pnpm if it exists
|
||||
if [ -d "$HOME/.local/share/pnpm" ]; then
|
||||
export PATH=$PATH:$HOME/.local/share/pnpm
|
||||
fi
|
||||
|
||||
# Miniconda
|
||||
export PATH="$HOME/miniconda3/bin:$PATH"
|
||||
|
||||
# In case $HOME/.flutter/flutter/bin is found, we can add it to the PATH
|
||||
if [ -d "$HOME/.flutter/flutter/bin" ]; then
|
||||
export PATH=$PATH:$HOME/.flutter/flutter/bin
|
||||
export PATH="$PATH":"$HOME/.pub-cache/bin"
|
||||
|
||||
# Flutter linux fixes:
|
||||
export CPPFLAGS="-I/usr/include"
|
||||
export LDFLAGS="-L/usr/lib/x86_64-linux-gnu -lbz2"
|
||||
export PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig:$PKG_CONFIG_PATH
|
||||
fi
|
||||
|
||||
# Add flatpak to XDG_DATA_DIRS
|
||||
export XDG_DATA_DIRS=$XDG_DATA_DIRS:/usr/share:/var/lib/flatpak/exports/share:$HOME/.local/share/flatpak/exports/share
|
||||
|
||||
# Allow unfree nixos
|
||||
export NIXPKGS_ALLOW_UNFREE=1
|
||||
|
||||
# Allow insecure nixpkgs
|
||||
export NIXPKGS_ALLOW_INSECURE=1
|
||||
|
||||
# Tradaware / DiscountOffice Configuration
|
||||
if [ -d "/home/menno/Projects/Work" ]; then
|
||||
export TRADAWARE_DEVOPS=true
|
||||
fi
|
||||
|
||||
# 1Password Source Plugin (Assuming bash compatibility)
|
||||
if [ -f /home/menno/.config/op/plugins.sh ]; then
|
||||
source /home/menno/.config/op/plugins.sh
|
||||
fi
|
||||
|
||||
# Initialize starship if available
|
||||
if ! command -v starship &> /dev/null; then
|
||||
echo "FYI, starship not found"
|
||||
else
|
||||
export STARSHIP_ENABLE_RIGHT_PROMPT=true
|
||||
export STARSHIP_ENABLE_BASH_CONTINUATION=true
|
||||
eval "$(starship init bash)"
|
||||
fi
|
||||
|
||||
# Read .op_sat
|
||||
if [ -f ~/.op_sat ]; then
|
||||
export OP_SERVICE_ACCOUNT_TOKEN=$(cat ~/.op_sat)
|
||||
|
||||
# Ensure .op_sat is 0600 and only readable by the owner
|
||||
if [ "$(stat -c %a ~/.op_sat)" != "600" ]; then
|
||||
echo "WARNING: ~/.op_sat is not 0600, please fix this!"
|
||||
fi
|
||||
|
||||
if [ "$(stat -c %U ~/.op_sat)" != "$(whoami)" ]; then
|
||||
echo "WARNING: ~/.op_sat is not owned by the current user, please fix this!"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Source nix home-manager
|
||||
if [ -f "$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh" ]; then
|
||||
. "$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh"
|
||||
fi
|
||||
|
||||
# Source ble.sh if it exists
|
||||
if [[ -f "${HOME}/.nix-profile/share/blesh/ble.sh" ]]; then
|
||||
source "${HOME}/.nix-profile/share/blesh/ble.sh"
|
||||
|
||||
# Custom function for fzf history search
|
||||
function fzf_history_search() {
|
||||
local selected
|
||||
selected=$(history | fzf --tac --height=40% --layout=reverse --border --info=inline \
|
||||
--query="$READLINE_LINE" \
|
||||
--color 'fg:#ebdbb2,bg:#282828,hl:#fabd2f,fg+:#ebdbb2,bg+:#3c3836,hl+:#fabd2f' \
|
||||
--color 'info:#83a598,prompt:#bdae93,spinner:#fabd2f,pointer:#83a598,marker:#fe8019,header:#665c54' \
|
||||
| sed 's/^ *[0-9]* *//')
|
||||
if [[ -n "$selected" ]]; then
|
||||
READLINE_LINE="$selected"
|
||||
READLINE_POINT=${#selected}
|
||||
fi
|
||||
ble-redraw-prompt
|
||||
}
|
||||
|
||||
# Bind Ctrl+R to our custom function
|
||||
bind -x '"\C-r": fzf_history_search'
|
||||
fi
|
||||
|
||||
# In case a basrc.local exists, source it
|
||||
if [ -f $HOME/.bashrc.local ]; then
|
||||
source $HOME/.bashrc.local
|
||||
fi
|
||||
|
||||
# Display a welcome message for interactive shells
|
||||
if [ -t 1 ]; then
|
||||
helloworld
|
||||
fi
|
||||
13
README.md
13
README.md
@@ -1,16 +1,13 @@
|
||||
# Setup
|
||||
|
||||
This dotfiles is intended to be used with either Fedora 40>, Ubuntu 20.04> or Arch Linux.
|
||||
Please install a clean version of either distro with GNOME and then follow the steps below.
|
||||
Please install a clean version of either distro and then follow the steps below.
|
||||
|
||||
## Installation
|
||||
|
||||
### 0. Install distro
|
||||
|
||||
Download the latest ISO from your desired distro and write it to a USB stick.
|
||||
I'd recommend getting the GNOME version as it's easier to setup unless you're planning on setting up a server, in that case I recommend getting the server ISO for the specific distro.
|
||||
|
||||
#### Note: If you intend on using a desktop environment you should select the GNOME version as this dotfiles repository expects the GNOME desktop environment for various configurations
|
||||
|
||||
### 1. Clone dotfiles to home directory
|
||||
|
||||
@@ -65,12 +62,13 @@ Here are some paths that contain files named after the hostname of the system.
|
||||
If you add a new system you should add the relevant files to these paths.
|
||||
|
||||
- `config/ssh/authorized_keys`: Contains the public keys per hostname that will be symlinked to the `~/.ssh/authorized_keys` file.
|
||||
- `config/home-manager/flake.nix`: Contains an array `homeConfigurations` where you should be adding the new system hostname and relevant configuration.
|
||||
- `flake.nix`: Contains an array `homeConfigurations` where you should be adding the new system hostname and relevant configuration.
|
||||
|
||||
### Server reboots
|
||||
|
||||
In case you reboot a server, it's likely that this runs JuiceFS.
|
||||
To be sure that every service is properly accessing JuiceFS mounted files you should probably restart the services once when the server comes online.
|
||||
|
||||
```bash
|
||||
dotf service stop --all
|
||||
df # confirm JuiceFS is mounted
|
||||
@@ -81,16 +79,19 @@ dotf service start --all
|
||||
|
||||
In case you need to adjust anything regarding the /mnt/object_storage JuiceFS.
|
||||
Ensure to shut down all services:
|
||||
|
||||
```bash
|
||||
dotf service stop --all
|
||||
```
|
||||
|
||||
Unmount the volume:
|
||||
|
||||
```bash
|
||||
sudo systemctl stop juicefs
|
||||
```
|
||||
|
||||
And optionally if you're going to do something with metadata you might need to stop redis too.
|
||||
|
||||
```bash
|
||||
cd ~/services/juicefs-redis/
|
||||
docker compose down --remove-orphans
|
||||
@@ -103,6 +104,7 @@ To add a new system you should follow these steps:
|
||||
1. Add the relevant files shown in the section above.
|
||||
2. Ensure you've either updated or added the `$HOME/.hostname` file with the hostname of the system.
|
||||
3. Run `dotf update` to ensure the symlinks are properly updated/created.
|
||||
|
||||
---
|
||||
|
||||
## Using 1Password SSH Agent with WSL2 (Windows 11)
|
||||
@@ -132,5 +134,6 @@ This setup allows you to use your 1Password-managed SSH keys inside WSL2. The WS
|
||||
- If your 1Password keys are listed, the setup is complete.
|
||||
|
||||
#### References
|
||||
|
||||
- [Using 1Password's SSH Agent with WSL2](https://dev.to/d4vsanchez/use-1password-ssh-agent-in-wsl-2j6m)
|
||||
- [How to change the PATH environment variable in Windows](https://www.wikihow.com/Change-the-PATH-Environment-Variable-on-Windows)
|
||||
|
||||
@@ -3,6 +3,5 @@ mennos-laptop ansible_connection=local
|
||||
mennos-desktop ansible_connection=local
|
||||
|
||||
[servers]
|
||||
mennos-server ansible_connection=local
|
||||
mennos-vm ansible_connection=local
|
||||
mennos-vps ansible_connection=local
|
||||
mennos-desktop ansible_connection=local
|
||||
@@ -16,4 +16,4 @@
|
||||
|
||||
- name: Include server tasks
|
||||
ansible.builtin.import_tasks: tasks/servers/server.yml
|
||||
when: inventory_hostname in ['mennos-server', 'mennos-hobbypc', 'mennos-vm', 'mennos-desktop']
|
||||
when: inventory_hostname in ['mennos-vps', 'mennos-desktop']
|
||||
@@ -1,21 +1,9 @@
|
||||
---
|
||||
- name: Include global symlinks tasks
|
||||
ansible.builtin.import_tasks: tasks/global/symlinks.yml
|
||||
|
||||
- name: Gather package facts
|
||||
ansible.builtin.package_facts:
|
||||
manager: auto
|
||||
become: true
|
||||
|
||||
- name: Debug ansible_facts for troubleshooting
|
||||
ansible.builtin.debug:
|
||||
msg: |
|
||||
OS Family: {{ ansible_facts['os_family'] }}
|
||||
Distribution: {{ ansible_facts['distribution'] }}
|
||||
Package Manager: {{ ansible_pkg_mgr }}
|
||||
Kernel: {{ ansible_kernel }}
|
||||
tags: debug
|
||||
|
||||
- name: Include Tailscale tasks
|
||||
ansible.builtin.import_tasks: tasks/global/tailscale.yml
|
||||
become: true
|
||||
@@ -131,7 +119,7 @@
|
||||
ansible.builtin.replace:
|
||||
path: /etc/sudoers
|
||||
regexp: '^Defaults\s+env_reset(?!.*pwfeedback)'
|
||||
replace: 'Defaults env_reset,pwfeedback'
|
||||
validate: 'visudo -cf %s'
|
||||
replace: "Defaults env_reset,pwfeedback"
|
||||
validate: "visudo -cf %s"
|
||||
become: true
|
||||
tags: sudoers
|
||||
@@ -15,14 +15,14 @@
|
||||
|
||||
- name: Scan utils folder for files
|
||||
ansible.builtin.find:
|
||||
paths: "{{ dotfiles_path }}/config/ansible/tasks/global/utils"
|
||||
paths: "{{ dotfiles_path }}/ansible/tasks/global/utils"
|
||||
file_type: file
|
||||
register: utils_files
|
||||
become: false
|
||||
|
||||
- name: Scan utils folder for Go projects (directories with go.mod)
|
||||
ansible.builtin.find:
|
||||
paths: "{{ dotfiles_path }}/config/ansible/tasks/global/utils"
|
||||
paths: "{{ dotfiles_path }}/ansible/tasks/global/utils"
|
||||
file_type: directory
|
||||
recurse: true
|
||||
register: utils_dirs
|
||||
@@ -83,6 +83,6 @@
|
||||
- Manual run: sudo /usr/local/bin/dynamic-dns-update.sh
|
||||
- Domains: vleeuwen.me, mvl.sh, mennovanleeuwen.nl
|
||||
|
||||
when: inventory_hostname == 'mennos-desktop'
|
||||
when: inventory_hostname == 'mennos-desktop' or inventory_hostname == 'mennos-vps'
|
||||
tags:
|
||||
- dynamic-dns
|
||||
41
ansible/tasks/servers/services/stash/docker-compose.yml.j2
Normal file
41
ansible/tasks/servers/services/stash/docker-compose.yml.j2
Normal file
@@ -0,0 +1,41 @@
|
||||
services:
|
||||
stash:
|
||||
image: stashapp/stash:latest
|
||||
container_name: stash
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "9999:9999"
|
||||
environment:
|
||||
- PUID=1000
|
||||
- PGID=1000
|
||||
- STASH_STASH=/data/
|
||||
- STASH_GENERATED=/generated/
|
||||
- STASH_METADATA=/metadata/
|
||||
- STASH_CACHE=/cache/
|
||||
- STASH_PORT=9999
|
||||
volumes:
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
## Point this at your collection.
|
||||
- {{ stash_data_dir }}:/data
|
||||
|
||||
## Keep configs, scrapers, and plugins here.
|
||||
- {{ stash_config_dir }}/config:/root/.stash
|
||||
## This is where your stash's metadata lives
|
||||
- {{ stash_config_dir }}/metadata:/metadata
|
||||
## Any other cache content.
|
||||
- {{ stash_config_dir }}/cache:/cache
|
||||
## Where to store binary blob data (scene covers, images)
|
||||
- {{ stash_config_dir }}/blobs:/blobs
|
||||
## Where to store generated content (screenshots,previews,transcodes,sprites)
|
||||
- {{ stash_config_dir }}/generated:/generated
|
||||
networks:
|
||||
- caddy_network
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
memory: 2G
|
||||
|
||||
networks:
|
||||
caddy_network:
|
||||
external: true
|
||||
name: caddy_default
|
||||
@@ -31,11 +31,6 @@
|
||||
- name: Define system desired Flatpaks
|
||||
ansible.builtin.set_fact:
|
||||
desired_system_flatpaks:
|
||||
# GNOME Software
|
||||
- "{{ 'org.gnome.Extensions' if (ansible_facts.env.XDG_CURRENT_DESKTOP is defined and 'GNOME' in ansible_facts.env.XDG_CURRENT_DESKTOP) else omit }}"
|
||||
- "{{ 'org.gnome.Weather' if (ansible_facts.env.XDG_CURRENT_DESKTOP is defined and 'GNOME' in ansible_facts.env.XDG_CURRENT_DESKTOP) else omit }}"
|
||||
- "{{ 'org.gnome.Sudoku' if (ansible_facts.env.XDG_CURRENT_DESKTOP is defined and 'GNOME' in ansible_facts.env.XDG_CURRENT_DESKTOP) else omit }}"
|
||||
|
||||
# Games
|
||||
- io.github.openhv.OpenHV
|
||||
- info.beyondallreason.bar
|
||||
@@ -53,9 +48,9 @@
|
||||
- org.signal.Signal
|
||||
- com.spotify.Client
|
||||
|
||||
# Nextcloud Compatible Utilities
|
||||
- io.github.mrvladus.List
|
||||
- org.gnome.World.Iotas
|
||||
# 3D Printing
|
||||
- com.bambulab.BambuStudio
|
||||
- io.mango3d.LycheeSlicer
|
||||
|
||||
# Utilities
|
||||
- com.ranfdev.DistroShelf
|
||||
@@ -6,19 +6,8 @@
|
||||
- name: Define workstation symlinks
|
||||
ansible.builtin.set_fact:
|
||||
workstation_symlinks:
|
||||
- {
|
||||
src: "$DOTFILES_PATH/vscode/settings.json",
|
||||
dest: "~/.config/Code/User/settings.json",
|
||||
}
|
||||
- {
|
||||
src: "$DOTFILES_PATH/zed/settings.json",
|
||||
dest: "~/.config/zed/settings.json",
|
||||
}
|
||||
- { src: "$DOTFILES_PATH/zed/settings.json", dest: "~/.config/zed.json" }
|
||||
- { src: "$DOTFILES_PATH/config/autostart", dest: "~/.config/autostart" }
|
||||
- {
|
||||
src: "$DOTFILES_PATH/config/nextcloud.cfg",
|
||||
dest: "~/.config/Nextcloud/nextcloud.cfg",
|
||||
}
|
||||
|
||||
- name: Ensure parent directories for workstation symlinks exist
|
||||
ansible.builtin.file:
|
||||
@@ -8,10 +8,6 @@
|
||||
ansible.builtin.import_tasks: tasks/workstations/cliphist.yml
|
||||
when: "'microsoft-standard-WSL2' not in ansible_kernel"
|
||||
|
||||
- name: Include GNOME Extensions tasks
|
||||
ansible.builtin.import_tasks: tasks/workstations/gnome-extensions.yml
|
||||
when: ansible_facts.env.XDG_CURRENT_DESKTOP is defined and 'GNOME' in ansible_facts.env.XDG_CURRENT_DESKTOP and 'microsoft-standard-WSL2' not in ansible_kernel
|
||||
|
||||
- name: Include Firefox APT installation tasks
|
||||
ansible.builtin.import_tasks: tasks/workstations/firefox-apt.yml
|
||||
when: ansible_pkg_mgr == 'apt' and ansible_facts.packages.snapd is defined and 'microsoft-standard-WSL2' not in ansible_kernel
|
||||
@@ -52,8 +48,6 @@
|
||||
- nodejs
|
||||
# DistroBox
|
||||
- distrobox
|
||||
# Android Screen Mirroring
|
||||
- scrcpy
|
||||
|
||||
state: present
|
||||
become: true
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user