Update flake inputs and flake.lock to Nix/nixpkgs and home-manager release 25.11; bump home.stateVersion and setup script NIXOS_RELEASE. Migrate git config to new Home Manager layout (programs.git.settings, aliases under settings.alias), adjust delta config path, and reorganize SSH into matchBlocks with enableDefaultConfig=false to avoid global leaks. Simplify snapd session variable handling to avoid recursion. Misc: tweak Dashy title, replace du-dust->dust and plex-media-player -> plex-desktop, remove unused hostname arg, and add GitHub Copilot instructions document.
2.9 KiB
2.9 KiB
GitHub Copilot Instructions
Project Overview
This repository manages system configurations (dotfiles) using a hybrid approach:
- Nix (Home Manager): Manages user environment, CLI tools, and dotfile symlinks.
- Ansible: Manages system-level configurations, services (Docker containers), and secrets.
- Python (
dotf): A custom CLI wrapper to orchestrate updates and maintenance.
Architecture
Nix & Home Manager
- Entry Point:
flake.nixdefineshomeConfigurationsfor each host (e.g.,mennos-desktop,mennos-server). - Configuration:
home.nixis the main module, conditionally importing frompackages/andserver/orworkstation/based on theisServerflag. - Packages: Defined in
packages/{common,server,workstation}/packages.nix.
Ansible
- Playbook:
ansible/playbook.ymlis the main entry point. - Inventory:
ansible/inventory.inidefines host groups (workstations,servers). All connections arelocal. - Tasks: Organized in
ansible/tasks/:global/: Applied to all hosts.servers/: Applied to server hosts.workstations/: Applied to workstation hosts.
- Services: Docker services are defined in
ansible/tasks/servers/services/.
CLI Tool (dotf)
- Location:
bin/dotf(entry point) andbin/actions/(logic). - Purpose: Abstracts complex
home-managerandansible-playbookcommands.
Critical Workflows
Applying Changes
Do not run home-manager or ansible-playbook directly unless debugging. Use the dotf CLI:
- Update everything:
dotf update - Update only Home Manager:
dotf update --ha - Update only Ansible:
dotf update --ansible - Run specific Ansible tags:
dotf update --tags <tag_name>(e.g.,dotf update --tags caddy)
Adding Packages
- Identify if the package is for
common,server, orworkstation. - Edit the corresponding
packages/<type>/packages.nix. - Add the package name to the
home.packageslist.
Adding Services (Servers)
- Create a new YAML file in
ansible/tasks/servers/services/<service_name>/. - Define the Docker container and related configuration.
- Ensure the task is imported in
ansible/tasks/servers/server.yml(or the relevant parent file).
Conventions & Patterns
- Secrets: Use 1Password integration. Secrets are fetched via the custom lookup plugin or
opCLI. - Host-Specific Logic:
- Nix: Use the
isServerargument or checkhostnamein modules. - Ansible: Use
when: inventory_hostname in [...]or group-based imports inplaybook.yml.
- Nix: Use the
- Path References: Use
{{ playbook_dir }}in Ansible and relative paths in Nix. - Python Scripts: Located in
bin/, usehelpers.functionsfor common output formatting (printfe).
Key Files
flake.nix: Host definitions.home.nix: Main Home Manager config.ansible/playbook.yml: Main Ansible playbook.bin/actions/update.py: The update logic implementation.