diff --git a/.bashrc b/.bashrc deleted file mode 100644 index e57da96..0000000 --- a/.bashrc +++ /dev/null @@ -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 ) -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 diff --git a/README.md b/README.md index aa0fd02..47def82 100755 --- a/README.md +++ b/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) diff --git a/config/ansible/README.md b/ansible/README.md similarity index 100% rename from config/ansible/README.md rename to ansible/README.md diff --git a/config/ansible/ansible.cfg b/ansible/ansible.cfg similarity index 100% rename from config/ansible/ansible.cfg rename to ansible/ansible.cfg diff --git a/config/ansible/group_vars/servers.yml b/ansible/group_vars/servers.yml similarity index 100% rename from config/ansible/group_vars/servers.yml rename to ansible/group_vars/servers.yml diff --git a/config/ansible/group_vars/workstations.yml b/ansible/group_vars/workstations.yml similarity index 100% rename from config/ansible/group_vars/workstations.yml rename to ansible/group_vars/workstations.yml diff --git a/config/ansible/handlers/main.yml b/ansible/handlers/main.yml similarity index 100% rename from config/ansible/handlers/main.yml rename to ansible/handlers/main.yml diff --git a/config/ansible/inventory.ini b/ansible/inventory.ini similarity index 66% rename from config/ansible/inventory.ini rename to ansible/inventory.ini index 28093a2..2aab060 100644 --- a/config/ansible/inventory.ini +++ b/ansible/inventory.ini @@ -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 diff --git a/config/ansible/playbook.yml b/ansible/playbook.yml similarity index 84% rename from config/ansible/playbook.yml rename to ansible/playbook.yml index ec13ad4..f09f8b9 100644 --- a/config/ansible/playbook.yml +++ b/ansible/playbook.yml @@ -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'] diff --git a/config/ansible/requirements.yml b/ansible/requirements.yml similarity index 100% rename from config/ansible/requirements.yml rename to ansible/requirements.yml diff --git a/config/ansible/tasks/global/docker.yml b/ansible/tasks/global/docker.yml similarity index 100% rename from config/ansible/tasks/global/docker.yml rename to ansible/tasks/global/docker.yml diff --git a/config/ansible/tasks/global/global.yml b/ansible/tasks/global/global.yml similarity index 86% rename from config/ansible/tasks/global/global.yml rename to ansible/tasks/global/global.yml index 61f8043..f7ebf9e 100644 --- a/config/ansible/tasks/global/global.yml +++ b/ansible/tasks/global/global.yml @@ -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 diff --git a/config/ansible/tasks/global/ollama.yml b/ansible/tasks/global/ollama.yml similarity index 100% rename from config/ansible/tasks/global/ollama.yml rename to ansible/tasks/global/ollama.yml diff --git a/config/ansible/tasks/global/openssh-server.yml b/ansible/tasks/global/openssh-server.yml similarity index 100% rename from config/ansible/tasks/global/openssh-server.yml rename to ansible/tasks/global/openssh-server.yml diff --git a/config/ansible/tasks/global/tailscale.yml b/ansible/tasks/global/tailscale.yml similarity index 100% rename from config/ansible/tasks/global/tailscale.yml rename to ansible/tasks/global/tailscale.yml diff --git a/config/ansible/tasks/global/utils.yml b/ansible/tasks/global/utils.yml similarity index 93% rename from config/ansible/tasks/global/utils.yml rename to ansible/tasks/global/utils.yml index f36e07b..28bc627 100644 --- a/config/ansible/tasks/global/utils.yml +++ b/ansible/tasks/global/utils.yml @@ -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 diff --git a/config/ansible/docs/dynamic-dns-setup.md b/ansible/tasks/global/utils/dynamic-dns-cf-setup.md similarity index 100% rename from config/ansible/docs/dynamic-dns-setup.md rename to ansible/tasks/global/utils/dynamic-dns-cf-setup.md diff --git a/config/ansible/tasks/global/utils/dynamic-dns-cf.go b/ansible/tasks/global/utils/dynamic-dns-cf.go similarity index 100% rename from config/ansible/tasks/global/utils/dynamic-dns-cf.go rename to ansible/tasks/global/utils/dynamic-dns-cf.go diff --git a/config/ansible/tasks/global/utils/flitsmeister.go b/ansible/tasks/global/utils/flitsmeister.go similarity index 100% rename from config/ansible/tasks/global/utils/flitsmeister.go rename to ansible/tasks/global/utils/flitsmeister.go diff --git a/config/ansible/tasks/global/utils/helloworld.go b/ansible/tasks/global/utils/helloworld.go similarity index 100% rename from config/ansible/tasks/global/utils/helloworld.go rename to ansible/tasks/global/utils/helloworld.go diff --git a/config/ansible/tasks/global/utils/inuse.go b/ansible/tasks/global/utils/inuse.go similarity index 100% rename from config/ansible/tasks/global/utils/inuse.go rename to ansible/tasks/global/utils/inuse.go diff --git a/config/ansible/tasks/global/utils/ipaddr b/ansible/tasks/global/utils/ipaddr similarity index 100% rename from config/ansible/tasks/global/utils/ipaddr rename to ansible/tasks/global/utils/ipaddr diff --git a/config/ansible/tasks/global/utils/llm b/ansible/tasks/global/utils/llm similarity index 100% rename from config/ansible/tasks/global/utils/llm rename to ansible/tasks/global/utils/llm diff --git a/config/ansible/tasks/global/utils/smart-ssh/README.md b/ansible/tasks/global/utils/smart-ssh/README.md similarity index 100% rename from config/ansible/tasks/global/utils/smart-ssh/README.md rename to ansible/tasks/global/utils/smart-ssh/README.md diff --git a/config/ansible/tasks/global/utils/smart-ssh/config.yaml b/ansible/tasks/global/utils/smart-ssh/config.yaml similarity index 100% rename from config/ansible/tasks/global/utils/smart-ssh/config.yaml rename to ansible/tasks/global/utils/smart-ssh/config.yaml diff --git a/config/ansible/tasks/global/utils/smart-ssh/go.mod b/ansible/tasks/global/utils/smart-ssh/go.mod similarity index 100% rename from config/ansible/tasks/global/utils/smart-ssh/go.mod rename to ansible/tasks/global/utils/smart-ssh/go.mod diff --git a/config/ansible/tasks/global/utils/smart-ssh/go.sum b/ansible/tasks/global/utils/smart-ssh/go.sum similarity index 100% rename from config/ansible/tasks/global/utils/smart-ssh/go.sum rename to ansible/tasks/global/utils/smart-ssh/go.sum diff --git a/config/ansible/tasks/global/utils/smart-ssh/smart-ssh.go b/ansible/tasks/global/utils/smart-ssh/smart-ssh.go similarity index 100% rename from config/ansible/tasks/global/utils/smart-ssh/smart-ssh.go rename to ansible/tasks/global/utils/smart-ssh/smart-ssh.go diff --git a/config/ansible/tasks/global/utils/vm-device b/ansible/tasks/global/utils/vm-device similarity index 100% rename from config/ansible/tasks/global/utils/vm-device rename to ansible/tasks/global/utils/vm-device diff --git a/config/ansible/tasks/global/wsl.yml b/ansible/tasks/global/wsl.yml similarity index 100% rename from config/ansible/tasks/global/wsl.yml rename to ansible/tasks/global/wsl.yml diff --git a/config/ansible/tasks/servers/borg-backup.yml b/ansible/tasks/servers/borg-backup.yml similarity index 100% rename from config/ansible/tasks/servers/borg-backup.yml rename to ansible/tasks/servers/borg-backup.yml diff --git a/config/ansible/tasks/servers/borg-local-sync.yml b/ansible/tasks/servers/borg-local-sync.yml similarity index 100% rename from config/ansible/tasks/servers/borg-local-sync.yml rename to ansible/tasks/servers/borg-local-sync.yml diff --git a/config/ansible/tasks/servers/dynamic-dns.yml b/ansible/tasks/servers/dynamic-dns.yml similarity index 96% rename from config/ansible/tasks/servers/dynamic-dns.yml rename to ansible/tasks/servers/dynamic-dns.yml index 7bfdc7d..95fabd5 100644 --- a/config/ansible/tasks/servers/dynamic-dns.yml +++ b/ansible/tasks/servers/dynamic-dns.yml @@ -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 diff --git a/config/ansible/tasks/servers/juicefs.yml b/ansible/tasks/servers/juicefs.yml similarity index 100% rename from config/ansible/tasks/servers/juicefs.yml rename to ansible/tasks/servers/juicefs.yml diff --git a/config/ansible/tasks/servers/server.yml b/ansible/tasks/servers/server.yml similarity index 100% rename from config/ansible/tasks/servers/server.yml rename to ansible/tasks/servers/server.yml diff --git a/config/ansible/tasks/servers/services/arr-stack/arr-stack.yml b/ansible/tasks/servers/services/arr-stack/arr-stack.yml similarity index 100% rename from config/ansible/tasks/servers/services/arr-stack/arr-stack.yml rename to ansible/tasks/servers/services/arr-stack/arr-stack.yml diff --git a/config/ansible/tasks/servers/services/arr-stack/docker-compose.yml.j2 b/ansible/tasks/servers/services/arr-stack/docker-compose.yml.j2 similarity index 100% rename from config/ansible/tasks/servers/services/arr-stack/docker-compose.yml.j2 rename to ansible/tasks/servers/services/arr-stack/docker-compose.yml.j2 diff --git a/config/ansible/tasks/servers/services/avorion/avorion.yml b/ansible/tasks/servers/services/avorion/avorion.yml similarity index 100% rename from config/ansible/tasks/servers/services/avorion/avorion.yml rename to ansible/tasks/servers/services/avorion/avorion.yml diff --git a/config/ansible/tasks/servers/services/avorion/docker-compose.yml.j2 b/ansible/tasks/servers/services/avorion/docker-compose.yml.j2 similarity index 100% rename from config/ansible/tasks/servers/services/avorion/docker-compose.yml.j2 rename to ansible/tasks/servers/services/avorion/docker-compose.yml.j2 diff --git a/config/ansible/tasks/servers/services/beszel/beszel.yml b/ansible/tasks/servers/services/beszel/beszel.yml similarity index 100% rename from config/ansible/tasks/servers/services/beszel/beszel.yml rename to ansible/tasks/servers/services/beszel/beszel.yml diff --git a/config/ansible/tasks/servers/services/beszel/docker-compose.yml.j2 b/ansible/tasks/servers/services/beszel/docker-compose.yml.j2 similarity index 100% rename from config/ansible/tasks/servers/services/beszel/docker-compose.yml.j2 rename to ansible/tasks/servers/services/beszel/docker-compose.yml.j2 diff --git a/config/ansible/tasks/servers/services/caddy/Caddyfile.j2 b/ansible/tasks/servers/services/caddy/Caddyfile.j2 similarity index 100% rename from config/ansible/tasks/servers/services/caddy/Caddyfile.j2 rename to ansible/tasks/servers/services/caddy/Caddyfile.j2 diff --git a/config/ansible/tasks/servers/services/caddy/Dockerfile b/ansible/tasks/servers/services/caddy/Dockerfile similarity index 100% rename from config/ansible/tasks/servers/services/caddy/Dockerfile rename to ansible/tasks/servers/services/caddy/Dockerfile diff --git a/config/ansible/tasks/servers/services/caddy/caddy.yml b/ansible/tasks/servers/services/caddy/caddy.yml similarity index 100% rename from config/ansible/tasks/servers/services/caddy/caddy.yml rename to ansible/tasks/servers/services/caddy/caddy.yml diff --git a/config/ansible/tasks/servers/services/caddy/country-blocking.yml b/ansible/tasks/servers/services/caddy/country-blocking.yml similarity index 100% rename from config/ansible/tasks/servers/services/caddy/country-blocking.yml rename to ansible/tasks/servers/services/caddy/country-blocking.yml diff --git a/config/ansible/tasks/servers/services/caddy/docker-compose.yml.j2 b/ansible/tasks/servers/services/caddy/docker-compose.yml.j2 similarity index 100% rename from config/ansible/tasks/servers/services/caddy/docker-compose.yml.j2 rename to ansible/tasks/servers/services/caddy/docker-compose.yml.j2 diff --git a/config/ansible/tasks/servers/services/dashy/conf.yml.j2 b/ansible/tasks/servers/services/dashy/conf.yml.j2 similarity index 100% rename from config/ansible/tasks/servers/services/dashy/conf.yml.j2 rename to ansible/tasks/servers/services/dashy/conf.yml.j2 diff --git a/config/ansible/tasks/servers/services/dashy/dashy.yml b/ansible/tasks/servers/services/dashy/dashy.yml similarity index 100% rename from config/ansible/tasks/servers/services/dashy/dashy.yml rename to ansible/tasks/servers/services/dashy/dashy.yml diff --git a/config/ansible/tasks/servers/services/dashy/docker-compose.yml.j2 b/ansible/tasks/servers/services/dashy/docker-compose.yml.j2 similarity index 100% rename from config/ansible/tasks/servers/services/dashy/docker-compose.yml.j2 rename to ansible/tasks/servers/services/dashy/docker-compose.yml.j2 diff --git a/config/ansible/tasks/servers/services/downloaders/docker-compose.yml.j2 b/ansible/tasks/servers/services/downloaders/docker-compose.yml.j2 similarity index 100% rename from config/ansible/tasks/servers/services/downloaders/docker-compose.yml.j2 rename to ansible/tasks/servers/services/downloaders/docker-compose.yml.j2 diff --git a/config/ansible/tasks/servers/services/downloaders/downloaders.yml b/ansible/tasks/servers/services/downloaders/downloaders.yml similarity index 100% rename from config/ansible/tasks/servers/services/downloaders/downloaders.yml rename to ansible/tasks/servers/services/downloaders/downloaders.yml diff --git a/config/ansible/tasks/servers/services/dozzle/docker-compose.yml.j2 b/ansible/tasks/servers/services/dozzle/docker-compose.yml.j2 similarity index 100% rename from config/ansible/tasks/servers/services/dozzle/docker-compose.yml.j2 rename to ansible/tasks/servers/services/dozzle/docker-compose.yml.j2 diff --git a/config/ansible/tasks/servers/services/dozzle/dozzle.yml b/ansible/tasks/servers/services/dozzle/dozzle.yml similarity index 100% rename from config/ansible/tasks/servers/services/dozzle/dozzle.yml rename to ansible/tasks/servers/services/dozzle/dozzle.yml diff --git a/config/ansible/tasks/servers/services/echoip/docker-compose.yml.j2 b/ansible/tasks/servers/services/echoip/docker-compose.yml.j2 similarity index 100% rename from config/ansible/tasks/servers/services/echoip/docker-compose.yml.j2 rename to ansible/tasks/servers/services/echoip/docker-compose.yml.j2 diff --git a/config/ansible/tasks/servers/services/echoip/echoip.yml b/ansible/tasks/servers/services/echoip/echoip.yml similarity index 100% rename from config/ansible/tasks/servers/services/echoip/echoip.yml rename to ansible/tasks/servers/services/echoip/echoip.yml diff --git a/config/ansible/tasks/servers/services/factorio/docker-compose.yml.j2 b/ansible/tasks/servers/services/factorio/docker-compose.yml.j2 similarity index 100% rename from config/ansible/tasks/servers/services/factorio/docker-compose.yml.j2 rename to ansible/tasks/servers/services/factorio/docker-compose.yml.j2 diff --git a/config/ansible/tasks/servers/services/factorio/factorio.yml b/ansible/tasks/servers/services/factorio/factorio.yml similarity index 100% rename from config/ansible/tasks/servers/services/factorio/factorio.yml rename to ansible/tasks/servers/services/factorio/factorio.yml diff --git a/config/ansible/tasks/servers/services/gitea/act-runner-config.yaml.j2 b/ansible/tasks/servers/services/gitea/act-runner-config.yaml.j2 similarity index 100% rename from config/ansible/tasks/servers/services/gitea/act-runner-config.yaml.j2 rename to ansible/tasks/servers/services/gitea/act-runner-config.yaml.j2 diff --git a/config/ansible/tasks/servers/services/gitea/docker-compose.yml.j2 b/ansible/tasks/servers/services/gitea/docker-compose.yml.j2 similarity index 100% rename from config/ansible/tasks/servers/services/gitea/docker-compose.yml.j2 rename to ansible/tasks/servers/services/gitea/docker-compose.yml.j2 diff --git a/config/ansible/tasks/servers/services/gitea/gitea.yml b/ansible/tasks/servers/services/gitea/gitea.yml similarity index 100% rename from config/ansible/tasks/servers/services/gitea/gitea.yml rename to ansible/tasks/servers/services/gitea/gitea.yml diff --git a/config/ansible/tasks/servers/services/golink/docker-compose.yml.j2 b/ansible/tasks/servers/services/golink/docker-compose.yml.j2 similarity index 100% rename from config/ansible/tasks/servers/services/golink/docker-compose.yml.j2 rename to ansible/tasks/servers/services/golink/docker-compose.yml.j2 diff --git a/config/ansible/tasks/servers/services/golink/golink.yml b/ansible/tasks/servers/services/golink/golink.yml similarity index 100% rename from config/ansible/tasks/servers/services/golink/golink.yml rename to ansible/tasks/servers/services/golink/golink.yml diff --git a/config/ansible/tasks/servers/services/home-assistant/docker-compose.yml.j2 b/ansible/tasks/servers/services/home-assistant/docker-compose.yml.j2 similarity index 100% rename from config/ansible/tasks/servers/services/home-assistant/docker-compose.yml.j2 rename to ansible/tasks/servers/services/home-assistant/docker-compose.yml.j2 diff --git a/config/ansible/tasks/servers/services/home-assistant/home-assistant.yml b/ansible/tasks/servers/services/home-assistant/home-assistant.yml similarity index 100% rename from config/ansible/tasks/servers/services/home-assistant/home-assistant.yml rename to ansible/tasks/servers/services/home-assistant/home-assistant.yml diff --git a/config/ansible/tasks/servers/services/immich/docker-compose.yml.j2 b/ansible/tasks/servers/services/immich/docker-compose.yml.j2 similarity index 100% rename from config/ansible/tasks/servers/services/immich/docker-compose.yml.j2 rename to ansible/tasks/servers/services/immich/docker-compose.yml.j2 diff --git a/config/ansible/tasks/servers/services/immich/dotenv.j2 b/ansible/tasks/servers/services/immich/dotenv.j2 similarity index 100% rename from config/ansible/tasks/servers/services/immich/dotenv.j2 rename to ansible/tasks/servers/services/immich/dotenv.j2 diff --git a/config/ansible/tasks/servers/services/immich/immich.yml b/ansible/tasks/servers/services/immich/immich.yml similarity index 100% rename from config/ansible/tasks/servers/services/immich/immich.yml rename to ansible/tasks/servers/services/immich/immich.yml diff --git a/config/ansible/tasks/servers/services/nextcloud/docker-compose.yml.j2 b/ansible/tasks/servers/services/nextcloud/docker-compose.yml.j2 similarity index 100% rename from config/ansible/tasks/servers/services/nextcloud/docker-compose.yml.j2 rename to ansible/tasks/servers/services/nextcloud/docker-compose.yml.j2 diff --git a/config/ansible/tasks/servers/services/nextcloud/nextcloud.yml b/ansible/tasks/servers/services/nextcloud/nextcloud.yml similarity index 100% rename from config/ansible/tasks/servers/services/nextcloud/nextcloud.yml rename to ansible/tasks/servers/services/nextcloud/nextcloud.yml diff --git a/config/ansible/tasks/servers/services/plex/docker-compose.yml.j2 b/ansible/tasks/servers/services/plex/docker-compose.yml.j2 similarity index 100% rename from config/ansible/tasks/servers/services/plex/docker-compose.yml.j2 rename to ansible/tasks/servers/services/plex/docker-compose.yml.j2 diff --git a/config/ansible/tasks/servers/services/plex/plex.yml b/ansible/tasks/servers/services/plex/plex.yml similarity index 100% rename from config/ansible/tasks/servers/services/plex/plex.yml rename to ansible/tasks/servers/services/plex/plex.yml diff --git a/config/ansible/tasks/servers/services/privatebin/conf.php.j2 b/ansible/tasks/servers/services/privatebin/conf.php.j2 similarity index 100% rename from config/ansible/tasks/servers/services/privatebin/conf.php.j2 rename to ansible/tasks/servers/services/privatebin/conf.php.j2 diff --git a/config/ansible/tasks/servers/services/privatebin/docker-compose.yml.j2 b/ansible/tasks/servers/services/privatebin/docker-compose.yml.j2 similarity index 100% rename from config/ansible/tasks/servers/services/privatebin/docker-compose.yml.j2 rename to ansible/tasks/servers/services/privatebin/docker-compose.yml.j2 diff --git a/config/ansible/tasks/servers/services/privatebin/privatebin.yml b/ansible/tasks/servers/services/privatebin/privatebin.yml similarity index 100% rename from config/ansible/tasks/servers/services/privatebin/privatebin.yml rename to ansible/tasks/servers/services/privatebin/privatebin.yml diff --git a/config/ansible/tasks/servers/services/redis/docker-compose.yml.j2 b/ansible/tasks/servers/services/redis/docker-compose.yml.j2 similarity index 100% rename from config/ansible/tasks/servers/services/redis/docker-compose.yml.j2 rename to ansible/tasks/servers/services/redis/docker-compose.yml.j2 diff --git a/config/ansible/tasks/servers/services/redis/redis.yml b/ansible/tasks/servers/services/redis/redis.yml similarity index 100% rename from config/ansible/tasks/servers/services/redis/redis.yml rename to ansible/tasks/servers/services/redis/redis.yml diff --git a/config/ansible/tasks/servers/services/service_cleanup.yml b/ansible/tasks/servers/services/service_cleanup.yml similarity index 100% rename from config/ansible/tasks/servers/services/service_cleanup.yml rename to ansible/tasks/servers/services/service_cleanup.yml diff --git a/ansible/tasks/servers/services/stash/docker-compose.yml.j2 b/ansible/tasks/servers/services/stash/docker-compose.yml.j2 new file mode 100644 index 0000000..649b1a0 --- /dev/null +++ b/ansible/tasks/servers/services/stash/docker-compose.yml.j2 @@ -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 diff --git a/config/ansible/tasks/servers/services/tautulli/docker-compose.yml.j2 b/ansible/tasks/servers/services/tautulli/docker-compose.yml.j2 similarity index 100% rename from config/ansible/tasks/servers/services/tautulli/docker-compose.yml.j2 rename to ansible/tasks/servers/services/tautulli/docker-compose.yml.j2 diff --git a/config/ansible/tasks/servers/services/tautulli/tautulli.yml b/ansible/tasks/servers/services/tautulli/tautulli.yml similarity index 100% rename from config/ansible/tasks/servers/services/tautulli/tautulli.yml rename to ansible/tasks/servers/services/tautulli/tautulli.yml diff --git a/config/ansible/tasks/servers/services/unifi-network-application/docker-compose.yml.j2 b/ansible/tasks/servers/services/unifi-network-application/docker-compose.yml.j2 similarity index 100% rename from config/ansible/tasks/servers/services/unifi-network-application/docker-compose.yml.j2 rename to ansible/tasks/servers/services/unifi-network-application/docker-compose.yml.j2 diff --git a/config/ansible/tasks/servers/services/unifi-network-application/unifi-network-application.yml b/ansible/tasks/servers/services/unifi-network-application/unifi-network-application.yml similarity index 100% rename from config/ansible/tasks/servers/services/unifi-network-application/unifi-network-application.yml rename to ansible/tasks/servers/services/unifi-network-application/unifi-network-application.yml diff --git a/config/ansible/tasks/servers/services/wireguard/docker-compose.yml.j2 b/ansible/tasks/servers/services/wireguard/docker-compose.yml.j2 similarity index 100% rename from config/ansible/tasks/servers/services/wireguard/docker-compose.yml.j2 rename to ansible/tasks/servers/services/wireguard/docker-compose.yml.j2 diff --git a/config/ansible/tasks/servers/services/wireguard/wireguard.yml b/ansible/tasks/servers/services/wireguard/wireguard.yml similarity index 100% rename from config/ansible/tasks/servers/services/wireguard/wireguard.yml rename to ansible/tasks/servers/services/wireguard/wireguard.yml diff --git a/config/ansible/tasks/workstations/1password-browsers.yml b/ansible/tasks/workstations/1password-browsers.yml similarity index 100% rename from config/ansible/tasks/workstations/1password-browsers.yml rename to ansible/tasks/workstations/1password-browsers.yml diff --git a/config/ansible/tasks/workstations/autostart.yml b/ansible/tasks/workstations/autostart.yml similarity index 100% rename from config/ansible/tasks/workstations/autostart.yml rename to ansible/tasks/workstations/autostart.yml diff --git a/config/ansible/tasks/workstations/cliphist.yml b/ansible/tasks/workstations/cliphist.yml similarity index 100% rename from config/ansible/tasks/workstations/cliphist.yml rename to ansible/tasks/workstations/cliphist.yml diff --git a/config/ansible/tasks/workstations/firefox-apt.yml b/ansible/tasks/workstations/firefox-apt.yml similarity index 100% rename from config/ansible/tasks/workstations/firefox-apt.yml rename to ansible/tasks/workstations/firefox-apt.yml diff --git a/config/ansible/tasks/workstations/flatpaks.yml b/ansible/tasks/workstations/flatpaks.yml similarity index 83% rename from config/ansible/tasks/workstations/flatpaks.yml rename to ansible/tasks/workstations/flatpaks.yml index 95b9e54..5b32951 100644 --- a/config/ansible/tasks/workstations/flatpaks.yml +++ b/ansible/tasks/workstations/flatpaks.yml @@ -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 diff --git a/config/ansible/tasks/workstations/purge-libreoffice.yml b/ansible/tasks/workstations/purge-libreoffice.yml similarity index 100% rename from config/ansible/tasks/workstations/purge-libreoffice.yml rename to ansible/tasks/workstations/purge-libreoffice.yml diff --git a/config/ansible/tasks/workstations/snaps.yml b/ansible/tasks/workstations/snaps.yml similarity index 100% rename from config/ansible/tasks/workstations/snaps.yml rename to ansible/tasks/workstations/snaps.yml diff --git a/config/ansible/tasks/workstations/symlinks.yml b/ansible/tasks/workstations/symlinks.yml similarity index 73% rename from config/ansible/tasks/workstations/symlinks.yml rename to ansible/tasks/workstations/symlinks.yml index a5dd1dd..1e8ecc9 100644 --- a/config/ansible/tasks/workstations/symlinks.yml +++ b/ansible/tasks/workstations/symlinks.yml @@ -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: diff --git a/config/ansible/tasks/workstations/workstation.yml b/ansible/tasks/workstations/workstation.yml similarity index 87% rename from config/ansible/tasks/workstations/workstation.yml rename to ansible/tasks/workstations/workstation.yml index c57821b..5656170 100644 --- a/config/ansible/tasks/workstations/workstation.yml +++ b/ansible/tasks/workstations/workstation.yml @@ -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 diff --git a/config/ansible/tasks/workstations/zen-browser.yml b/ansible/tasks/workstations/zen-browser.yml similarity index 100% rename from config/ansible/tasks/workstations/zen-browser.yml rename to ansible/tasks/workstations/zen-browser.yml diff --git a/config/ansible/templates/borg-backup.service.j2 b/ansible/templates/borg-backup.service.j2 similarity index 100% rename from config/ansible/templates/borg-backup.service.j2 rename to ansible/templates/borg-backup.service.j2 diff --git a/config/ansible/templates/borg-backup.sh.j2 b/ansible/templates/borg-backup.sh.j2 similarity index 100% rename from config/ansible/templates/borg-backup.sh.j2 rename to ansible/templates/borg-backup.sh.j2 diff --git a/config/ansible/templates/borg-backup.timer.j2 b/ansible/templates/borg-backup.timer.j2 similarity index 100% rename from config/ansible/templates/borg-backup.timer.j2 rename to ansible/templates/borg-backup.timer.j2 diff --git a/config/ansible/templates/borg-local-sync.service.j2 b/ansible/templates/borg-local-sync.service.j2 similarity index 100% rename from config/ansible/templates/borg-local-sync.service.j2 rename to ansible/templates/borg-local-sync.service.j2 diff --git a/config/ansible/templates/borg-local-sync.sh.j2 b/ansible/templates/borg-local-sync.sh.j2 similarity index 100% rename from config/ansible/templates/borg-local-sync.sh.j2 rename to ansible/templates/borg-local-sync.sh.j2 diff --git a/config/ansible/templates/borg-local-sync.timer.j2 b/ansible/templates/borg-local-sync.timer.j2 similarity index 100% rename from config/ansible/templates/borg-local-sync.timer.j2 rename to ansible/templates/borg-local-sync.timer.j2 diff --git a/config/ansible/templates/dynamic-dns-systemd.env.j2 b/ansible/templates/dynamic-dns-systemd.env.j2 similarity index 100% rename from config/ansible/templates/dynamic-dns-systemd.env.j2 rename to ansible/templates/dynamic-dns-systemd.env.j2 diff --git a/config/ansible/templates/juicefs.service.j2 b/ansible/templates/juicefs.service.j2 similarity index 100% rename from config/ansible/templates/juicefs.service.j2 rename to ansible/templates/juicefs.service.j2 diff --git a/config/ansible/templates/sshd_config.j2 b/ansible/templates/sshd_config.j2 similarity index 100% rename from config/ansible/templates/sshd_config.j2 rename to ansible/templates/sshd_config.j2 diff --git a/.ansible/.lock b/bin/actions/__init__.py similarity index 100% rename from .ansible/.lock rename to bin/actions/__init__.py diff --git a/bin/actions/auto-start.py b/bin/actions/auto-start.py deleted file mode 100755 index e767855..0000000 --- a/bin/actions/auto-start.py +++ /dev/null @@ -1,87 +0,0 @@ -#!/usr/bin/env python3 - -import os -import sys -import time -import subprocess - -# Import helper functions -sys.path.append(os.path.join(os.path.expanduser("~/.dotfiles"), "bin")) -from helpers.functions import printfe, run_command - - -def check_command_exists(command): - """Check if a command is available in the system""" - try: - subprocess.run( - ["which", command], - check=True, - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - ) - return True - except subprocess.CalledProcessError: - return False - - -def list_screen_sessions(): - """List all screen sessions""" - success, output = run_command(["screen", "-ls"]) - return output - - -def wipe_dead_sessions(): - """Check and clean up dead screen sessions""" - screen_list = list_screen_sessions() - if "Dead" in screen_list: - print("Found dead sessions, cleaning up...") - run_command(["screen", "-wipe"]) - - -def is_app_running(app_name): - """Check if an app is already running in a screen session""" - screen_list = list_screen_sessions() - return app_name in screen_list - - -def start_app(app_name, command): - """Start an application in a screen session""" - printfe("green", f"Starting {app_name} with command: {command}...") - run_command(["screen", "-dmS", app_name] + command.split()) - time.sleep(1) # Give it a moment to start - - -def main(): - # Define dictionary with app_name => command mapping - apps = { - "vesktop": "vesktop", - "ktailctl": "flatpak run org.fkoehler.KTailctl", - "nemo-desktop": "nemo-desktop", - } - - # Clean up dead sessions if any - wipe_dead_sessions() - - print("Starting auto-start applications...") - for app_name, command in apps.items(): - # Get the binary name (first part of the command) - command_binary = command.split()[0] - - # Check if the command exists - if check_command_exists(command_binary): - # Check if the app is already running - if is_app_running(app_name): - printfe("yellow", f"{app_name} is already running. Skipping...") - continue - - # Start the application - start_app(app_name, command) - - # Display screen sessions - print(list_screen_sessions()) - - return 0 - - -if __name__ == "__main__": - sys.exit(main()) diff --git a/bin/actions/hello.py b/bin/actions/hello.py index f948672..572dc3d 100755 --- a/bin/actions/hello.py +++ b/bin/actions/hello.py @@ -1,13 +1,14 @@ #!/usr/bin/env python3 +"""Display welcome message and system information.""" + import os import sys import subprocess -from datetime import datetime # Import helper functions -sys.path.append(os.path.join(os.path.expanduser("~/.dotfiles"), "bin")) -from helpers.functions import printfe, logo, _rainbow_color, COLORS +sys.path.append(os.path.join(os.path.dirname(__file__), "..")) +from helpers.functions import logo, _rainbow_color, COLORS def get_last_ssh_login(): @@ -17,12 +18,16 @@ def get_last_ssh_login(): ["lastlog", "-u", os.environ.get("USER", "")], capture_output=True, text=True, + check=False, ) # If lastlog didn't work try lastlog2 if result.returncode != 0: result = subprocess.run( - ["lastlog2", os.environ.get("USER", "")], capture_output=True, text=True + ["lastlog2", os.environ.get("USER", "")], + capture_output=True, + text=True, + check=False, ) if result.returncode == 0: @@ -38,9 +43,7 @@ def get_last_ssh_login(): time_str = " ".join(parts[3:]) return f"{COLORS['cyan']}Last SSH login{COLORS['reset']}{COLORS['yellow']} {time_str}{COLORS['cyan']} from{COLORS['yellow']} {ip}" return None - except Exception as e: - # For debugging, you might want to print the exception - # print(f"Error getting SSH login: {str(e)}") + except (subprocess.CalledProcessError, FileNotFoundError): return None @@ -67,6 +70,7 @@ def check_dotfiles_status(): cwd=dotfiles_path, capture_output=True, text=True, + check=False, ) if result.stdout.strip(): @@ -85,6 +89,7 @@ def check_dotfiles_status(): cwd=dotfiles_path, capture_output=True, text=True, + check=False, ) if result.returncode == 0: status["commit_hash"] = result.stdout.strip() @@ -97,13 +102,14 @@ def check_dotfiles_status(): stdout=subprocess.PIPE, stderr=subprocess.DEVNULL, text=True, + check=False, ) if result.returncode == 0: status["unpushed"] = len(result.stdout.splitlines()) return status - except Exception as e: - print(f"Error checking dotfiles status: {str(e)}") + except (OSError, subprocess.SubprocessError) as e: + print(f"Error checking dotfiles status: {e}") return None @@ -119,7 +125,7 @@ def get_condensed_status(): count = len(items) if count > 0: status_parts.append(f"[!] {count} file(s) in trash") - except Exception: + except OSError: pass # Check dotfiles status @@ -182,6 +188,7 @@ def welcome(): def main(): + """Main entry point for the hello action.""" logo(continue_after=True) welcome() return 0 diff --git a/bin/actions/help.py b/bin/actions/help.py index 43151a4..c5315f5 100755 --- a/bin/actions/help.py +++ b/bin/actions/help.py @@ -1,24 +1,28 @@ #!/usr/bin/env python3 +"""Display help information for the dotfiles system.""" + import os import sys # Import helper functions -sys.path.append(os.path.join(os.path.expanduser("~/.dotfiles"), "bin")) +sys.path.append(os.path.join(os.path.dirname(__file__), "..")) from helpers.functions import printfe, println, logo def main(): + """Display help information.""" # Print logo logo(continue_after=True) # Print help dotfiles_path = os.environ.get("DOTFILES_PATH", os.path.expanduser("~/.dotfiles")) try: - with open(f"{dotfiles_path}/bin/resources/help.txt", "r") as f: + with open( + f"{dotfiles_path}/bin/resources/help.txt", "r", encoding="utf-8" + ) as f: help_text = f.read() - print(help_text) - except Exception as e: + except OSError as e: printfe("red", f"Error reading help file: {e}") return 1 diff --git a/bin/actions/lint.py b/bin/actions/lint.py index d1a2142..aed99ec 100755 --- a/bin/actions/lint.py +++ b/bin/actions/lint.py @@ -1,5 +1,7 @@ #!/usr/bin/env python3 +"""Run linters on dotfiles.""" + import os import sys import subprocess @@ -7,7 +9,7 @@ import argparse from pathlib import Path # Import helper functions -sys.path.append(os.path.join(os.path.dirname(os.path.dirname(__file__)))) +sys.path.append(os.path.join(os.path.dirname(__file__), "..")) from helpers.functions import printfe, command_exists DOTFILES_ROOT = os.path.expanduser("~/.dotfiles") @@ -85,16 +87,6 @@ def lint_python(fix=False): exit_code = 0 - # Check for pylint - if command_exists("pylint"): - printfe("blue", "Running pylint...") - files_to_lint = [str(f) for f in python_files] - result = subprocess.run(["pylint"] + files_to_lint, check=False) - if result.returncode != 0: - exit_code = 1 - else: - printfe("yellow", "pylint is not installed. Skipping Python linting.") - # Check for black if command_exists("black"): printfe( @@ -111,6 +103,16 @@ def lint_python(fix=False): else: printfe("yellow", "black is not installed. Skipping Python formatting.") + # Check for pylint + if command_exists("pylint"): + printfe("blue", "Running pylint...") + files_to_lint = [str(f) for f in python_files] + result = subprocess.run(["pylint"] + files_to_lint, check=False) + if result.returncode != 0: + exit_code = 1 + else: + printfe("yellow", "pylint is not installed. Skipping Python linting.") + if not command_exists("pylint") and not command_exists("black"): printfe( "red", diff --git a/bin/actions/secrets.py b/bin/actions/secrets.py deleted file mode 100755 index 880c3ee..0000000 --- a/bin/actions/secrets.py +++ /dev/null @@ -1,185 +0,0 @@ -#!/usr/bin/env python3 - -import os -import sys -import subprocess -import hashlib -import glob - -# Import helper functions -sys.path.append(os.path.join(os.path.expanduser("~/.dotfiles"), "bin")) -from helpers.functions import printfe, run_command - - -def get_password(): - """Get password from 1Password""" - op_cmd = "op" - - # Try to get the password - success, output = run_command( - [op_cmd, "read", "op://Dotfiles/Dotfiles Secrets/password"] - ) - - if not success: - printfe("red", "Failed to fetch password from 1Password.") - return None - - # Check if we need to use a token - if "use 'op item get" in output: - # Extract the token - token = output.split("use 'op item get ")[1].split(" --")[0] - printfe("cyan", f"Got fetch token: {token}") - - # Use the token to get the actual password - success, password = run_command( - [op_cmd, "item", "get", token, "--reveal", "--fields", "password"] - ) - if not success: - return None - return password - else: - # We already got the password - return output - - -def prompt_for_password(): - """Ask for password manually""" - import getpass - - printfe("cyan", "Enter the password manually: ") - password = getpass.getpass("") - - if not password: - printfe("red", "Password cannot be empty.") - sys.exit(1) - - printfe("green", "Password entered successfully.") - return password - - -def calculate_checksum(file_path): - """Calculate SHA256 checksum of a file""" - sha256_hash = hashlib.sha256() - with open(file_path, "rb") as f: - for byte_block in iter(lambda: f.read(4096), b""): - sha256_hash.update(byte_block) - return sha256_hash.hexdigest() - - -def encrypt_folder(folder_path, password): - """Recursively encrypt files in a folder""" - for item in glob.glob(os.path.join(folder_path, "*")): - # Skip .gpg and .sha256 files - if item.endswith(".gpg") or item.endswith(".sha256"): - continue - - # Handle directories recursively - if os.path.isdir(item): - encrypt_folder(item, password) - continue - - # Calculate current checksum - current_checksum = calculate_checksum(item) - checksum_file = f"{item}.sha256" - - # Check if file changed since last encryption - if os.path.exists(checksum_file): - with open(checksum_file, "r") as f: - previous_checksum = f.read().strip() - - if current_checksum == previous_checksum: - continue - - # Remove existing .gpg file if it exists - gpg_file = f"{item}.gpg" - if os.path.exists(gpg_file): - os.remove(gpg_file) - - # Encrypt the file - printfe("cyan", f"Encrypting {item}...") - cmd = [ - "gpg", - "--quiet", - "--batch", - "--yes", - "--symmetric", - "--cipher-algo", - "AES256", - "--armor", - "--passphrase", - password, - "--output", - gpg_file, - item, - ] - - success, _ = run_command(cmd) - if success: - printfe("cyan", f"Staging {item} for commit...") - run_command(["git", "add", "-f", gpg_file]) - - # Update checksum file - with open(checksum_file, "w") as f: - f.write(current_checksum) - else: - printfe("red", f"Failed to encrypt {item}") - - -def decrypt_folder(folder_path, password): - """Recursively decrypt files in a folder""" - for item in glob.glob(os.path.join(folder_path, "*")): - # Handle .gpg files - if item.endswith(".gpg"): - output_file = item[:-4] # Remove .gpg extension - printfe("cyan", f"Decrypting {item}...") - - cmd = [ - "gpg", - "--quiet", - "--batch", - "--yes", - "--decrypt", - "--passphrase", - password, - "--output", - output_file, - item, - ] - - success, _ = run_command(cmd) - if not success: - printfe("red", f"Failed to decrypt {item}") - - # Process directories recursively - elif os.path.isdir(item): - printfe("cyan", f"Decrypting folder {item}...") - decrypt_folder(item, password) - - -def main(): - if len(sys.argv) != 2 or sys.argv[1] not in ["encrypt", "decrypt"]: - printfe("red", "Usage: secrets.py [encrypt|decrypt]") - return 1 - - # Get the dotfiles path - dotfiles_path = os.environ.get("DOTFILES_PATH", os.path.expanduser("~/.dotfiles")) - secrets_path = os.path.join(dotfiles_path, "secrets") - - # Get the password - password = get_password() - if not password: - password = prompt_for_password() - - # Perform the requested action - if sys.argv[1] == "encrypt": - printfe("cyan", "Encrypting secrets...") - encrypt_folder(secrets_path, password) - else: # decrypt - printfe("cyan", "Decrypting secrets...") - decrypt_folder(secrets_path, password) - - return 0 - - -if __name__ == "__main__": - sys.exit(main()) diff --git a/bin/actions/service.py b/bin/actions/service.py index 2877c8f..bd3b193 100755 --- a/bin/actions/service.py +++ b/bin/actions/service.py @@ -1,13 +1,15 @@ #!/usr/bin/env python3 +"""Manage Docker services.""" + import os import sys import subprocess import argparse # Import helper functions -sys.path.append(os.path.join(os.path.expanduser("~/.dotfiles"), "bin")) -from helpers.functions import printfe, println, logo +sys.path.append(os.path.join(os.path.dirname(__file__), "..")) +from helpers.functions import printfe, println # Base directory for Docker services $HOME/services SERVICES_DIR = os.path.join(os.path.expanduser("~"), ".services") @@ -42,7 +44,7 @@ def run_docker_compose(args, service_name=None, compose_file=None): cmd.extend(args) printfe("blue", f"Running: {' '.join(cmd)}") - result = subprocess.run(cmd) + result = subprocess.run(cmd, check=False) return result.returncode @@ -107,7 +109,8 @@ def cmd_stop(args): if protected_running: printfe( "yellow", - f"Note: {', '.join(protected_running)} will not be stopped as they are protected services", + f"Note: {', '.join(protected_running)} will not be stopped " + "as they are protected services", ) if not safe_services: @@ -134,19 +137,18 @@ def cmd_stop(args): else: printfe("green", "\nAll running services stopped successfully") return 0 - else: - # Check if trying to stop a protected service - if args.service in PROTECTED_SERVICES: - printfe( - "red", - f"Error: {args.service} is a protected service and cannot be stopped", - ) - printfe( - "yellow", - f"The {args.service} service is required for other services to work properly", - ) - return 1 - return run_docker_compose(["down"], service_name=args.service) + # Check if trying to stop a protected service + if args.service in PROTECTED_SERVICES: + printfe( + "red", + f"Error: {args.service} is a protected service and cannot be stopped", + ) + printfe( + "yellow", + f"The {args.service} service is required for other services to work properly", + ) + return 1 + return run_docker_compose(["down"], service_name=args.service) def cmd_restart(args): @@ -206,15 +208,15 @@ def cmd_update(args): else: printfe("green", "\nAll running services updated successfully") return 0 - else: - # The original single-service update logic - # First pull the latest images - pull_result = run_docker_compose(["pull"], service_name=args.service) - if pull_result != 0: - return pull_result - # Then bring the service up with the latest images - return run_docker_compose(["up", "-d"], service_name=args.service) + # The original single-service update logic + # First pull the latest images + pull_result = run_docker_compose(["pull"], service_name=args.service) + if pull_result != 0: + return pull_result + + # Then bring the service up with the latest images + return run_docker_compose(["up", "-d"], service_name=args.service) def cmd_ps(args): @@ -248,6 +250,7 @@ def check_service_running(service_name): ["docker", "compose", "-f", compose_file, "ps", "--quiet"], capture_output=True, text=True, + check=False, ) # Count non-empty lines to get container count @@ -261,29 +264,33 @@ def get_systemd_timer_status(timer_name): active_result = subprocess.run( ["sudo", "systemctl", "is-active", timer_name], capture_output=True, - text=True + text=True, + check=False, ) # Check if timer is enabled (will start on boot) enabled_result = subprocess.run( ["sudo", "systemctl", "is-enabled", timer_name], capture_output=True, - text=True + text=True, + check=False, ) # Check corresponding service status - service_name = timer_name.replace('.timer', '.service') + service_name = timer_name.replace(".timer", ".service") service_result = subprocess.run( ["sudo", "systemctl", "is-active", service_name], capture_output=True, - text=True + text=True, + check=False, ) # Get next run time list_result = subprocess.run( ["sudo", "systemctl", "list-timers", timer_name, "--no-legend"], capture_output=True, - text=True + text=True, + check=False, ) is_active = active_result.returncode == 0 @@ -299,7 +306,7 @@ def get_systemd_timer_status(timer_name): return is_active, is_enabled, next_run, service_status -def cmd_list(args): +def cmd_list(args): # pylint: disable=unused-argument """List available Docker services and systemd services""" # Docker services section if not os.path.exists(SERVICES_DIR): @@ -322,7 +329,10 @@ def cmd_list(args): is_running = container_count > 0 if is_running: - status = f"[RUNNING - {container_count} container{'s' if container_count > 1 else ''}]" + status = ( + f"[RUNNING - {container_count} container" + f"{'s' if container_count > 1 else ''}]" + ) color = "green" else: status = "[STOPPED]" @@ -337,8 +347,10 @@ def cmd_list(args): systemd_timers = ["borg-backup.timer", "borg-local-sync.timer", "dynamic-dns.timer"] for timer in systemd_timers: - is_active, is_enabled, next_run, service_status = get_systemd_timer_status(timer) - service_name = timer.replace('.timer', '') + is_active, is_enabled, next_run, service_status = get_systemd_timer_status( + timer + ) + service_name = timer.replace(".timer", "") if service_status in ["activating", "active"]: # Service is currently running @@ -360,6 +372,7 @@ def cmd_list(args): def main(): + """Main entry point for managing Docker services.""" parser = argparse.ArgumentParser(description="Manage Docker services") subparsers = parser.add_subparsers(dest="command", help="Command to run") diff --git a/bin/actions/source.py b/bin/actions/source.py index d34327b..ce38d99 100755 --- a/bin/actions/source.py +++ b/bin/actions/source.py @@ -1,27 +1,39 @@ #!/usr/bin/env python3 +"""Generate export commands for Borg environment variables.""" + import os import sys import subprocess -# Add the helpers directory to the path -sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'helpers')) -from functions import printfe +# Add the bin directory to the path +sys.path.append(os.path.join(os.path.dirname(__file__), "..")) +from helpers.functions import printfe + def get_borg_passphrase(): """Get Borg passphrase from 1Password""" try: result = subprocess.run( - ["op", "item", "get", "Borg Backup", "--vault=Dotfiles", "--fields=password", "--reveal"], + [ + "op", + "item", + "get", + "Borg Backup", + "--vault=Dotfiles", + "--fields=password", + "--reveal", + ], capture_output=True, text=True, - check=True + check=True, ) return result.stdout.strip() except subprocess.CalledProcessError: printfe("red", "Error: Failed to retrieve Borg passphrase from 1Password") return None + def main(): """Generate export commands for Borg environment variables""" args = sys.argv[1:] if len(sys.argv) > 1 else [] @@ -33,12 +45,12 @@ def main(): # Generate the export commands exports = [ - f'export BORG_REPO="/mnt/object_storage/borg-repo"', + 'export BORG_REPO="/mnt/object_storage/borg-repo"', f'export BORG_PASSPHRASE="{passphrase}"', - f'export BORG_CACHE_DIR="/home/menno/.config/borg/cache"', - f'export BORG_CONFIG_DIR="/home/menno/.config/borg/config"', - f'export BORG_SECURITY_DIR="/home/menno/.config/borg/security"', - f'export BORG_KEYS_DIR="/home/menno/.config/borg/keys"' + 'export BORG_CACHE_DIR="/home/menno/.config/borg/cache"', + 'export BORG_CONFIG_DIR="/home/menno/.config/borg/config"', + 'export BORG_SECURITY_DIR="/home/menno/.config/borg/security"', + 'export BORG_KEYS_DIR="/home/menno/.config/borg/keys"', ] # Check if we're being eval'd (no arguments and stdout is a pipe) @@ -63,19 +75,17 @@ def main(): print() printfe("yellow", "Or copy and paste these exports:") print() - # Output the export commands for export_cmd in exports: print(export_cmd) - print() printfe("cyan", "📋 Borg commands (use with sudo -E):") printfe("white", " sudo -E borg list # List all backups") printfe("white", " sudo -E borg info # Repository info") printfe("white", " sudo -E borg list ::archive-name # List files in backup") printfe("white", " sudo -E borg mount . ~/borg-mount # Mount as filesystem") - return 0 + if __name__ == "__main__": sys.exit(main()) diff --git a/bin/actions/timers.py b/bin/actions/timers.py index ec76b36..63bf1c3 100755 --- a/bin/actions/timers.py +++ b/bin/actions/timers.py @@ -1,22 +1,28 @@ #!/usr/bin/env python3 +"""Display status of systemd timers.""" + import os import subprocess import sys -# Add the helpers directory to the path -sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'helpers')) -from functions import printfe +# Add the bin directory to the path +sys.path.append(os.path.join(os.path.dirname(__file__), "..")) +from helpers.functions import printfe + def run_command(cmd, capture_output=True): """Run a command and return the result""" try: - result = subprocess.run(cmd, shell=True, capture_output=capture_output, text=True) + result = subprocess.run( + cmd, shell=True, capture_output=capture_output, text=True + ) return result except Exception as e: printfe("red", f"Error running command: {e}") return None + def show_timer_status(timer_name, system_level=True): """Show concise status for a specific timer""" cmd_prefix = "sudo systemctl" if system_level else "systemctl --user" @@ -24,10 +30,12 @@ def show_timer_status(timer_name, system_level=True): # Get timer status status_cmd = f"{cmd_prefix} is-active {timer_name}" status_result = run_command(status_cmd) - timer_status = "active" if status_result and status_result.returncode == 0 else "inactive" + timer_status = ( + "active" if status_result and status_result.returncode == 0 else "inactive" + ) # Get corresponding service status - service_name = timer_name.replace('.timer', '.service') + service_name = timer_name.replace(".timer", ".service") service_cmd = f"{cmd_prefix} is-active {service_name}" service_result = run_command(service_cmd) service_status = service_result.stdout.strip() if service_result else "unknown" @@ -43,7 +51,7 @@ def show_timer_status(timer_name, system_level=True): next_run = f"{parts[0]} {parts[1]} {parts[2]} ({parts[3]})" # Format output based on service status - service_short = service_name.replace('.service', '') + service_short = service_name.replace(".service", "") if service_status in ["activating", "active"]: # Service is currently running @@ -63,6 +71,7 @@ def show_timer_status(timer_name, system_level=True): printfe(status_color, f"{symbol} {service_short:<12} {status_text}") + def show_examples(): """Show example commands for checking services and logs""" printfe("cyan", "=== Useful Commands ===") @@ -92,6 +101,7 @@ def show_examples(): print(" sudo systemctl list-timers") print() + def main(): """Main timers action""" args = sys.argv[1:] if len(sys.argv) > 1 else [] @@ -103,7 +113,7 @@ def main(): timers = [ ("borg-backup.timer", True), ("borg-local-sync.timer", True), - ("dynamic-dns.timer", True) + ("dynamic-dns.timer", True), ] for timer_name, system_level in timers: @@ -118,5 +128,6 @@ def main(): return 0 + if __name__ == "__main__": sys.exit(main()) diff --git a/bin/actions/update.py b/bin/actions/update.py index 42d5544..a349f28 100755 --- a/bin/actions/update.py +++ b/bin/actions/update.py @@ -1,12 +1,14 @@ #!/usr/bin/env python3 +"""Update the dotfiles system.""" + import os import sys import subprocess import argparse # Import helper functions -sys.path.append(os.path.join(os.path.expanduser("~/.dotfiles"), "bin")) +sys.path.append(os.path.join(os.path.dirname(__file__), "..")) from helpers.functions import printfe, run_command @@ -230,7 +232,10 @@ def get_sudo_password_from_1password(username, hostname): printfe("red", f"Failed to fetch password from 1Password: {e.stderr.strip()}") return None except FileNotFoundError: - printfe("red", "Error: 'op' command not found. Please ensure 1Password CLI is installed and in your PATH.") + printfe( + "red", + "Error: 'op' command not found. Please ensure 1Password CLI is installed and in your PATH.", + ) return None except Exception as e: printfe("red", f"An unexpected error occurred while fetching password: {e}") @@ -251,9 +256,7 @@ def main(): action="store_true", help="Upgrade Ansible packages with verbose output", ) - parser.add_argument( - "--tags", type=str, help="Run only specific Ansible tags" - ) + parser.add_argument("--tags", type=str, help="Run only specific Ansible tags") parser.add_argument( "--full-speed", "-F", action="store_true", help="Use all available cores" ) @@ -262,7 +265,10 @@ def main(): ) parser.add_argument( - "--skip-check", "-s", action="store_true", help="Skip checking for dotfiles updates" + "--skip-check", + "-s", + action="store_true", + help="Skip checking for dotfiles updates", ) args = parser.parse_args() @@ -296,9 +302,6 @@ def main(): cores = 8 jobs = 1 - printfe("cyan", f"Limiting to {cores} cores with {jobs} jobs.") - - # Home Manager update if args.ha: dotfiles_path = os.environ.get( "DOTFILES_PATH", os.path.expanduser("~/.dotfiles") @@ -306,7 +309,7 @@ def main(): hostname = os.uname().nodename printfe("cyan", "Updating Home Manager flake...") - os.chdir(f"{dotfiles_path}/config/home-manager") + os.chdir(f"{dotfiles_path}") status, output = run_command( [ "nix", @@ -326,11 +329,6 @@ def main(): # Check if home-manager is installed status, _ = run_command(["which", "home-manager"], shell=False) if status: - printfe("cyan", "Cleaning old backup files...") - backup_file = os.path.expanduser("~/.config/mimeapps.list.backup") - if os.path.exists(backup_file): - os.remove(backup_file) - printfe("cyan", "Upgrading Home Manager packages...") env = os.environ.copy() env["NIXPKGS_ALLOW_UNFREE"] = "1" @@ -353,7 +351,7 @@ def main(): str(jobs), ] - result = subprocess.run(cmd, env=env) + result = subprocess.run(cmd, env=env, check=False) if result.returncode != 0: printfe("red", "Failed to upgrade Home Manager packages.") return 1 @@ -377,12 +375,12 @@ def main(): return 1 printfe("cyan", "Running Ansible playbook...") - playbook_path = f"{dotfiles_path}/config/ansible/playbook.yml" + playbook_path = f"{dotfiles_path}/ansible/playbook.yml" ansible_cmd = [ "/usr/bin/env", "ansible-playbook", "-i", - f"{dotfiles_path}/config/ansible/inventory.ini", + f"{dotfiles_path}/ansible/inventory.ini", playbook_path, "--extra-vars", f"hostname={hostname}", @@ -394,14 +392,20 @@ def main(): sudo_password = None if not os.isatty(sys.stdin.fileno()): - printfe("yellow", "Warning: Not running in an interactive terminal. Cannot fetch password from 1Password.") + printfe( + "yellow", + "Warning: Not running in an interactive terminal. Cannot fetch password from 1Password.", + ) ansible_cmd.append("--ask-become-pass") else: sudo_password = get_sudo_password_from_1password(username, hostname) if sudo_password: ansible_cmd.extend(["--become-pass-file", "-"]) else: - printfe("yellow", "Could not fetch password from 1Password. Falling back to --ask-become-pass.") + printfe( + "yellow", + "Could not fetch password from 1Password. Falling back to --ask-become-pass.", + ) ansible_cmd.append("--ask-become-pass") if args.tags: @@ -411,13 +415,13 @@ def main(): ansible_cmd.append("-vvv") # Debug: Show the command being executed - printfe("yellow", f"Debug: Executing command: {' '.join(ansible_cmd)}") + printfe("cyan", f"Executing command: {' '.join(ansible_cmd)}") # Execute the Ansible command, passing password via stdin if available if sudo_password: - result = subprocess.run(ansible_cmd, input=sudo_password.encode('utf-8')) + result = subprocess.run(ansible_cmd, input=sudo_password.encode("utf-8"), check=False) else: - result = subprocess.run(ansible_cmd) + result = subprocess.run(ansible_cmd, check=False) if result.returncode != 0: printfe("red", "Failed to upgrade Ansible packages.") diff --git a/bin/dotf b/bin/dotf index fa3d63a..2cfae88 100755 --- a/bin/dotf +++ b/bin/dotf @@ -43,14 +43,6 @@ def help(args): """Run the help action""" return run_script(f"{DOTFILES_BIN}/actions/help.py", args) -def secrets(args): - """Run the secrets action""" - return run_script(f"{DOTFILES_BIN}/actions/secrets.py", args) - -def auto_start(args): - """Run the auto-start action""" - return run_script(f"{DOTFILES_BIN}/actions/auto-start.py", args) - def service(args): """Run the service/docker action""" return run_script(f"{DOTFILES_BIN}/actions/service.py", args) @@ -119,8 +111,6 @@ def main(): "update": update, "help": help, "hello": hello, - "secrets": secrets, - "auto-start": auto_start, "service": service, "lint": lint, "timers": timers, diff --git a/bin/helpers/__init__.py b/bin/helpers/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/bin/helpers/functions.py b/bin/helpers/functions.py index 08fb406..fdb8903 100644 --- a/bin/helpers/functions.py +++ b/bin/helpers/functions.py @@ -1,5 +1,7 @@ #!/usr/bin/env python3 +"""Helper functions for the dotfiles system.""" + import sys import subprocess import math @@ -7,6 +9,7 @@ import random import shutil import datetime + try: import pyfiglet except ImportError: @@ -157,7 +160,7 @@ def ensure_dependencies(): if missing_packages: printfe("yellow", f"Missing dependencies: {', '.join(missing_packages)}") install = input("Would you like to install them now? (y/n): ").lower() - if install == "y" or install == "yes": + if install in ("y", "yes"): printfe("cyan", "Installing missing dependencies...") for package in missing_packages: printfe("blue", f"Installing {package}...") @@ -171,7 +174,6 @@ def ensure_dependencies(): printfe("green", "All dependencies have been processed") return True - else: - printfe("yellow", "Skipping dependency installation") - return False + printfe("yellow", "Skipping dependency installation") + return False return True diff --git a/bin/resources/help.txt b/bin/resources/help.txt index 2442284..5e33458 100755 --- a/bin/resources/help.txt +++ b/bin/resources/help.txt @@ -6,11 +6,6 @@ Usage: dotf [OPTIONS] [ARGS] --ansible, -A Upgrade Ansible packages --ansible-verbose Upgrade Ansible packages with verbose output (-vvv) --full-speed, -F Use all available cores for compilation (Default: 8 cores) - - secrets: Encrypt and decrypt secrets. - Commands: - encrypt Encrypt all files in the secrets folder - decrypt Decrypt all .gpg files in the secrets folder service: Manage Docker services for development. Commands: @@ -30,6 +25,5 @@ Usage: dotf [OPTIONS] [ARGS] --python Run only Python linters (pylint, black) --fix Auto-fix issues where possible - auto-start: Start a set of pre-defined applications. hello: Shows the welcome message for the terminal. help: Shows this help message diff --git a/cloud-config b/cloud-config deleted file mode 100644 index 3f08b70..0000000 --- a/cloud-config +++ /dev/null @@ -1,22 +0,0 @@ -#cloud-config - -# Create a user named menno with sudo privileges -users: - - name: menno - sudo: ALL=(ALL) NOPASSWD:ALL - groups: sudo, adm - shell: /bin/bash - ssh_authorized_keys: - - ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIM+sKpcREOUjwMMSzEWAso6830wbOi8kUxqpuXWw5gHr menno_1password - - ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIE22Hfx8wgkc57TXX1TCMHcNrCdjbfog5QeHFJfl7IeD menno_fallback - -# Update package lists and install latest updates -package_update: true -package_upgrade: true - -# Configure system to preserve hostname -preserve_hostname: false -hostname: mennos-vm - -# Final message when cloud-init completes -final_message: "Cloud-init has finished setting up the system with user 'menno'. System boot completed after $UPTIME seconds." diff --git a/config/ansible/tasks/global/symlinks.yml b/config/ansible/tasks/global/symlinks.yml deleted file mode 100644 index 9b7b22b..0000000 --- a/config/ansible/tasks/global/symlinks.yml +++ /dev/null @@ -1,41 +0,0 @@ ---- -- name: Server setup - block: - - name: Set user home directory - ansible.builtin.set_fact: - user_home: "{{ ansible_env.HOME if ansible_user_id == 'root' else lookup('env', 'HOME') }}" - - - name: Create basic symlinks - ansible.builtin.file: - src: "{{ item.src | replace('~', user_home) | replace('$DOTFILES_PATH', lookup('env', 'DOTFILES_PATH')) }}" - dest: "{{ item.dest | replace('~', user_home) }}" - state: link - force: true - follow: false - loop: - - { - src: "$DOTFILES_PATH/config/home-manager", - dest: "~/.config/home-manager", - } - - { src: "$DOTFILES_PATH/config/ssh/config", dest: "~/.ssh/config" } - - { - src: "$DOTFILES_PATH/config/starship.toml", - dest: "~/.config/starship.toml", - } - - { src: "$DOTFILES_PATH/.bashrc", dest: "~/.bashrc.extra" } - - - name: Create gitconfig symlink - ansible.builtin.file: - src: "{{ gitconfig_mapping[inventory_hostname] | replace('~', user_home) | replace('$DOTFILES_PATH', lookup('env', 'DOTFILES_PATH')) }}" - dest: "{{ user_home }}/.gitconfig" - state: link - force: true - follow: false - vars: - gitconfig_mapping: - mennos-desktop: "$DOTFILES_PATH/config/git/gitconfig.linux" - mennos-laptop: "$DOTFILES_PATH/config/git/gitconfig.linux" - mennos-server: "$DOTFILES_PATH/config/git/gitconfig.mennos-server" - mennos-vm: "$DOTFILES_PATH/config/git/gitconfig.mennos-server" - tags: - - symlinks diff --git a/config/ansible/tasks/workstations/gnome-extensions.yml b/config/ansible/tasks/workstations/gnome-extensions.yml deleted file mode 100644 index 5053406..0000000 --- a/config/ansible/tasks/workstations/gnome-extensions.yml +++ /dev/null @@ -1,18 +0,0 @@ ---- -- name: Install Pano - Clipboard Manager dependencies - ansible.builtin.apt: - name: - - gir1.2-gda-5.0 - - gir1.2-gsound-1.0 - state: present - update_cache: true - become: true - -- name: Install Pano - Clipboard Manager - ansible.builtin.import_tasks: tasks/workstations/gnome-extensions/pano.yml - -- name: Install Tiling Shell - Window Manager - ansible.builtin.import_tasks: tasks/workstations/gnome-extensions/tilingshell.yml - -- name: Install Quick Settings Tweaks - ansible.builtin.import_tasks: tasks/workstations/gnome-extensions/quick-settings.yml diff --git a/config/ansible/tasks/workstations/gnome-extensions/manage_gnome_extension.yml b/config/ansible/tasks/workstations/gnome-extensions/manage_gnome_extension.yml deleted file mode 100644 index e1929d8..0000000 --- a/config/ansible/tasks/workstations/gnome-extensions/manage_gnome_extension.yml +++ /dev/null @@ -1,73 +0,0 @@ ---- -- name: Manage GNOME extension - vars: - requested_git_tag: "{{ git_tag }}" - extension_name: "{{ ext_name }}" - extension_url: "{{ ext_url }}" - extension_path: "{{ ansible_user_dir }}/.local/share/gnome-shell/extensions/{{ ext_id }}" - version_file: "{{ extension_path }}/version.txt" - block: - - name: Check if extension is installed - ansible.builtin.stat: - path: "{{ extension_path }}" - register: ext_check - - - name: Read last installed version - ansible.builtin.slurp: - src: "{{ version_file }}" - register: installed_version - ignore_errors: true - when: ext_check.stat.exists - - - name: Determine if update is needed - ansible.builtin.set_fact: - update_needed: >- - {{ installed_version.content is not defined or - (installed_version.content | b64decode | trim != requested_git_tag) }} - - - name: Delete old extension if updating - ansible.builtin.file: - path: "{{ extension_path }}" - state: absent - when: update_needed - - - name: Create directory for extension - ansible.builtin.file: - path: "{{ extension_path }}" - state: directory - mode: "0755" - when: not ext_check.stat.exists or update_needed - - - name: Download extension - ansible.builtin.get_url: - url: "{{ extension_url | replace('%TAG%', requested_git_tag) }}" - dest: "{{ extension_path }}/release.zip" - mode: "0644" - when: update_needed or not ext_check.stat.exists - - - name: Extract extension - ansible.builtin.unarchive: - src: "{{ extension_path }}/release.zip" - dest: "{{ extension_path }}" - when: update_needed or not ext_check.stat.exists - - - name: Store installed version of the extension - ansible.builtin.copy: - content: "{{ requested_git_tag }}" - dest: "{{ version_file }}" - mode: "0644" - when: update_needed or not ext_check.stat.exists - - - name: Cleanup post installation - ansible.builtin.file: - path: "{{ extension_path }}/release.zip" - state: absent - when: not ext_check.stat.exists or update_needed - - - name: Notify user of required GNOME Shell reload - ansible.builtin.debug: - msg: > - Please reload GNOME Shell by pressing Alt + F2, typing 'r' and pressing Enter. - Then enable the {{ extension_name }} in GNOME Tweaks. - Or on Wayland, log out and back in. - when: not ext_check.stat.exists or update_needed diff --git a/config/ansible/tasks/workstations/gnome-extensions/pano.yml b/config/ansible/tasks/workstations/gnome-extensions/pano.yml deleted file mode 100644 index ecc8764..0000000 --- a/config/ansible/tasks/workstations/gnome-extensions/pano.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -- name: Manage Pano Clipboard Manager - ansible.builtin.include_tasks: tasks/workstations/gnome-extensions/manage_gnome_extension.yml - vars: - git_tag: "v23-alpha5" - ext_name: "Pano - Clipboard Manager" - ext_url: "https://github.com/oae/gnome-shell-pano/releases/download/%TAG%/pano@elhan.io.zip" - ext_id: "pano@elhan.io" diff --git a/config/ansible/tasks/workstations/gnome-extensions/quick-settings.yml b/config/ansible/tasks/workstations/gnome-extensions/quick-settings.yml deleted file mode 100644 index c0938e7..0000000 --- a/config/ansible/tasks/workstations/gnome-extensions/quick-settings.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -- name: Manage Quick Settings Tweaks - ansible.builtin.include_tasks: tasks/workstations/gnome-extensions/manage_gnome_extension.yml - vars: - git_tag: "2.1-stable" - ext_name: "Quick Settings Tweaks" - ext_url: "https://github.com/qwreey/quick-settings-tweaks/releases/download/2.1-stable/2.1-release.zip" - ext_id: "quick-settings-tweaks@qwreey" diff --git a/config/ansible/tasks/workstations/gnome-extensions/tilingshell.yml b/config/ansible/tasks/workstations/gnome-extensions/tilingshell.yml deleted file mode 100644 index 8d53a7e..0000000 --- a/config/ansible/tasks/workstations/gnome-extensions/tilingshell.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -- name: Manage Tiling Shell - Window Manager - ansible.builtin.include_tasks: tasks/workstations/gnome-extensions/manage_gnome_extension.yml - vars: - git_tag: "16.3" - ext_name: "Tiling Shell - Window Manager" - ext_url: "https://github.com/domferr/tilingshell/releases/download/%TAG%/tilingshell@ferrarodomenico.com.zip" - ext_id: "tilingshell@ferrarodomenico.com" diff --git a/config/autostart/.gitkeep b/config/autostart/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/config/autostart/1password.desktop b/config/autostart/1password.desktop deleted file mode 100755 index 7747433..0000000 --- a/config/autostart/1password.desktop +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env xdg-open -[Desktop Entry] -Name=1Password -Exec=/home/menno/.config/autostart/1password.ignition_delay.sh -Terminal=false -Type=Application -Icon=1password -StartupWMClass=1Password -Comment=Password manager and secure wallet -MimeType=x-scheme-handler/onepassword;x-scheme-handler/onepassword8; -Categories=Office; -Hidden=false diff --git a/config/autostart/1password.ignition_delay.sh b/config/autostart/1password.ignition_delay.sh deleted file mode 100755 index 75e278d..0000000 --- a/config/autostart/1password.ignition_delay.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/usr/bin/env sh -sleep 3 && /opt/1Password/1password %U diff --git a/config/autostart/Nextcloud.desktop b/config/autostart/Nextcloud.desktop deleted file mode 100755 index 219765f..0000000 --- a/config/autostart/Nextcloud.desktop +++ /dev/null @@ -1,11 +0,0 @@ -[Desktop Entry] -Name=Nextcloud -GenericName=File Synchronizer -Exec="/usr/bin/nextcloud" --background -Terminal=false -Icon=Nextcloud -Categories=Network -Type=Application -StartupNotify=false -X-GNOME-Autostart-enabled=true -X-GNOME-Autostart-Delay=10 diff --git a/config/autostart/io.github.mrvladus.List.desktop b/config/autostart/io.github.mrvladus.List.desktop deleted file mode 100644 index 258c71f..0000000 --- a/config/autostart/io.github.mrvladus.List.desktop +++ /dev/null @@ -1,6 +0,0 @@ -[Desktop Entry] -Type=Application -Name=io.github.mrvladus.List -X-XDP-Autostart=io.github.mrvladus.List -Exec=flatpak run --command=errands io.github.mrvladus.List --gapplication-service -X-Flatpak=io.github.mrvladus.List diff --git a/config/autostart/jetbrains-toolbox.desktop b/config/autostart/jetbrains-toolbox.desktop deleted file mode 100755 index 3357e67..0000000 --- a/config/autostart/jetbrains-toolbox.desktop +++ /dev/null @@ -1,15 +0,0 @@ -[Desktop Entry] -Icon=/home/menno/.jetbrains-toolbox/toolbox.svg -Exec=/home/menno/.jetbrains-toolbox/jetbrains-toolbox --minimize -Version=1.0 -Type=Application -Categories=Development -Name=JetBrains Toolbox -StartupWMClass=jetbrains-toolbox -Terminal=false -MimeType=x-scheme-handler/jetbrains; -X-GNOME-Autostart-enabled=true -StartupNotify=false -X-GNOME-Autostart-Delay=10 -X-MATE-Autostart-Delay=10 -X-KDE-autostart-after=panel diff --git a/config/autostart/mimeinfo.cache b/config/autostart/mimeinfo.cache deleted file mode 100755 index 37c6411..0000000 --- a/config/autostart/mimeinfo.cache +++ /dev/null @@ -1,11 +0,0 @@ -[MIME Cache] -x-scheme-handler/discord=io.github.equicord.equibop.desktop; -x-scheme-handler/jetbrains=jetbrains-toolbox.desktop; -x-scheme-handler/onepassword=1password.desktop; -x-scheme-handler/onepassword8=1password.desktop; -x-scheme-handler/sgnl=org.signal.Signal.desktop; -x-scheme-handler/signalcaptcha=org.signal.Signal.desktop; -x-scheme-handler/spotify=com.spotify.Client.desktop; -x-scheme-handler/tg=org.telegram.desktop.desktop; -x-scheme-handler/tonsite=org.telegram.desktop.desktop; -x-scheme-handler/whatsapp=com.rtosta.zapzap.desktop; diff --git a/config/autostart/org.fkoehler.KTailctl.desktop b/config/autostart/org.fkoehler.KTailctl.desktop deleted file mode 100755 index 4690af0..0000000 --- a/config/autostart/org.fkoehler.KTailctl.desktop +++ /dev/null @@ -1,11 +0,0 @@ -[Desktop Entry] -Name=KTailctl -Comment=GUI for tailscale on the KDE Plasma desktop -Version=1.5 -Exec=/home/menno/.config/autostart/org.fkoehler.KTailctl.ignition_delay.sh -Icon=org.fkoehler.KTailctl -Type=Application -Terminal=false -Categories=Qt;KDE;System; -X-Flatpak=org.fkoehler.KTailctl -Hidden=false diff --git a/config/autostart/org.fkoehler.KTailctl.ignition_delay.sh b/config/autostart/org.fkoehler.KTailctl.ignition_delay.sh deleted file mode 100755 index ee33c27..0000000 --- a/config/autostart/org.fkoehler.KTailctl.ignition_delay.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/usr/bin/env sh -sleep 5 && /usr/bin/flatpak run --branch=stable --arch=x86_64 --command=ktailctl org.fkoehler.KTailctl diff --git a/config/autostart/org.telegram.desktop.desktop b/config/autostart/org.telegram.desktop.desktop deleted file mode 100755 index f5abf17..0000000 --- a/config/autostart/org.telegram.desktop.desktop +++ /dev/null @@ -1,23 +0,0 @@ -[Desktop Entry] -Name=Telegram -Comment=New era of messaging -TryExec=Telegram -Exec=/home/menno/.config/autostart/org.telegram.desktop.ignition_delay.sh -Icon=org.telegram.desktop -Terminal=false -StartupWMClass=TelegramDesktop -Type=Application -Categories=Chat;Network;InstantMessaging;Qt; -MimeType=x-scheme-handler/tg;x-scheme-handler/tonsite; -Keywords=tg;chat;im;messaging;messenger;sms;tdesktop; -Actions=quit; -DBusActivatable=false -SingleMainWindow=true -X-GNOME-UsesNotifications=true -X-GNOME-SingleWindow=true -Hidden=false - -[Desktop Action quit] -Exec=Telegram -quit -Name=Quit Telegram -Icon=application-exit diff --git a/config/autostart/org.telegram.desktop.ignition_delay.sh b/config/autostart/org.telegram.desktop.ignition_delay.sh deleted file mode 100755 index 59667f5..0000000 --- a/config/autostart/org.telegram.desktop.ignition_delay.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/usr/bin/env sh -sleep 2 && Telegram -- %u diff --git a/config/autostart/org.telegram.ignition_delay.sh.desktop b/config/autostart/org.telegram.ignition_delay.sh.desktop deleted file mode 100755 index ceb25b4..0000000 --- a/config/autostart/org.telegram.ignition_delay.sh.desktop +++ /dev/null @@ -1,2 +0,0 @@ -#!/usr/bin/env sh -sleep 1 && /usr/bin/flatpak run --branch=stable --arch=x86_64 --command=telegram-desktop --file-forwarding org.telegram.desktop -- @@u %u @@ diff --git a/config/autostart/signal-desktop.desktop b/config/autostart/signal-desktop.desktop deleted file mode 100755 index c9d39f1..0000000 --- a/config/autostart/signal-desktop.desktop +++ /dev/null @@ -1,14 +0,0 @@ -[Desktop Entry] -Type=Application -Name=Signal -Comment=Signal - Private Messenger -Comment[de]=Signal - Sicherer Messenger -Icon=signal-desktop -Exec=/home/menno/.config/autostart/signal-desktop.ignition_delay.sh -Terminal=false -Categories=Network;InstantMessaging; -StartupWMClass=signal -MimeType=x-scheme-handler/sgnl;x-scheme-handler/signalcaptcha; -Keywords=sgnl;chat;im;messaging;messenger;security;privat; -X-GNOME-UsesNotifications=true -Hidden=false diff --git a/config/autostart/signal-desktop.ignition_delay.sh b/config/autostart/signal-desktop.ignition_delay.sh deleted file mode 100755 index 05a765b..0000000 --- a/config/autostart/signal-desktop.ignition_delay.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/usr/bin/env sh -sleep 2 && signal-desktop -- %u diff --git a/config/autostart/steam.desktop b/config/autostart/steam.desktop deleted file mode 100755 index 3e40b01..0000000 --- a/config/autostart/steam.desktop +++ /dev/null @@ -1,283 +0,0 @@ -[Desktop Entry] -Name=Steam -Comment=Application for managing and playing games on Steam -Comment[pt_BR]=Aplicativo para jogar e gerenciar jogos no Steam -Comment[bg]=Приложение за ръководене и пускане на игри в Steam -Comment[cs]=Aplikace pro spravování a hraní her ve službě Steam -Comment[da]=Applikation til at håndtere og spille spil på Steam -Comment[nl]=Applicatie voor het beheer en het spelen van games op Steam -Comment[fi]=Steamin pelien hallintaan ja pelaamiseen tarkoitettu sovellus -Comment[fr]=Application de gestion et d'utilisation des jeux sur Steam -Comment[de]=Anwendung zum Verwalten und Spielen von Spielen auf Steam -Comment[el]=Εφαρμογή διαχείρισης παιχνιδιών στο Steam -Comment[hu]=Alkalmazás a Steames játékok futtatásához és kezeléséhez -Comment[it]=Applicazione per la gestione e l'esecuzione di giochi su Steam -Comment[ja]=Steam 上でゲームを管理&プレイするためのアプリケーション -Comment[ko]=Steam에 있는 게임을 관리하고 플레이할 수 있는 응용 프로그램 -Comment[no]=Program for å administrere og spille spill på Steam -Comment[pt_PT]=Aplicação para organizar e executar jogos no Steam -Comment[pl]=Aplikacja do zarządzania i uruchamiania gier na platformie Steam -Comment[ro]=Aplicație pentru administrarea și jucatul jocurilor pe Steam -Comment[ru]=Приложение для игр и управления играми в Steam -Comment[es]=Aplicación para administrar y ejecutar juegos en Steam -Comment[sv]=Ett program för att hantera samt spela spel på Steam -Comment[zh_CN]=管理和进行 Steam 游戏的应用程序 -Comment[zh_TW]=管理並執行 Steam 遊戲的應用程式 -Comment[th]=โปรแกรมสำหรับจัดการและเล่นเกมบน Steam -Comment[tr]=Steam üzerinden oyun oynama ve düzenleme uygulaması -Comment[uk]=Програма для керування іграми та запуску ігор у Steam -Comment[vi]=Ứng dụng để quản lý và chơi trò chơi trên Steam -Exec=/home/menno/.config/autostart/steam.ignition_delay.sh -Icon=steam -Terminal=false -Type=Application -Categories=Network;FileTransfer;Game; -MimeType=x-scheme-handler/steam;x-scheme-handler/steamlink; -Actions=Store;Community;Library;Servers;Screenshots;News;Settings;BigPicture;Friends; -PrefersNonDefaultGPU=true -X-KDE-RunOnDiscreteGpu=true -Hidden=false - -[Desktop Action Store] -Name=Store -Name[pt_BR]=Loja -Name[bg]=Магазин -Name[cs]=Obchod -Name[da]=Butik -Name[nl]=Winkel -Name[fi]=Kauppa -Name[fr]=Magasin -Name[de]=Shop -Name[el]=ΚΑΤΑΣΤΗΜΑ -Name[hu]=Áruház -Name[it]=Negozio -Name[ja]=ストア -Name[ko]=상점 -Name[no]=Butikk -Name[pt_PT]=Loja -Name[pl]=Sklep -Name[ro]=Magazin -Name[ru]=Магазин -Name[es]=Tienda -Name[sv]=Butik -Name[zh_CN]=商店 -Name[zh_TW]=商店 -Name[th]=ร้านค้า -Name[tr]=Mağaza -Name[uk]=Крамниця -Name[vi]=Cửa hàng -Exec=steam steam://store - -[Desktop Action Community] -Name=Community -Name[pt_BR]=Comunidade -Name[bg]=Общност -Name[cs]=Komunita -Name[da]=Fællesskab -Name[nl]=Community -Name[fi]=Yhteisö -Name[fr]=Communauté -Name[de]=Community -Name[el]=Κοινότητα -Name[hu]=Közösség -Name[it]=Comunità -Name[ja]=コミュニティ -Name[ko]=커뮤니티 -Name[no]=Samfunn -Name[pt_PT]=Comunidade -Name[pl]=Społeczność -Name[ro]=Comunitate -Name[ru]=Сообщество -Name[es]=Comunidad -Name[sv]=Gemenskap -Name[zh_CN]=社区 -Name[zh_TW]=社群 -Name[th]=ชุมชน -Name[tr]=Topluluk -Name[uk]=Спільнота -Name[vi]=Cộng đồng -Exec=steam steam://url/SteamIDControlPage - -[Desktop Action Library] -Name=Library -Name[pt_BR]=Biblioteca -Name[bg]=Библиотека -Name[cs]=Knihovna -Name[da]=Bibliotek -Name[nl]=Bibliotheek -Name[fi]=Kokoelma -Name[fr]=Bibliothèque -Name[de]=Bibliothek -Name[el]=Συλλογή -Name[hu]=Könyvtár -Name[it]=Libreria -Name[ja]=ライブラリ -Name[ko]=라이브러리 -Name[no]=Bibliotek -Name[pt_PT]=Biblioteca -Name[pl]=Biblioteka -Name[ro]=Colecţie -Name[ru]=Библиотека -Name[es]=Biblioteca -Name[sv]=Bibliotek -Name[zh_CN]=库 -Name[zh_TW]=收藏庫 -Name[th]=คลัง -Name[tr]=Kütüphane -Name[uk]=Бібліотека -Name[vi]=Thư viện -Exec=steam steam://open/games - -[Desktop Action Servers] -Name=Servers -Name[pt_BR]=Servidores -Name[bg]=Сървъри -Name[cs]=Servery -Name[da]=Servere -Name[nl]=Servers -Name[fi]=Palvelimet -Name[fr]=Serveurs -Name[de]=Server -Name[el]=Διακομιστές -Name[hu]=Szerverek -Name[it]=Server -Name[ja]=サーバー -Name[ko]=서버 -Name[no]=Tjenere -Name[pt_PT]=Servidores -Name[pl]=Serwery -Name[ro]=Servere -Name[ru]=Серверы -Name[es]=Servidores -Name[sv]=Servrar -Name[zh_CN]=服务器 -Name[zh_TW]=伺服器 -Name[th]=เซิร์ฟเวอร์ -Name[tr]=Sunucular -Name[uk]=Сервери -Name[vi]=Máy chủ -Exec=steam steam://open/servers - -[Desktop Action Screenshots] -Name=Screenshots -Name[pt_BR]=Capturas de tela -Name[bg]=Снимки -Name[cs]=Snímky obrazovky -Name[da]=Skærmbilleder -Name[nl]=Screenshots -Name[fi]=Kuvankaappaukset -Name[fr]=Captures d'écran -Name[de]=Screenshots -Name[el]=Φωτογραφίες -Name[hu]=Képernyőmentések -Name[it]=Screenshot -Name[ja]=スクリーンショット -Name[ko]=스크린샷 -Name[no]=Skjermbilder -Name[pt_PT]=Capturas de ecrã -Name[pl]=Zrzuty ekranu -Name[ro]=Capturi de ecran -Name[ru]=Скриншоты -Name[es]=Capturas -Name[sv]=Skärmdumpar -Name[zh_CN]=截图 -Name[zh_TW]=螢幕擷圖 -Name[th]=ภาพหน้าจอ -Name[tr]=Ekran Görüntüleri -Name[uk]=Скріншоти -Name[vi]=Ảnh chụp -Exec=steam steam://open/screenshots - -[Desktop Action News] -Name=News -Name[pt_BR]=Notícias -Name[bg]=Новини -Name[cs]=Zprávy -Name[da]=Nyheder -Name[nl]=Nieuws -Name[fi]=Uutiset -Name[fr]=Actualités -Name[de]=Neuigkeiten -Name[el]=Νέα -Name[hu]=Hírek -Name[it]=Notizie -Name[ja]=ニュース -Name[ko]=뉴스 -Name[no]=Nyheter -Name[pt_PT]=Novidades -Name[pl]=Aktualności -Name[ro]=Știri -Name[ru]=Новости -Name[es]=Noticias -Name[sv]=Nyheter -Name[zh_CN]=新闻 -Name[zh_TW]=新聞 -Name[th]=ข่าวสาร -Name[tr]=Haberler -Name[uk]=Новини -Name[vi]=Tin tức -Exec=steam steam://open/news - -[Desktop Action Settings] -Name=Settings -Name[pt_BR]=Configurações -Name[bg]=Настройки -Name[cs]=Nastavení -Name[da]=Indstillinger -Name[nl]=Instellingen -Name[fi]=Asetukset -Name[fr]=Paramètres -Name[de]=Einstellungen -Name[el]=Ρυθμίσεις -Name[hu]=Beállítások -Name[it]=Impostazioni -Name[ja]=設定 -Name[ko]=설정 -Name[no]=Innstillinger -Name[pt_PT]=Definições -Name[pl]=Ustawienia -Name[ro]=Setări -Name[ru]=Настройки -Name[es]=Parámetros -Name[sv]=Inställningar -Name[zh_CN]=设置 -Name[zh_TW]=設定 -Name[th]=การตั้งค่า -Name[tr]=Ayarlar -Name[uk]=Налаштування -Name[vi]=Thiết lập -Exec=steam steam://open/settings - -[Desktop Action BigPicture] -Name=Big Picture -Exec=steam steam://open/bigpicture - -[Desktop Action Friends] -Name=Friends -Name[pt_BR]=Amigos -Name[bg]=Приятели -Name[cs]=Přátelé -Name[da]=Venner -Name[nl]=Vrienden -Name[fi]=Kaverit -Name[fr]=Amis -Name[de]=Freunde -Name[el]=Φίλοι -Name[hu]=Barátok -Name[it]=Amici -Name[ja]=フレンド -Name[ko]=친구 -Name[no]=Venner -Name[pt_PT]=Amigos -Name[pl]=Znajomi -Name[ro]=Prieteni -Name[ru]=Друзья -Name[es]=Amigos -Name[sv]=Vänner -Name[zh_CN]=好友 -Name[zh_TW]=好友 -Name[th]=เพื่อน -Name[tr]=Arkadaşlar -Name[uk]=Друзі -Name[vi]=Bạn bè -Exec=steam steam://open/friends diff --git a/config/autostart/steam.ignition_delay.sh b/config/autostart/steam.ignition_delay.sh deleted file mode 100755 index 59ae7e0..0000000 --- a/config/autostart/steam.ignition_delay.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/usr/bin/env sh -sleep 10 && /usr/bin/steam %U diff --git a/config/bash.nix b/config/bash.nix new file mode 100644 index 0000000..e5dc0c3 --- /dev/null +++ b/config/bash.nix @@ -0,0 +1,281 @@ +{ + config, + pkgs, + lib, + ... +}: + +{ + programs.bash = { + enable = true; + enableCompletion = true; + + # History configuration + historySize = 1000; + historyFileSize = 2000; + historyControl = [ + "ignoredups" + "ignorespace" + ]; + + # Bash options and extra configuration + bashrcExtra = '' + # Set various bash options + shopt -s histappend + shopt -s checkwinsize + shopt -s cdspell + shopt -s cmdhist + shopt -s dotglob + shopt -s expand_aliases + shopt -s extglob + shopt -s histreedit + shopt -s histverify + shopt -s no_empty_cmd_completion + shopt -s nocaseglob + + # Detect distribution and set CGO_CFLAGS for Pop!_OS + if [ -f /etc/os-release ]; then + distro=$(awk -F= '/^NAME/{print $2}' /etc/os-release | tr -d '"') + if [[ "$distro" == *"Pop!_OS"* ]]; then + export CGO_CFLAGS="-I/usr/include" + fi + fi + + # WSL2 specific configuration + if [[ "$(uname -a)" == *"microsoft-standard-WSL2"* ]]; then + [ -f "${config.home.homeDirectory}/.agent-bridge.sh" ] && source "${config.home.homeDirectory}/.agent-bridge.sh" + alias winget='winget.exe' + fi + + # Set SSH_AUTH_SOCK to 1Password agent if not already set + if [ -z "$SSH_AUTH_SOCK" ]; then + export SSH_AUTH_SOCK=~/.1password/agent.sock + fi + + # Set Chrome executable to Brave if available + if command -v brave-browser &> /dev/null; then + export CHROME_EXECUTABLE=/usr/bin/brave-browser + fi + + # Source 1Password plugins if available + if [ -f ${config.home.homeDirectory}/.config/op/plugins.sh ]; then + source ${config.home.homeDirectory}/.config/op/plugins.sh + fi + + # Read 1Password service account token + if [ -f ~/.op_sat ]; then + export OP_SERVICE_ACCOUNT_TOKEN=$(cat ~/.op_sat) + + # Security checks for .op_sat file + 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 session variables + if [ -f "${config.home.homeDirectory}/.nix-profile/etc/profile.d/hm-session-vars.sh" ]; then + . "${config.home.homeDirectory}/.nix-profile/etc/profile.d/hm-session-vars.sh" + fi + + # Source ble.sh if available and configure fzf history search + if [[ -f "${config.home.homeDirectory}/.nix-profile/share/blesh/ble.sh" ]]; then + source "${config.home.homeDirectory}/.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 custom fzf function + bind -x '"\C-r": fzf_history_search' + fi + + # Source local bashrc if it exists + if [ -f "${config.home.homeDirectory}/.bashrc.local" ]; then + source "${config.home.homeDirectory}/.bashrc.local" + fi + + # Display welcome message for interactive shells + if [ -t 1 ]; then + command -v helloworld &> /dev/null && helloworld + fi + ''; + + # Shell aliases + shellAliases = { + # Folder navigation + "." = "cd ."; + ".." = "cd .."; + "..." = "cd ../.."; + "...." = "cd ../../.."; + "....." = "cd ../../../.."; + + # Docker Compose alias (for old scripts) + "docker-compose" = "docker compose"; + + # Modern tools aliases + "l" = + "eza --header --long --git --group-directories-first --group --icons --color=always --sort=name --hyperlink -o --no-permissions"; + "ll" = "l"; + "la" = "l -a"; + "cat" = "bat"; + "du" = "dust"; + "df" = "duf"; + "augp" = "sudo apt update && sudo apt upgrade -y && sudo apt autopurge -y && sudo apt autoclean"; + + # Docker aliases + "d" = "docker"; + "dc" = "docker compose"; + "dce" = "docker compose exec"; + "dcl" = "docker compose logs"; + "dcd" = "docker compose down"; + "dcu" = "docker compose up"; + "dcp" = "docker compose ps"; + "dcps" = "docker compose ps"; + "dcpr" = "dcp && dcd && dcu -d && dcl -f"; + "dcr" = "dcd && dcu -d && dcl -f"; + "ddpul" = + "docker compose down && docker compose pull && docker compose up -d && docker compose logs -f"; + "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 + "g" = "git"; + "gg" = "git pull"; + "gl" = "git log --stat"; + "gp" = "git push"; + "gs" = "git status -s"; + "gst" = "git status"; + "ga" = "git add"; + "gc" = "git commit"; + "gcm" = "git commit -m"; + "gco" = "git checkout"; + "gcb" = "git checkout -b"; + + # Kubernetes aliases + "kubectl" = "minikube kubectl --"; + + # Editor aliases + "zeditor" = "${config.home.homeDirectory}/.local/bin/zed"; + "zed" = "${config.home.homeDirectory}/.local/bin/zed"; + + # SSH alias + "ssh" = "${config.home.homeDirectory}/.local/bin/smart-ssh"; + + # Utility aliases + "random" = "openssl rand -base64"; + }; + + # Session variables + sessionVariables = { + # Basic environment + DOTFILES_PATH = "${config.home.homeDirectory}/.dotfiles"; + + # Nix configuration + NIXPKGS_ALLOW_UNFREE = "1"; + NIXPKGS_ALLOW_INSECURE = "1"; + + # XDG configuration + XDG_DATA_DIRS = "$XDG_DATA_DIRS:/usr/share:/var/lib/flatpak/exports/share:$HOME/.local/share/flatpak/exports/share"; + + # Starship configuration + STARSHIP_ENABLE_RIGHT_PROMPT = "true"; + STARSHIP_ENABLE_BASH_CONTINUATION = "true"; + }; + + # Profile extra (runs for login shells) + profileExtra = '' + # PATH manipulation + export PATH="$PATH:${config.home.homeDirectory}/.local/bin" + export PATH="$PATH:${config.home.homeDirectory}/.cargo/bin" + export PATH="$PATH:$DOTFILES_PATH/bin" + export PATH="/usr/bin:$PATH" + + # PKG_CONFIG_PATH + if [ -d /usr/lib/pkgconfig ]; then + export PKG_CONFIG_PATH=/usr/lib/pkgconfig:/usr/share/pkgconfig:$PKG_CONFIG_PATH + fi + + # Spicetify + if [ -d "${config.home.homeDirectory}/.spicetify" ]; then + export PATH="$PATH:${config.home.homeDirectory}/.spicetify" + fi + + # Pyenv + if [ -d "${config.home.homeDirectory}/.pyenv" ]; then + export PYENV_ROOT="${config.home.homeDirectory}/.pyenv" + [[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH" + eval "$(pyenv init - bash)" + fi + + # pnpm + if [ -d "${config.home.homeDirectory}/.local/share/pnpm" ]; then + export PATH="$PATH:${config.home.homeDirectory}/.local/share/pnpm" + fi + + # Miniconda + export PATH="${config.home.homeDirectory}/miniconda3/bin:$PATH" + + # Flutter + if [ -d "${config.home.homeDirectory}/.flutter/flutter/bin" ]; then + export PATH="$PATH:${config.home.homeDirectory}/.flutter/flutter/bin" + export PATH="$PATH:${config.home.homeDirectory}/.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 + + # Tradaware / DiscountOffice Configuration + if [ -d "${config.home.homeDirectory}/Projects/Work" ]; then + export TRADAWARE_DEVOPS=true + fi + ''; + + # Interactive shell specific configuration + initExtra = '' + # Override ls with l only for interactive shells + if [ -t 1 ]; then + alias ls='l' + fi + + # Initialize starship prompt if available + if command -v starship &> /dev/null; then + eval "$(starship init bash)" + else + echo "FYI, starship not found" + fi + ''; + }; + + # Configure fzf + programs.fzf = { + enable = true; + enableBashIntegration = true; + defaultCommand = "fd --type f"; + defaultOptions = [ + "--height 40%" + "--layout=reverse" + "--border" + "--inline-info" + "--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'" + ]; + }; + +} diff --git a/config/default.nix b/config/default.nix new file mode 100644 index 0000000..f630c52 --- /dev/null +++ b/config/default.nix @@ -0,0 +1,8 @@ +{ ... }: +{ + imports = [ + ./bash.nix + ./git.nix + ./starship.nix + ]; +} diff --git a/config/git.nix b/config/git.nix new file mode 100644 index 0000000..8ae71d3 --- /dev/null +++ b/config/git.nix @@ -0,0 +1,273 @@ +{ + config, + pkgs, + lib, + ... +}: + +{ + programs.git = { + enable = true; + + # Basic configuration + userName = "Menno van Leeuwen"; + userEmail = "menno@vleeuwen.me"; + signing = lib.mkIf (!config.isServer) { + key = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIM+sKpcREOUjwMMSzEWAso6830wbOi8kUxqpuXWw5gHr"; + }; + + # Git settings + extraConfig = { + init = { + defaultBranch = "main"; + }; + + core = { + editor = "nvim"; + autocrlf = false; + filemode = true; + ignorecase = false; + }; + + push = { + default = "simple"; + autoSetupRemote = true; + }; + + pull = { + rebase = true; + }; + + branch = { + autosetupmerge = "always"; + autosetuprebase = "always"; + }; + + merge = { + tool = "nvim"; + conflictstyle = "diff3"; + }; + + diff = { + tool = "delta"; + }; + + color = { + ui = "auto"; + branch = { + current = "yellow reverse"; + local = "yellow"; + remote = "green"; + }; + diff = { + meta = "yellow bold"; + frag = "magenta bold"; + old = "red"; + new = "green"; + }; + status = { + added = "yellow"; + changed = "green"; + untracked = "cyan"; + }; + }; + + # URL rewrites for SSH + url = { + "git@github.com:" = { + insteadOf = "https://github.com/"; + }; + "git@gitlab.com:" = { + insteadOf = "https://gitlab.com/"; + }; + "git@git.mvl.sh:" = { + insteadOf = "https://git.mvl.sh/"; + }; + }; + + # Security + gpg = lib.mkIf (!config.isServer) { + format = "ssh"; + ssh = { + program = "/opt/1Password/op-ssh-sign"; + }; + }; + + commit = lib.mkIf (!config.isServer) { + gpgsign = true; + }; + + # Performance + feature = { + manyFiles = true; + }; + + index = { + version = 4; + }; + + protocol = { + version = 2; + }; + }; + + # Git aliases + aliases = { + # Status and info + st = "status -sb"; + s = "status"; + stat = "status"; + + # Logging + l = "log --oneline --graph --decorate"; + ll = "log --graph --pretty=format:'%C(yellow)%h%Creset -%C(red)%d%Creset %s %C(green)(%cr) %C(blue)<%an>%Creset' --abbrev-commit --date=relative"; + lol = "log --graph --decorate --pretty=oneline --abbrev-commit"; + lola = "log --graph --decorate --pretty=oneline --abbrev-commit --all"; + hist = "log --pretty=format:'%h %ad | %s%d [%an]' --graph --date=short"; + + # Diff + d = "diff"; + dc = "diff --cached"; + ds = "diff --staged"; + dt = "difftool"; + + # Add and commit + a = "add"; + aa = "add -A"; + ap = "add -p"; + c = "commit"; + cm = "commit -m"; + ca = "commit -am"; + amend = "commit --amend"; + + # Checkout and branch + co = "checkout"; + cb = "checkout -b"; + br = "branch"; + bra = "branch -a"; + bd = "branch -d"; + bdd = "branch -D"; + + # Remote + r = "remote"; + rv = "remote -v"; + + # Push and pull + p = "push"; + pf = "push --force-with-lease"; + pu = "push -u origin"; + pl = "pull"; + pom = "push origin main"; + plom = "pull origin main"; + + # Reset and clean + unstage = "reset HEAD --"; + undo = "reset --soft HEAD~1"; + undohard = "reset --hard HEAD~1"; + clean-branches = "!git branch --merged | grep -v '\\*\\|master\\|main\\|develop' | xargs -n 1 git branch -d"; + + # Stash + ss = "stash save"; + sp = "stash pop"; + sl = "stash list"; + sd = "stash drop"; + + # Tags + tags = "tag -l"; + + # Show + show-files = "show --pretty=\"\" --name-only"; + + # Worktree + wt = "worktree"; + + # Maintenance + cleanup = "!git remote prune origin && git gc && git clean -df && git stash clear"; + + # Find + find = "!git ls-files | grep -i"; + grep = "grep -Ii"; + + # Contributors + contributors = "shortlog --summary --numbered --email"; + + # Current branch + current = "rev-parse --abbrev-ref HEAD"; + + # Ignore + ignore = "!gi() { curl -sL https://www.toptal.com/developers/gitignore/api/$@ ;}; gi"; + }; + + # Global gitignore + ignores = [ + # OS generated files + ".DS_Store" + ".DS_Store?" + "._*" + ".Spotlight-V100" + ".Trashes" + "ehthumbs.db" + "Thumbs.db" + + # Editor files + "*.swp" + "*.swo" + "*~" + ".idea/" + + # Logs + "*.log" + + # Runtime data + "pids" + "*.pid" + "*.seed" + "*.pid.lock" + + # Coverage directory used by tools like istanbul + "coverage/" + + # Dependency directories + "node_modules/" + + # Optional npm cache directory + ".npm" + + # Optional REPL history + ".node_repl_history" + + # Environment variables + ".env.local" + ".env.*.local" + + # Temporary folders + "tmp/" + "temp/" + ]; + }; + + # Delta for better git diffs + programs.git.delta = { + enable = true; + options = { + features = "decorations"; + syntax-theme = "Dracula"; + plus-style = "syntax #003800"; + minus-style = "syntax #3f0001"; + navigate = true; + light = false; + line-numbers = true; + side-by-side = false; + hunk-header-decoration-style = "blue box"; + hunk-header-file-style = "red"; + hunk-header-line-number-style = "#067a00"; + hunk-header-style = "file line-number syntax"; + }; + }; + + # Git hooks (if you want to add any) + # home.file.".config/git/hooks" = { + # source = ./git-hooks; + # recursive = true; + # }; +} diff --git a/config/git/gitconfig.linux b/config/git/gitconfig.linux deleted file mode 100644 index 0528522..0000000 --- a/config/git/gitconfig.linux +++ /dev/null @@ -1,43 +0,0 @@ -[user] - signingkey = ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIM+sKpcREOUjwMMSzEWAso6830wbOi8kUxqpuXWw5gHr - email = menno@vleeuwen.me - name = Menno van Leeuwen - -[gpg] - format = ssh - -[gpg "ssh"] - program = /opt/1Password/op-ssh-sign - -[commit] - gpgsign = true - -[color] - ui = true - -[push] - autoSetupRemote = true - -[pull] - rebase = false - -[filter "lfs"] - process = git-lfs filter-process - required = true - clean = git-lfs clean -- %f - smudge = git-lfs smudge -- %f - -[init] - defaultBranch = main -[credential "https://github.com"] - helper = - helper = !/home/menno/.nix-profile/bin/gh auth git-credential -[credential "https://gist.github.com"] - helper = - helper = !/home/menno/.nix-profile/bin/gh auth git-credential - -[safe] - directory = * - -[alias] - pushall = "!f() { for var in $(git remote show); do echo \"pushing to $var\"; git push $var; done; }; f" diff --git a/config/git/gitconfig.macos b/config/git/gitconfig.macos deleted file mode 100644 index e8b66c7..0000000 --- a/config/git/gitconfig.macos +++ /dev/null @@ -1,16 +0,0 @@ -[user] - signingkey = ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIM+sKpcREOUjwMMSzEWAso6830wbOi8kUxqpuXWw5gHr - email = menno@vleeuwen.me - name = Menno van Leeuwen - -[gpg] - format = ssh - -[commit] - gpgsign = true - -[safe] - directory = * - -[alias] - pushall = "!f() { for var in $(git remote show); do echo \"pushing to $var\"; git push $var; done; }; f" diff --git a/config/home-manager/flake.nix b/config/home-manager/flake.nix deleted file mode 100644 index 0980974..0000000 --- a/config/home-manager/flake.nix +++ /dev/null @@ -1,65 +0,0 @@ -{ - description = "menno's dotfiles"; - - inputs = { - nixpkgs.url = "github:nixos/nixpkgs/nixos-25.05"; - nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable"; - - home-manager = { - url = "github:nix-community/home-manager/release-25.05"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - opnix.url = "github:brizzbuzz/opnix"; - }; - - outputs = - { - self, - nixpkgs, - nixpkgs-unstable, - home-manager, - opnix, - }: - let - system = if builtins.currentSystem == "aarch64-linux" then "aarch64-linux" else "x86_64-linux"; - pkgs = import nixpkgs { - inherit system; - config.allowUnfree = true; - }; - pkgs-unstable = import nixpkgs-unstable { - inherit system; - config.allowUnfree = true; - }; - in - { - homeConfigurations = { - "mennos-desktop" = home-manager.lib.homeManagerConfiguration { - inherit pkgs; - modules = [ ./home.nix ]; - extraSpecialArgs = { - inherit - pkgs - pkgs-unstable - opnix - ; - isServer = false; - hostname = "mennos-desktop"; - }; - }; - - "mennos-laptop" = home-manager.lib.homeManagerConfiguration { - inherit pkgs; - modules = [ ./home.nix ]; - extraSpecialArgs = { - inherit - pkgs - pkgs-unstable - opnix - ; - isServer = false; - hostname = "mennos-laptop"; - }; - }; - }; - }; -} diff --git a/config/home-manager/home.nix b/config/home-manager/home.nix deleted file mode 100644 index 5acf8a7..0000000 --- a/config/home-manager/home.nix +++ /dev/null @@ -1,40 +0,0 @@ -{ - config, - isServer ? false, - opnix, - ... -}: - -{ - programs.home-manager.enable = true; - - nixpkgs.config = { - allowUnfree = true; - allowUnfreePredicate = pkg: true; - }; - - imports = - [ opnix.homeManagerModules.default ./packages/common/default.nix ] - ++ ( - if isServer then - [ - ./packages/server/default.nix - ./server/default.nix - ] - else - [ - ./packages/workstation/default.nix - ./workstation/default.nix - ] - ); - - home = { - username = "menno"; - homeDirectory = "/home/menno"; - stateVersion = "25.05"; - sessionVariables = { - PATH = "${config.home.homeDirectory}/go/bin:$PATH"; - }; - }; - -} diff --git a/config/home-manager/packages/common/bash.nix b/config/home-manager/packages/common/bash.nix deleted file mode 100644 index aa9aab9..0000000 --- a/config/home-manager/packages/common/bash.nix +++ /dev/null @@ -1,31 +0,0 @@ -{ config, pkgs, ... }: - -let - dotfilesPath = builtins.getEnv "DOTFILES_PATH"; -in -{ - programs.bash = { - enable = true; - enableCompletion = true; - - initExtra = '' - if [ -f ~/.bashrc.extra ]; then - source ~/.bashrc.extra - fi - ''; - }; - - programs.fzf = { - enable = true; - enableBashIntegration = true; - defaultCommand = "fd --type f"; - defaultOptions = [ - "--height 40%" - "--layout=reverse" - "--border" - "--inline-info" - "--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'" - ]; - }; -} diff --git a/config/home-manager/packages/common/hosts/default.nix b/config/home-manager/packages/common/hosts/default.nix deleted file mode 100644 index c915eb0..0000000 --- a/config/home-manager/packages/common/hosts/default.nix +++ /dev/null @@ -1 +0,0 @@ -{ ... }: { } diff --git a/config/home-manager/packages/common/hosts/fallback.nix b/config/home-manager/packages/common/hosts/fallback.nix deleted file mode 100644 index 46f1ad7..0000000 --- a/config/home-manager/packages/common/hosts/fallback.nix +++ /dev/null @@ -1,4 +0,0 @@ -{ pkgs-unstable, ... }: -{ - home.packages = with pkgs-unstable; [ ]; -} diff --git a/config/home-manager/packages/common/hosts/mennos-cachyos-desktop.nix b/config/home-manager/packages/common/hosts/mennos-cachyos-desktop.nix deleted file mode 100644 index 46f1ad7..0000000 --- a/config/home-manager/packages/common/hosts/mennos-cachyos-desktop.nix +++ /dev/null @@ -1,4 +0,0 @@ -{ pkgs-unstable, ... }: -{ - home.packages = with pkgs-unstable; [ ]; -} diff --git a/config/home-manager/packages/common/hosts/mennos-cachyos-laptop.nix b/config/home-manager/packages/common/hosts/mennos-cachyos-laptop.nix deleted file mode 100644 index 46f1ad7..0000000 --- a/config/home-manager/packages/common/hosts/mennos-cachyos-laptop.nix +++ /dev/null @@ -1,4 +0,0 @@ -{ pkgs-unstable, ... }: -{ - home.packages = with pkgs-unstable; [ ]; -} diff --git a/config/home-manager/packages/common/hosts/mennos-desktop.nix b/config/home-manager/packages/common/hosts/mennos-desktop.nix deleted file mode 100644 index 46f1ad7..0000000 --- a/config/home-manager/packages/common/hosts/mennos-desktop.nix +++ /dev/null @@ -1,4 +0,0 @@ -{ pkgs-unstable, ... }: -{ - home.packages = with pkgs-unstable; [ ]; -} diff --git a/config/home-manager/packages/common/hosts/mennos-laptop.nix b/config/home-manager/packages/common/hosts/mennos-laptop.nix deleted file mode 100644 index 46f1ad7..0000000 --- a/config/home-manager/packages/common/hosts/mennos-laptop.nix +++ /dev/null @@ -1,4 +0,0 @@ -{ pkgs-unstable, ... }: -{ - home.packages = with pkgs-unstable; [ ]; -} diff --git a/config/home-manager/packages/common/hosts/mennos-server.nix b/config/home-manager/packages/common/hosts/mennos-server.nix deleted file mode 100644 index 46f1ad7..0000000 --- a/config/home-manager/packages/common/hosts/mennos-server.nix +++ /dev/null @@ -1,4 +0,0 @@ -{ pkgs-unstable, ... }: -{ - home.packages = with pkgs-unstable; [ ]; -} diff --git a/config/home-manager/packages/common/hosts/mennos-vm.nix b/config/home-manager/packages/common/hosts/mennos-vm.nix deleted file mode 100644 index 46f1ad7..0000000 --- a/config/home-manager/packages/common/hosts/mennos-vm.nix +++ /dev/null @@ -1,4 +0,0 @@ -{ pkgs-unstable, ... }: -{ - home.packages = with pkgs-unstable; [ ]; -} diff --git a/config/home-manager/packages/common/packages.nix b/config/home-manager/packages/common/packages.nix deleted file mode 100644 index bbe59f7..0000000 --- a/config/home-manager/packages/common/packages.nix +++ /dev/null @@ -1,105 +0,0 @@ -{ - pkgs, - pkgs-unstable, - hostname, - ... -}: -{ - # Import host-specific packages - imports = - if hostname == "mennos-desktop" then - [ ./hosts/mennos-desktop.nix ] - else if hostname == "mennos-laptop" then - [ ./hosts/mennos-laptop.nix ] - else - [ ./hosts/fallback.nix ]; - - home.packages = - with pkgs; - [ - # General packages - git - onefetch - gnupg - gh - nixfmt-rfc-style - nixd - nil - wget - fastfetch - _1password-cli - - # Package management - devbox - - # Development SDKs/Toolkits - gcc - pkg-config - gnumake - stdenv.cc - act # GitHub Actions CLI - - # File and directory operations - eza # Modern ls - bat # Modern cat - broot # Interactive directory navigator - du-dust # Modern du - duf # Modern df - zip - unzip - glances # Advanced system monitoring tool - procs # Modern ps - hyperfine # Benchmarking tool - - # Search and text processing - ripgrep # Modern grep - sd # Modern sed - choose # Modern cut - jq # JSON processor - yq # YAML processor - xan # CSV processor (xsv is no longer maintained) - ncdu # Disk usage analyzer - - # System monitoring and process management - procs # Modern ps - hyperfine # Benchmarking tool - bandwhich # Network utilization tool - doggo # Modern dig - gping # Ping with graph - htop # Interactive process viewer - - # Development utilities - delta # Better git diff - difftastic # Structural diff tool - fzf # Fuzzy finder - tokei # Code statistics - tealdeer # Modern tldr client - lazygit # Terminal UI for git - - # Shell and terminal - starship # Cross-shell prompt - blesh # Bash ble.sh - zellij # Modern terminal multiplexer - screen # Terminal multiplexer - - # File viewers and processors - hexyl # Modern hexdump - chafa # Terminal image viewer - glow # Markdown renderer - - # Editors - neovim - ## Neovim plugins - vimPlugins.LazyVim - - nano - micro - - # Lolz - fortune - cowsay - cmatrix - figlet - lolcat - ]; -} diff --git a/config/home-manager/workstation/dconf.nix b/config/home-manager/workstation/dconf.nix deleted file mode 100644 index f992566..0000000 --- a/config/home-manager/workstation/dconf.nix +++ /dev/null @@ -1,82 +0,0 @@ -{ config, pkgs, ... }: -{ - # GTK Theme - gtk = { - enable = true; - - iconTheme = { - name = "Yaru"; - }; - - theme = { - name = "Yaru-dark"; - }; - - cursorTheme = { - name = "Yaru"; - }; - - gtk3.extraConfig = { - Settings = '' - gtk-application-prefer-dark-theme=1 - ''; - }; - - gtk4.extraConfig = { - Settings = '' - gtk-application-prefer-dark-theme=1 - ''; - }; - }; - # Only apply dconf settings if running GNOME - dconf = pkgs.lib.mkIf (builtins.getEnv "XDG_CURRENT_DESKTOP" == "GNOME") { - enable = true; - settings = { - "org/gnome/desktop/background" = { - show-desktop-icons = true; - }; - - "org/gnome/desktop/applications/file-manager" = { - exec = "nautilus"; - }; - - "org/gnome/desktop/interface" = { - color-scheme = "prefer-dark"; - font-name = "Hack Nerd Font 11"; - monospace-font-name = "Hack Nerd Font Mono 10"; - document-font-name = "Hack Nerd Font 11"; - }; - - # Pinned apps - "org/gnome/shell" = { - favorite-apps = [ - "firefox.desktop" - "nemo.desktop" - "com.spotify.Client.desktop" - "signal-desktop.desktop" - "whatsapp-desktop-client_whatsapp-desktop-client.desktop" - "telegram-desktop_telegram-desktop.desktop" - "code.desktop" - "vesktop.desktop" - "scrcpy.desktop" - ]; - }; - - # GNOME Terminal settings - "org/gnome/Console" = { - use-system-font = false; - custom-font = "Hack Nerd Font 13"; - theme = "night"; - }; - - # Set wallpaper - "org/gnome/desktop/background" = { - picture-uri-dark = "file:///usr/share/backgrounds/Ubuntu_Legacy_by_Aaron_J_Prisk_dark.png"; - picture-uri = "file:///usr/share/backgrounds/Ubuntu_Legacy_by_Aaron_J_Prisk_light.png"; - picture-options = "zoom"; - primary-color = "#000000"; - }; - }; - }; - -} diff --git a/config/home-manager/workstation/gnome-extensions.nix b/config/home-manager/workstation/gnome-extensions.nix deleted file mode 100644 index 4cb5bfe..0000000 --- a/config/home-manager/workstation/gnome-extensions.nix +++ /dev/null @@ -1,314 +0,0 @@ -{ config, pkgs-unstable, pkgs, lib, ... }: - -lib.mkIf (builtins.match ".*GNOME.*" (builtins.getEnv "XDG_CURRENT_DESKTOP") != null) { - # We run most extensions from unstable because they are more up-to-date - home.packages = - with pkgs.gnomeExtensions; - [ - user-themes - weather-oclock - native-window-placement - kimpanel - ] - ++ (with pkgs-unstable.gnomeExtensions; [ - dash-to-panel - arcmenu - lilypad - tailscale-qs - blur-my-shell - gtk4-desktop-icons-ng-ding - media-controls - burn-my-windows - coverflow-alt-tab - appindicator - just-perfection - smile-complementary-extension - clipboard-indicator - ]); - - # Copy burn-my-windows profile to user config - home.file.".config/burn-my-windows/profiles/default.conf".text = '' - [burn-my-windows-profile] - fire-enable-effect=false - tv-glitch-enable-effect=true - tv-glitch-animation-time=250 - ''; - - dconf = { - settings = { - # dash-to-panel - "org/gnome/shell/extensions/dash-to-panel" = { - appicon-padding = 8; - appicon-margin = 4; - trans-panel-opacity = 0.40; - appicon-style = "SYMBOLIC"; - trans-use-custom-opacity = true; - animate-appicon-hover = false; - dot-style-unfocused = "DOTS"; - tray-size = 16; - hoy-keys = true; - panel-element-positions = "{\"0\":[{\"element\":\"showAppsButton\",\"visible\":false,\"position\":\"stackedTL\"},{\"element\":\"activitiesButton\",\"visible\":false,\"position\":\"stackedTL\"},{\"element\":\"leftBox\",\"visible\":true,\"position\":\"stackedTL\"},{\"element\":\"taskbar\",\"visible\":true,\"position\":\"stackedTL\"},{\"element\":\"centerBox\",\"visible\":true,\"position\":\"stackedBR\"},{\"element\":\"rightBox\",\"visible\":true,\"position\":\"stackedBR\"},{\"element\":\"dateMenu\",\"visible\":true,\"position\":\"stackedBR\"},{\"element\":\"systemMenu\",\"visible\":true,\"position\":\"stackedBR\"},{\"element\":\"desktopButton\",\"visible\":true,\"position\":\"stackedBR\"}],\"1\":[{\"element\":\"showAppsButton\",\"visible\":false,\"position\":\"stackedTL\"},{\"element\":\"activitiesButton\",\"visible\":false,\"position\":\"stackedTL\"},{\"element\":\"leftBox\",\"visible\":true,\"position\":\"stackedTL\"},{\"element\":\"taskbar\",\"visible\":true,\"position\":\"stackedTL\"},{\"element\":\"centerBox\",\"visible\":true,\"position\":\"stackedBR\"},{\"element\":\"rightBox\",\"visible\":true,\"position\":\"stackedBR\"},{\"element\":\"dateMenu\",\"visible\":true,\"position\":\"stackedBR\"},{\"element\":\"systemMenu\",\"visible\":true,\"position\":\"stackedBR\"},{\"element\":\"desktopButton\",\"visible\":true,\"position\":\"stackedBR\"}]}"; - }; - - # arcmenu - "org/gnome/shell/extensions/arcmenu" = { - custom-menu-button-icon-size = 32; - menu-layout = "Runner"; - runner-show-frequent-apps = true; - search-provider-open-windows = true; - search-provider-recent-files = true; - highlight-search-terms = true; - max-search-results = 8; - menu-button-icon = "Distro_Icon"; - distro-icon = 5; - arc-menu-icon = 64; - }; - - "org/gnome/shell/extensions/pano" = { - history-length = 500; - global-shortcut = [ "V" ]; - item-date-font-family = "Hack Nerd Font Mono"; - item-date-font-size = 10; - search-bar-font-family = "Hack Nerd Font Mono"; - search-bar-font-size = 14; - item-title-font-family = "Hack Nerd Font Mono"; - item-title-font-size = 20; - }; - - # To get an ID of an extension, run `gnome-extensions list` - "org/gnome/shell" = { - disable-user-extensions = false; - # To get an array like below of currently enabled extensionsm run `gnome-extensions list --enabled | sed 's/.*/"&"/'` - enabled-extensions = [ - "pano@elhan.io" - "tilingshell@ferrarodomenico.com" - "tiling-assistant@ubuntu.com" - "ubuntu-appindicators@ubuntu.com" - "launch-new-instance@gnome-shell-extensions.gcampax.github.com" - "native-window-placement@gnome-shell-extensions.gcampax.github.com" - "user-theme@gnome-shell-extensions.gcampax.github.com" - "appindicatorsupport@rgcjonas.gmail.com" - "arcmenu@arcmenu.com" - "blur-my-shell@aunetx" - "burn-my-windows@schneegans.github.com" - "dash-to-panel@jderose9.github.com" - "just-perfection-desktop@just-perfection" - "kimpanel@kde.org" - "lilypad@shendrew.github.io" - "smile-extension@mijorus.it" - "tailscale@joaophi.github.com" - "weatheroclock@CleoMenezesJr.github.io" - ]; - }; - - # Perfection settings - "org/gnome/shell/extensions/just-perfection" = { - theme = false; - notification-banner-position = 2; - startup-status = 0; - }; - - # Configure logo-menu - "org/gnome/shell/extensions/Logo-menu" = { - hide-icon-shadow = false; - menu-button-extensions-app = "org.gnome.Extensions.desktop"; - menu-button-icon-image = 23; - menu-button-icon-size = 24; - menu-button-system-monitor = "missioncenter"; - show-power-options = false; - symbolic-icon = true; - use-custom-icon = false; - }; - - # Configure covereflow-alt-tab - "org/gnome/shell/extensions/coverflowalttab" = { - animation-time = 0.2; - easing-function = "ease-out-quart"; - icon-has-shadow = true; - icon-style = "Overlay"; - invert-swipes = false; - position = "Top"; - switcher-looping-method = "Flip Stack"; - switcher-style = "Coverflow"; - }; - - # Configure burn-my-windows - "org/gnome/shell/extensions/burn-my-windows" = { - active-profile = "${config.home.homeDirectory}/.config/burn-my-windows/profiles/default.conf"; - }; - - # Configure blur-my-shell - "org/gnome/shell/extensions/blur-my-shell" = { - brightness = 0.75; - noise-amount = 0; - }; - - # Configure tiling shell - "org/gnome/shell/extensions/tilingshell" = { - enable-autotiling = false; - restore-window-original-size = false; - enable-tiling-system-windows-suggestions = true; - layouts-json = '' - [ - { - "id": "Landscape Ultrawide", - "tiles": [ - { "x": 0, "y": 0, "width": 0.22, "height": 0.5, "groups": [1, 2] }, - { "x": 0, "y": 0.5, "width": 0.22, "height": 0.5, "groups": [1, 2] }, - { "x": 0.22, "y": 0, "width": 0.56, "height": 1, "groups": [2, 3] }, - { "x": 0.78, "y": 0, "width": 0.22, "height": 0.5, "groups": [3, 4] }, - { "x": 0.78, "y": 0.5, "width": 0.22, "height": 0.5, "groups": [3, 4] } - ] - }, - { - "id": "Portrait Ultrawide", - "tiles": [ - { "x": 0, "y": 0, "width": 1, "height": 0.25, "groups": [1] }, - { "x": 0, "y": 0.25, "width": 1, "height": 0.5, "groups": [1, 2] }, - { "x": 0, "y": 0.75, "width": 0.5, "height": 0.25, "groups": [2, 3] }, - { "x": 0.5, "y": 0.75, "width": 0.5, "height": 0.25, "groups": [2, 3] } - ] - }, - { - "id": "Landscape Laptop", - "tiles": [ - { "x": 0, "y": 0, "width": 0.5, "height": 0.5, "groups": [1, 2] }, - { - "x": 0.5, - "y": 0, - "width": 0.5, - "height": 1, - "groups": [1] - }, - { - "x": 0, - "y": 0.5, - "width": 0.5, - "height": 0.5, - "groups": [2, 1] - } - ] - }, - { - "id": "Landscape Ultrawide Power-User", - "tiles": [ - { - "x": 0, - "y": 0, - "width": 0.1984375, - "height": 0.5028409090909091, - "groups": [1, 2] - }, - { - "x": 0.1984375, - "y": 0, - "width": 0.3015625, - "height": 1, - "groups": [4, 1] - }, - { - "x": 0, - "y": 0.5028409090909091, - "width": 0.1984375, - "height": 0.49715909090909094, - "groups": [2, 1] - }, - { - "x": 0.8015625, - "y": 0, - "width": 0.1984375, - "height": 1, - "groups": [3] - }, - { - "x": 0.5, - "y": 0, - "width": 0.30156249999999996, - "height": 1, - "groups": [3, 4] - } - ] - } - ] - ''; - overridden-settings = "{\"org.gnome.mutter.keybindings\":{\"toggle-tiled-right\":\"['Right']\",\"toggle-tiled-left\":\"['Left']\"},\"org.gnome.desktop.wm.keybindings\":{\"maximize\":\"['Up']\",\"unmaximize\":\"['Down', 'F5']\"},\"org.gnome.mutter\":{\"edge-tiling\":\"false\"}}"; - }; - - # Configure forge - "org/gnome/shell/extensions/forge" = { - move-pointer-focus-enabled = false; - stacked-tiling-mode-enabled = true; - tabbed-tiling-mode-enabled = true; - tiling-mode-enabled = true; - }; - - "org/gnome/shell/extensions/forge/keybindings" = { - con-split-horizontal = [ "z" ]; - con-split-layout-toggle = [ "g" ]; - con-split-vertical = [ "v" ]; - con-stacked-layout-toggle = [ "s" ]; - con-tabbed-layout-toggle = [ "t" ]; - con-tabbed-showtab-decoration-toggle = [ "y" ]; - focus-border-toggle = [ "x" ]; - prefs-tiling-toggle = [ "w" ]; - window-focus-down = [ "j" ]; - window-focus-left = [ "h" ]; - window-focus-right = [ "l" ]; - window-focus-up = [ "k" ]; - window-gap-size-decrease = [ "minus" ]; - window-gap-size-increase = [ "plus" ]; - window-move-down = [ "j" ]; - window-move-left = [ "h" ]; - window-move-right = [ "l" ]; - window-move-up = [ "k" ]; - window-resize-bottom-decrease = [ "i" ]; - window-resize-bottom-increase = [ "u" ]; - window-resize-left-decrease = [ "o" ]; - window-resize-left-increase = [ "y" ]; - window-resize-right-decrease = [ "y" ]; - window-resize-right-increase = [ "o" ]; - window-resize-top-decrease = [ "u" ]; - window-resize-top-increase = [ "i" ]; - window-snap-center = [ "c" ]; - window-snap-one-third-left = [ "d" ]; - window-snap-one-third-right = [ "g" ]; - window-snap-two-third-left = [ "e" ]; - window-snap-two-third-right = [ ]; - window-swap-down = [ "j" ]; - window-swap-last-active = [ "Return" ]; - window-swap-left = [ "h" ]; - window-swap-right = [ "l" ]; - window-swap-up = [ "k" ]; - window-toggle-always-float = [ "c" ]; - window-toggle-float = [ "c" ]; - workspace-active-tile-toggle = [ "w" ]; - }; - - # User theme - "org/gnome/shell/extensions/user-theme" = { - name = "Yaru-purple-dark"; - }; - - # Lilypad settings - "org/gnome/shell/extensions/lilypad/rightbox-order" = { - - # In case this is updated, run: `dconf read /org/gnome/shell/extensions/lilypad/rightbox-order | tsed "s/,//g; s/'/\"/g ` then copy pasting the output here - rightbox-order = [ - "lilypad" - "system_monitor" - "appindicator_legacy_TelegramDesktop" - "appindicator_legacy_1password" - "spotify_client" - "appindicator_legacy_Electron" - "steam" - "appindicator_legacy_steam" - "workspace_indicator" - "StatusNotifierItem" - "clipboardIndicator" - "screenSharing" - ]; - show-icons = false; - }; - }; - }; -} diff --git a/config/home-manager/workstation/keyboard-shortcuts.nix b/config/home-manager/workstation/keyboard-shortcuts.nix deleted file mode 100644 index 5091b87..0000000 --- a/config/home-manager/workstation/keyboard-shortcuts.nix +++ /dev/null @@ -1,39 +0,0 @@ -{ pkgs, lib, ... }: - -lib.mkIf (builtins.match ".*GNOME.*" (builtins.getEnv "XDG_CURRENT_DESKTOP") != null) { - dconf.settings = { - "org/gnome/shell/keybindings" = { - show-screenshot-ui = [ - "Print" - "4" - ]; - }; - - "org/gnome/settings-daemon/plugins/media-keys" = { - volume-step = 2; - custom-keybindings = [ - "/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/1password-quick-access/" - "/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/missioncenter/" - "/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/terminal/" - "/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/emotes/" - "/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/frog/" - "/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/ulauncher/" - ]; - }; - "org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/1password-quick-access" = { - binding = "space"; - command = "1password --quick-access"; - name = "1password-quick-access"; - }; - "org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/missioncenter" = { - binding = "Escape"; - command = "missioncenter"; - name = "missioncenter"; - }; - "org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/emotes" = { - binding = "e"; - command = "smile"; - name = "emotes"; - }; - }; -} diff --git a/config/nextcloud.cfg b/config/nextcloud.cfg deleted file mode 100644 index b96e2e9..0000000 --- a/config/nextcloud.cfg +++ /dev/null @@ -1,102 +0,0 @@ -[General] -clientVersion=3.16.0-1 (Debian built) -confirmExternalStorage=true -crashReporter=true -desktopEnterpriseChannel=daily -isVfsEnabled=false -launchOnSystemStartup=true -monoIcons=false -moveToTrash=false -newBigFolderSizeLimit=500 -notifyExistingFoldersOverLimit=false -optionalServerNotifications=true -overrideLocalDir= -overrideServerUrl= -promptDeleteAllFiles=false -showCallNotifications=true -showChatNotifications=true -showInExplorerNavigationPane=false -stopSyncingExistingFoldersOverLimit=false -useNewBigFolderSizeLimit=true - -[Accounts] -0\Folders\1\ignoreHiddenFiles=false -0\Folders\1\journalPath=.sync_42a4129584d0.db -0\Folders\1\localPath=/home/menno/Nextcloud/ -0\Folders\1\paused=false -0\Folders\1\targetPath=/ -0\Folders\1\version=2 -0\Folders\1\virtualFilesMode=off -0\Folders\2\ignoreHiddenFiles=false -0\Folders\2\journalPath=.sync_65a742b0aa83.db -0\Folders\2\localPath=/home/menno/Desktop/ -0\Folders\2\paused=false -0\Folders\2\targetPath=/Desktop -0\Folders\2\version=2 -0\Folders\2\virtualFilesMode=off -0\Folders\3\ignoreHiddenFiles=false -0\Folders\3\journalPath=.sync_886cca272fe5.db -0\Folders\3\localPath=/home/menno/Pictures/ -0\Folders\3\paused=false -0\Folders\3\targetPath=/Pictures -0\Folders\3\version=2 -0\Folders\3\virtualFilesMode=off -0\Folders\4\ignoreHiddenFiles=false -0\Folders\4\journalPath=.sync_90ea5e3c7a33.db -0\Folders\4\localPath=/home/menno/Videos/ -0\Folders\4\paused=false -0\Folders\4\targetPath=/Videos -0\Folders\4\version=2 -0\Folders\4\virtualFilesMode=off -0\Folders\5\ignoreHiddenFiles=false -0\Folders\5\journalPath=.sync_65289e64a490.db -0\Folders\5\localPath=/home/menno/Documents/ -0\Folders\5\paused=false -0\Folders\5\targetPath=/Documents -0\Folders\5\version=2 -0\Folders\5\virtualFilesMode=off -0\Folders\6\ignoreHiddenFiles=false -0\Folders\6\journalPath=.sync_884042991bd6.db -0\Folders\6\localPath=/home/menno/3D Objects/ -0\Folders\6\paused=false -0\Folders\6\targetPath=/3D Objects -0\Folders\6\version=2 -0\Folders\6\virtualFilesMode=off -0\Folders\7\ignoreHiddenFiles=false -0\Folders\7\journalPath=.sync_283a65eecb9c.db -0\Folders\7\localPath=/home/menno/Music/ -0\Folders\7\paused=false -0\Folders\7\targetPath=/Music -0\Folders\7\version=2 -0\Folders\7\virtualFilesMode=off -0\authType=webflow -0\dav_user=menno -0\displayName=Menno van Leeuwen -0\encryptionCertificateSha256Fingerprint=@ByteArray() -0\networkDownloadLimit=0 -0\networkDownloadLimitSetting=-2 -0\networkProxyHostName= -0\networkProxyNeedsAuth=false -0\networkProxyPort=0 -0\networkProxySetting=0 -0\networkProxyType=2 -0\networkProxyUser= -0\networkUploadLimit=0 -0\networkUploadLimitSetting=-2 -0\serverColor=@Variant(\0\0\0\x43\x1\xff\xff\x1c\x1c$$<<\0\0) -0\serverHasValidSubscription=false -0\serverTextColor=@Variant(\0\0\0\x43\x1\xff\xff\xff\xff\xff\xff\xff\xff\0\0) -0\serverVersion=31.0.8.1 -0\url=https://drive.mvl.sh -0\version=13 -0\webflow_user=menno -version=13 - -[BWLimit] -downloadLimit=80 -uploadLimit=10 -useDownloadLimit=0 -useUploadLimit=0 - -[Settings] -geometry=@ByteArray(\x1\xd9\xd0\xcb\0\x3\0\0\0\0\b\0\0\0\0\0\0\0\n\xa4\0\0\x2\x8a\0\0\b\0\0\0\0\0\0\0\n\xa4\0\0\x2\x8a\0\0\0\x1\0\0\0\0\x11\x64\0\0\b\0\0\0\0\0\0\0\n\xa4\0\0\x2\x8a) diff --git a/config/ssh/config b/config/ssh/config deleted file mode 100644 index 5ee4aa6..0000000 --- a/config/ssh/config +++ /dev/null @@ -1,8 +0,0 @@ -Host * - AddKeysToAgent yes - ForwardAgent yes - -Include ~/.ssh/config.d/*.conf - -Host * - IdentityAgent ~/.1password/agent.sock diff --git a/config/starship.nix b/config/starship.nix new file mode 100644 index 0000000..0168288 --- /dev/null +++ b/config/starship.nix @@ -0,0 +1,188 @@ +{ + config, + pkgs, + lib, + ... +}: + +{ + programs.starship = { + enable = true; + enableBashIntegration = true; + settings = { + aws = { + symbol = " "; + }; + buf = { + symbol = " "; + }; + c = { + symbol = " "; + }; + conda = { + symbol = " "; + }; + crystal = { + symbol = " "; + }; + dart = { + symbol = " "; + }; + directory = { + read_only = " 󰌾"; + }; + docker_context = { + symbol = " "; + }; + elixir = { + symbol = " "; + }; + elm = { + symbol = " "; + }; + fennel = { + symbol = " "; + }; + fossil_branch = { + symbol = " "; + }; + git_branch = { + symbol = " "; + }; + git_commit = { + tag_symbol = "  "; + }; + golang = { + symbol = " "; + }; + guix_shell = { + symbol = " "; + }; + haskell = { + symbol = " "; + }; + haxe = { + symbol = " "; + }; + hg_branch = { + symbol = " "; + }; + hostname = { + ssh_symbol = " "; + }; + java = { + symbol = " "; + }; + julia = { + symbol = " "; + }; + kotlin = { + symbol = " "; + }; + lua = { + symbol = " "; + }; + memory_usage = { + symbol = "󰍛 "; + }; + meson = { + symbol = "󰔷 "; + }; + nim = { + symbol = "󰆥 "; + }; + nix_shell = { + symbol = " "; + }; + nodejs = { + symbol = " "; + }; + ocaml = { + symbol = " "; + }; + os = { + symbols = { + Alpaquita = " "; + Alpine = " "; + AlmaLinux = " "; + Amazon = " "; + Android = " "; + Arch = " "; + Artix = " "; + CentOS = " "; + Debian = " "; + DragonFly = " "; + Emscripten = " "; + EndeavourOS = " "; + Fedora = " "; + FreeBSD = " "; + Garuda = "󰛓 "; + Gentoo = " "; + HardenedBSD = "󰞌 "; + Illumos = "󰈸 "; + Kali = " "; + Linux = " "; + Mabox = " "; + Macos = " "; + Manjaro = " "; + Mariner = " "; + MidnightBSD = " "; + Mint = " "; + NetBSD = " "; + NixOS = " "; + OpenBSD = "󰈺 "; + openSUSE = " "; + OracleLinux = "󰌷 "; + Pop = " "; + Raspbian = " "; + Redhat = " "; + RedHatEnterprise = " "; + RockyLinux = " "; + Redox = "󰀘 "; + Solus = "󰠳 "; + SUSE = " "; + Ubuntu = " "; + Unknown = " "; + Void = " "; + Windows = "󰍲 "; + }; + }; + package = { + symbol = "󰏗 "; + }; + perl = { + symbol = " "; + }; + php = { + symbol = " "; + }; + pijul_channel = { + symbol = " "; + }; + python = { + symbol = " "; + }; + rlang = { + symbol = "󰟔 "; + }; + ruby = { + symbol = " "; + }; + rust = { + symbol = "󱘗 "; + }; + scala = { + symbol = " "; + }; + swift = { + symbol = " "; + }; + zig = { + symbol = " "; + }; + gradle = { + symbol = " "; + }; + }; + }; +} diff --git a/config/starship.toml b/config/starship.toml deleted file mode 100755 index 8f3da6f..0000000 --- a/config/starship.toml +++ /dev/null @@ -1,170 +0,0 @@ -[aws] -symbol = " " - -[buf] -symbol = " " - -[c] -symbol = " " - -[conda] -symbol = " " - -[crystal] -symbol = " " - -[dart] -symbol = " " - -[directory] -read_only = " 󰌾" - -[docker_context] -symbol = " " - -[elixir] -symbol = " " - -[elm] -symbol = " " - -[fennel] -symbol = " " - -[fossil_branch] -symbol = " " - -[git_branch] -symbol = " " - -[git_commit] -tag_symbol = '  ' - -[golang] -symbol = " " - -[guix_shell] -symbol = " " - -[haskell] -symbol = " " - -[haxe] -symbol = " " - -[hg_branch] -symbol = " " - -[hostname] -ssh_symbol = " " - -[java] -symbol = " " - -[julia] -symbol = " " - -[kotlin] -symbol = " " - -[lua] -symbol = " " - -[memory_usage] -symbol = "󰍛 " - -[meson] -symbol = "󰔷 " - -[nim] -symbol = "󰆥 " - -[nix_shell] -symbol = " " - -[nodejs] -symbol = " " - -[ocaml] -symbol = " " - -[os.symbols] -Alpaquita = " " -Alpine = " " -AlmaLinux = " " -Amazon = " " -Android = " " -Arch = " " -Artix = " " -CentOS = " " -Debian = " " -DragonFly = " " -Emscripten = " " -EndeavourOS = " " -Fedora = " " -FreeBSD = " " -Garuda = "󰛓 " -Gentoo = " " -HardenedBSD = "󰞌 " -Illumos = "󰈸 " -Kali = " " -Linux = " " -Mabox = " " -Macos = " " -Manjaro = " " -Mariner = " " -MidnightBSD = " " -Mint = " " -NetBSD = " " -NixOS = " " -OpenBSD = "󰈺 " -openSUSE = " " -OracleLinux = "󰌷 " -Pop = " " -Raspbian = " " -Redhat = " " -RedHatEnterprise = " " -RockyLinux = " " -Redox = "󰀘 " -Solus = "󰠳 " -SUSE = " " -Ubuntu = " " -Unknown = " " -Void = " " -Windows = "󰍲 " - -[package] -symbol = "󰏗 " - -[perl] -symbol = " " - -[php] -symbol = " " - -[pijul_channel] -symbol = " " - -[python] -symbol = " " - -[rlang] -symbol = "󰟔 " - -[ruby] -symbol = " " - -[rust] -symbol = "󱘗 " - -[scala] -symbol = " " - -[swift] -symbol = " " - -[zig] -symbol = " " - -[gradle] -symbol = " " \ No newline at end of file diff --git a/zed/settings.json b/config/zed.json similarity index 96% rename from zed/settings.json rename to config/zed.json index 54edde6..d25daa8 100644 --- a/zed/settings.json +++ b/config/zed.json @@ -40,7 +40,7 @@ ] } ], - "icon_theme": "Catppuccin Latte", + "icon_theme": "VSCode Icons (Dark)", "ui_font_size": 16, "buffer_font_size": 14, "terminal": { @@ -55,7 +55,7 @@ "theme": { "mode": "system", "light": "Catppuccin Latte", - "dark": "Catppuccin Latte" + "dark": "VSCode Dark Modern" }, "tabs": { "close_position": "right", @@ -68,7 +68,6 @@ "toolbar": { "code_actions": true }, - // ############################################# // ## Preferences ## // ############################################# @@ -85,7 +84,6 @@ "enabled": true, "show_parameter_hints": true }, - // ############################################# // ## AI Stuff ## // ############################################# @@ -111,7 +109,6 @@ "**/secrets/**" ] }, - // ############################################# // ## Extensions ## // ############################################# @@ -122,13 +119,14 @@ "docker-compose": true, "golang": true }, - // ############################################# // ## Languages ## // ############################################# "languages": { "PHP": { - "language_servers": ["phptools"] + "language_servers": [ + "phptools" + ] }, "Dart": { "code_actions_on_format": { @@ -136,7 +134,6 @@ } } }, - "lsp": { "phptools": { "initialization_options": { @@ -144,4 +141,4 @@ } } } -} +} \ No newline at end of file diff --git a/config/home-manager/flake.lock b/flake.lock similarity index 76% rename from config/home-manager/flake.lock rename to flake.lock index 4517577..87d539a 100644 --- a/config/home-manager/flake.lock +++ b/flake.lock @@ -25,11 +25,11 @@ ] }, "locked": { - "lastModified": 1756679287, - "narHash": "sha256-Xd1vOeY9ccDf5VtVK12yM0FS6qqvfUop8UQlxEB+gTQ=", + "lastModified": 1758463745, + "narHash": "sha256-uhzsV0Q0I9j2y/rfweWeGif5AWe0MGrgZ/3TjpDYdGA=", "owner": "nix-community", "repo": "home-manager", - "rev": "07fc025fe10487dd80f2ec694f1cd790e752d0e8", + "rev": "3b955f5f0a942f9f60cdc9cacb7844335d0f21c3", "type": "github" }, "original": { @@ -41,11 +41,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1756886854, - "narHash": "sha256-6tooT142NLcFjt24Gi4B0G1pgWLvfw7y93sYEfSHlLI=", + "lastModified": 1758346548, + "narHash": "sha256-afXE7AJ7MY6wY1pg/Y6UPHNYPy5GtUKeBkrZZ/gC71E=", "owner": "nixos", "repo": "nixpkgs", - "rev": "0e6684e6c5755325f801bda1751a8a4038145d7d", + "rev": "b2a3852bd078e68dd2b3dfa8c00c67af1f0a7d20", "type": "github" }, "original": { @@ -55,22 +55,6 @@ "type": "github" } }, - "nixpkgs-unstable": { - "locked": { - "lastModified": 1756787288, - "narHash": "sha256-rw/PHa1cqiePdBxhF66V7R+WAP8WekQ0mCDG4CFqT8Y=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "d0fc30899600b9b3466ddb260fd83deb486c32f1", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, "nixpkgs_2": { "locked": { "lastModified": 1751011381, @@ -110,7 +94,6 @@ "inputs": { "home-manager": "home-manager", "nixpkgs": "nixpkgs", - "nixpkgs-unstable": "nixpkgs-unstable", "opnix": "opnix" } }, diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..b7a56c1 --- /dev/null +++ b/flake.nix @@ -0,0 +1,53 @@ +{ + description = "menno's dotfiles"; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-25.05"; + home-manager = { + url = "github:nix-community/home-manager/release-25.05"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + opnix.url = "github:brizzbuzz/opnix"; + }; + + outputs = + { + self, + nixpkgs, + home-manager, + opnix, + }: + let + supportedSystems = [ + "x86_64-linux" + "aarch64-linux" + ]; + forAllSystems = nixpkgs.lib.genAttrs supportedSystems; + pkgsFor = + system: + import nixpkgs { + inherit system; + config.allowUnfree = true; + }; + in + { + homeConfigurations = + let + mkHomeConfig = + system: hostname: isServer: + home-manager.lib.homeManagerConfiguration { + pkgs = pkgsFor system; + modules = [ ./home.nix ]; + extraSpecialArgs = { + pkgs = pkgsFor system; + inherit opnix isServer hostname; + }; + }; + in + { + "mennos-vps" = mkHomeConfig "aarch64-linux" "mennos-vps" true; + "mennos-desktop" = mkHomeConfig "x86_64-linux" "mennos-desktop" false; + "mennos-laptop" = mkHomeConfig "x86_64-linux" "mennos-laptop" false; + }; + }; +} diff --git a/home.nix b/home.nix new file mode 100644 index 0000000..f06f3e9 --- /dev/null +++ b/home.nix @@ -0,0 +1,54 @@ +{ + config, + lib, + isServer ? false, + opnix, + ... +}: + +{ + options = { + isServer = lib.mkOption { + type = lib.types.bool; + default = false; + }; + }; + + imports = [ + opnix.homeManagerModules.default + ./config/default.nix + ./packages/common/default.nix + ] + ++ ( + if isServer then + [ + ./packages/server/default.nix + ./server/default.nix + ] + else + [ + ./packages/workstation/default.nix + ./workstation/default.nix + ] + ); + + config = { + isServer = isServer; + + programs.home-manager.enable = true; + + nixpkgs.config = { + allowUnfree = true; + allowUnfreePredicate = pkg: true; + }; + + home = { + username = "menno"; + homeDirectory = "/home/menno"; + stateVersion = "25.05"; + sessionVariables = { + PATH = "${config.home.homeDirectory}/go/bin:$PATH"; + }; + }; + }; +} diff --git a/config/home-manager/packages/common/default.nix b/packages/common/default.nix similarity index 100% rename from config/home-manager/packages/common/default.nix rename to packages/common/default.nix diff --git a/packages/common/packages.nix b/packages/common/packages.nix new file mode 100644 index 0000000..73bbb2b --- /dev/null +++ b/packages/common/packages.nix @@ -0,0 +1,93 @@ +{ + pkgs, + hostname, + ... +}: +{ + home.packages = with pkgs; [ + # General packages + git + onefetch + gnupg + gh + nixfmt-rfc-style + nixd + nil + wget + fastfetch + _1password-cli + + # Package management + devbox + + # Development SDKs/Toolkits + gcc + pkg-config + gnumake + stdenv.cc + act # GitHub Actions CLI + + # File and directory operations + eza # Modern ls + bat # Modern cat + broot # Interactive directory navigator + du-dust # Modern du + duf # Modern df + zip + unzip + glances # Advanced system monitoring tool + procs # Modern ps + hyperfine # Benchmarking tool + + # Search and text processing + ripgrep # Modern grep + sd # Modern sed + choose # Modern cut + jq # JSON processor + yq # YAML processor + xan # CSV processor (xsv is no longer maintained) + ncdu # Disk usage analyzer + + # System monitoring and process management + procs # Modern ps + hyperfine # Benchmarking tool + bandwhich # Network utilization tool + doggo # Modern dig + gping # Ping with graph + htop # Interactive process viewer + + # Development utilities + delta # Better git diff + difftastic # Structural diff tool + fzf # Fuzzy finder + tokei # Code statistics + tealdeer # Modern tldr client + lazygit # Terminal UI for git + + # Shell and terminal + starship # Cross-shell prompt + blesh # Bash ble.sh + zellij # Modern terminal multiplexer + screen # Terminal multiplexer + + # File viewers and processors + hexyl # Modern hexdump + chafa # Terminal image viewer + glow # Markdown renderer + + # Editors + neovim + ## Neovim plugins + vimPlugins.LazyVim + + nano + micro + + # Lolz + fortune + cowsay + cmatrix + figlet + lolcat + ]; +} diff --git a/config/home-manager/packages/common/secrets.nix b/packages/common/secrets.nix similarity index 100% rename from config/home-manager/packages/common/secrets.nix rename to packages/common/secrets.nix diff --git a/config/home-manager/packages/server/default.nix b/packages/server/default.nix similarity index 100% rename from config/home-manager/packages/server/default.nix rename to packages/server/default.nix diff --git a/config/home-manager/packages/server/packages.nix b/packages/server/packages.nix similarity index 100% rename from config/home-manager/packages/server/packages.nix rename to packages/server/packages.nix diff --git a/config/home-manager/packages/workstation/default.nix b/packages/workstation/default.nix similarity index 100% rename from config/home-manager/packages/workstation/default.nix rename to packages/workstation/default.nix diff --git a/config/home-manager/packages/workstation/fix-electron-apps.sh b/packages/workstation/fix-electron-apps.sh similarity index 100% rename from config/home-manager/packages/workstation/fix-electron-apps.sh rename to packages/workstation/fix-electron-apps.sh diff --git a/config/home-manager/packages/workstation/packages.nix b/packages/workstation/packages.nix similarity index 98% rename from config/home-manager/packages/workstation/packages.nix rename to packages/workstation/packages.nix index 1e1b77d..f6e7a2b 100644 --- a/config/home-manager/packages/workstation/packages.nix +++ b/packages/workstation/packages.nix @@ -1,4 +1,4 @@ -{ pkgs-unstable, pkgs, ... }: +{ pkgs, ... }: let # Create a script to fix electron apps fix-electron-apps = pkgs.writeScriptBin "fix-electron-apps" ( @@ -23,6 +23,7 @@ in qrencode # qr code generator grimblast # Screenshot tool gpredict # Satellite tracking + scrcpy ## Multimedia plex-media-player diff --git a/config/home-manager/packages/workstation/php.nix b/packages/workstation/php.nix similarity index 100% rename from config/home-manager/packages/workstation/php.nix rename to packages/workstation/php.nix diff --git a/config/home-manager/server/default.nix b/server/default.nix similarity index 100% rename from config/home-manager/server/default.nix rename to server/default.nix diff --git a/setup.sh b/setup.sh index 88f0049..b70abd9 100755 --- a/setup.sh +++ b/setup.sh @@ -169,7 +169,7 @@ validate_hostname() { update_home_manager_flake() { local hostname="$1" local isServer="$2" - local flake_file="$DOTFILES_PATH/config/home-manager/flake.nix" + local flake_file="$DOTFILES_PATH/flake.nix" # Create new configuration entry local new_config=" \"$hostname\" = home-manager.lib.homeManagerConfiguration { diff --git a/vscode/argv.json b/vscode/argv.json deleted file mode 100644 index 1013ec4..0000000 --- a/vscode/argv.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "enable-crash-reporter": true, -} diff --git a/vscode/settings.json b/vscode/settings.json deleted file mode 100755 index 5bcaa41..0000000 --- a/vscode/settings.json +++ /dev/null @@ -1,86 +0,0 @@ -{ - "security.workspace.trust.untrustedFiles": "open", - "editor.fontFamily": "Hack Nerd Font", - "terminal.integrated.fontFamily": "Hack Nerd Font", - "github.copilot.enable": { - "*": true - }, - "git.autofetch": true, - "[jsonc]": { - "editor.defaultFormatter": "esbenp.prettier-vscode" - }, - "[json]": { - "editor.defaultFormatter": "vscode.json-language-features" - }, - "vsicons.dontShowNewVersionMessage": true, - "debug.internalConsoleOptions": "openOnSessionStart", - - "[go]": { - "editor.tabSize": 4, - "editor.renderWhitespace": "all" - }, - - "[nix]": { - "editor.formatOnSave": true, - "editor.formatOnType": true - }, - - "[dart]": { - "editor.formatOnSave": false, - "editor.formatOnType": false, - "editor.rulers": [120], - "editor.selectionHighlight": false, - "editor.tabCompletion": "onlySnippets", - "editor.wordBasedSuggestions": "off" - }, - "remote.SSH.remotePlatform": { - "mennos-laptop-w": "linux", - "mennos-desktop": "linux", - "cloud": "linux" - }, - "editor.tabSize": 2, - "editor.insertSpaces": true, - "editor.detectIndentation": true, - "editor.autoIndent": "full", - "debug.inlineValues": "on", - "git.confirmSync": false, - "[dockercompose]": { - "editor.defaultFormatter": "ms-azuretools.vscode-docker" - }, - "go.toolsManagement.autoUpdate": true, - "redhat.telemetry.enabled": false, - "makefile.configureOnOpen": false, - "dart.debugExternalPackageLibraries": true, - "dart.debugSdkLibraries": true, - "dart.warnWhenEditingFilesOutsideWorkspace": false, - "window.confirmSaveUntitledWorkspace": false, - "git.openRepositoryInParentFolders": "never", - "debug.toolBarLocation": "commandCenter", - "workbench.colorTheme": "Catppuccin Latte", - "ansible.lightspeed.enabled": false, - "ansible.lightspeed.suggestions.enabled": false, - "docker.extension.enableComposeLanguageServer": false, - "roo-cline.allowedCommands": [ - "npm test", - "npm install", - "tsc", - "git log", - "git diff", - "git show" - ], - "roo-cline.deniedCommands": [], - "kilo-code.allowedCommands": [ - "npm test", - "npm install", - "tsc", - "git log", - "git diff", - "git show", - "flutter analyze", - "flutter", - "make" - ], - "kilo-code.deniedCommands": [], - "github.copilot.nextEditSuggestions.enabled": true, - "workbench.iconTheme": "vscode-icons" -} diff --git a/config/home-manager/workstation/default.nix b/workstation/default.nix similarity index 100% rename from config/home-manager/workstation/default.nix rename to workstation/default.nix diff --git a/config/home-manager/workstation/fonts.nix b/workstation/fonts.nix similarity index 100% rename from config/home-manager/workstation/fonts.nix rename to workstation/fonts.nix diff --git a/workstation/gtk-theme.nix b/workstation/gtk-theme.nix new file mode 100644 index 0000000..c408495 --- /dev/null +++ b/workstation/gtk-theme.nix @@ -0,0 +1,31 @@ +{ config, pkgs, ... }: +{ + # GTK Theme + gtk = { + enable = true; + + iconTheme = { + name = "Yaru"; + }; + + theme = { + name = "Yaru-dark"; + }; + + cursorTheme = { + name = "Yaru"; + }; + + gtk3.extraConfig = { + Settings = '' + gtk-application-prefer-dark-theme=1 + ''; + }; + + gtk4.extraConfig = { + Settings = '' + gtk-application-prefer-dark-theme=1 + ''; + }; + }; +}