-
Notifications
You must be signed in to change notification settings - Fork 5
feat: add custom instructions, refactor sway and mkinitcpio #151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
8cdc430
d0f2c47
bfc46a0
69762c8
4ae5e9a
cb0d9a6
635e254
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,98 @@ | ||
| # Copilot Instructions - Archlinux Ansible Provisioner | ||
|
|
||
| ## Project Overview | ||
| This is an Ansible-based provisioner for setting up complete Archlinux systems with desktop environments, development tools, and personal configurations. It operates in two phases: **bootstrap** (initial system setup from live USB) and **system** (post-installation configuration). | ||
|
|
||
| ## Architecture & Workflow | ||
|
|
||
| ### Two-Phase Installation | ||
| 1. **Bootstrap Phase**: Runs from Archlinux live USB to install base system via `pacstrap` | ||
| - Command: `make bootstrap CONFIG=./config/default.yaml` | ||
| - Configures locale, timezone, users, disk encryption (LUKS + BTRFS) | ||
|
|
||
| 2. **System Phase**: Runs on installed system for desktop environment and packages | ||
| - Command: `make local-install CONFIG=./config/default.yaml` | ||
| - Installs GNOME/Sway/i3, development tools, SparkFabrik-specific configurations | ||
|
|
||
| ### Role-Based Structure | ||
| All functionality is organized in `playbooks/roles/`: | ||
| - `bootstrap/`: Base system installation and user creation | ||
| - `system/`: Core services (audio, bluetooth, printing, power management) | ||
| - `packages/`: Software installation organized by category (development.yml, multimedia.yml, etc.) | ||
| - `gnome/`: Desktop environment with extensions and dconf settings | ||
| - `docker/`: Container runtime with custom network tools | ||
| - `nvidia/amd/`: Graphics driver installation with hybrid graphics support | ||
| - `sparkfabrik/`: Company-specific tools, wallpapers, and configurations | ||
|
|
||
| ## Configuration System | ||
|
|
||
| ### YAML Schema Validation | ||
| - Configuration in `config/default.yaml` validated against `config/schemas/configuration.schema.yaml` | ||
| - Use `make validate-json-schema` before any installation | ||
| - Desktop environments are conditionally enabled via config flags (`desktop.gnome`, `desktop.sway`, etc.) | ||
|
|
||
| ### Key Configuration Patterns | ||
| ```yaml | ||
| system: | ||
| hostname: paolo | ||
| username: paolo | ||
| kernel: standard # or zen, lts, hardened | ||
| desktop: | ||
| gnome: | ||
| extensions: [list-of-extension-ids] | ||
| keybindings: | ||
| open_terminal_shortcut: "<Super>Return" | ||
| dconf: | ||
| use_mouse_natural_scroll: true | ||
| ``` | ||
|
|
||
| ## Development Workflows | ||
|
|
||
| ### Local Testing & Iteration | ||
| - `make local-install-tags TAGS=gnome-config` - Run specific role tags | ||
| - `make local-install-apps` - Install only packages role | ||
| - `make regenerate-mkinitcpio-grub` - Rebuild bootloader after kernel changes | ||
|
|
||
| ### Package Management Patterns | ||
| - Official packages: `community.general.pacman` module | ||
| - AUR packages: `kewlfft.aur.aur` module with `paru` helper | ||
| - Special `aur_builder` user created for AUR installations without sudo password | ||
|
|
||
| ### Docker-Based Tooling | ||
| - `make build-docker-tools` - Build validation container with Node.js tools | ||
| - `make validate-json-schema` - Validate configuration files | ||
| - `make yaml-to-json` - Convert YAML templates to JSON | ||
|
|
||
| ## Key Conventions | ||
|
|
||
| ### Task Organization | ||
| - Each role's `main.yml` imports category-specific task files | ||
| - Use descriptive block names with appropriate tags: `[packages, dev, cloudnative]` | ||
| - Hardware-specific roles (nvidia, amd, logitech) use feature detection | ||
|
|
||
| ### File Management | ||
| - Custom scripts and binaries in `files/bin/` directories | ||
| - Desktop environment configs in role-specific `files/` subdirectories | ||
| - System configuration files in `system/files/` (mkinitcpio.conf, systemd services) | ||
|
|
||
| ### Conditional Logic | ||
| - Use `when:` conditions for hardware detection (e.g., nvidia-prime for hybrid graphics) | ||
| - Enable desktop environments via configuration flags, not hardcoded values | ||
| - Company-specific features controlled by `sparkfabrik: true` flag | ||
|
|
||
| ## Critical Integration Points | ||
|
|
||
| ### Disk Encryption & BTRFS | ||
| - LUKS encryption with BTRFS subvolumes: `@`, `@home`, `@snapshots`, `@home.snapshots` | ||
| - Bootloader installation varies by encryption: `install-grub-with-encryption` vs `install-grub-no-encryption` | ||
|
|
||
| ### Chroot Operations | ||
| - System phase runs inside `arch-chroot /mnt` during initial installation | ||
| - Files copied to `/mnt/root/provisioner` before chroot execution | ||
|
|
||
| ### AUR Package Installation | ||
| - Creates temporary `aur_builder` user with sudo privileges for makepkg/pacman | ||
| - All AUR operations must use `become_user: aur_builder` | ||
| - Paru AUR helper installed automatically if not present | ||
|
|
||
| When modifying this provisioner, ensure configuration schema validation passes and test changes with tag-specific runs before full system installation. |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -2,60 +2,73 @@ | |||||
| - name: Install base packages | ||||||
| tags: [packages, base] | ||||||
| block: | ||||||
| - name: Network packages | ||||||
| community.general.pacman: | ||||||
| name: | ||||||
| - dnsutils | ||||||
| - dhcpcd | ||||||
| - iproute2 | ||||||
| - gnu-netcat | ||||||
| - net-tools | ||||||
| - tcpdump | ||||||
| - wpa_supplicant | ||||||
| - name: Ensure not installed packages are absent | ||||||
| community.general.pacman: | ||||||
| name: | ||||||
| - glances | ||||||
| state: absent | ||||||
|
|
||||||
| - name: System packages | ||||||
| community.general.pacman: | ||||||
| name: | ||||||
| - ansible | ||||||
| - bashtop | ||||||
| - bc | ||||||
| - lm_sensors | ||||||
| - coreutils | ||||||
| - usbutils | ||||||
| - dmidecode | ||||||
| - base-devel | ||||||
| - bash-completion | ||||||
| - dialog | ||||||
| - dmidecode | ||||||
| - glances | ||||||
| - flatpak | ||||||
| - fastfetch | ||||||
| - pacman-contrib | ||||||
| - gparted | ||||||
| - htop | ||||||
| - mesa | ||||||
| - p7zip | ||||||
| - git | ||||||
| - tree | ||||||
| - usbutils | ||||||
| - tmux | ||||||
| - zsh | ||||||
| - zsh-completions | ||||||
| - lshw | ||||||
| - deja-dup | ||||||
| - vim | ||||||
| - name: Network packages | ||||||
| community.general.pacman: | ||||||
| name: | ||||||
| - dnsutils | ||||||
| - dhcpcd | ||||||
| - iproute2 | ||||||
| - gnu-netcat | ||||||
| - net-tools | ||||||
| - tcpdump | ||||||
| - wpa_supplicant | ||||||
|
|
||||||
| - name: System packges from aur | ||||||
| kewlfft.aur.aur: | ||||||
| use: paru | ||||||
| name: | ||||||
| - downgrade | ||||||
| - inxi | ||||||
| - git-credential-manager-bin | ||||||
| - glxinfo | ||||||
| - flatseal | ||||||
| become: yes | ||||||
| become_user: aur_builder | ||||||
| - name: System packages | ||||||
| community.general.pacman: | ||||||
| name: | ||||||
| - ansible | ||||||
| - bashtop | ||||||
| - lm_sensors | ||||||
| - coreutils | ||||||
| - usbutils | ||||||
| - dmidecode | ||||||
|
||||||
| - base-devel | ||||||
| - bash-completion | ||||||
| - dialog | ||||||
| - dmidecode | ||||||
| - glances | ||||||
|
||||||
| - glances | |
| # - glances |
Copilot
AI
Nov 2, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The package 'thefuck' is duplicated in the package list (appears on both line 48 and line 53).
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| HOOKS=(base udev autodetect keyboard modconf block encrypt filesystems resume fsck) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The package 'usbutils' appears twice in the system packages list (lines 30 and 54). Remove one of the duplicate entries.