# Ubuntu machines Ubuntu machines are managed in layers: | Layer | Where | Applied by | |---|---|---| | User env: CLI tools, dotfiles, fonts, ssh hosts | `hosts/ubuntu/home.nix` | Home Manager | | Desktop apps (flatpak) | `services.flatpak` in `hosts/ubuntu/home.nix` | nix-flatpak, on HM activation | | OS packages | `apt-packages.txt` | `bootstrap.sh` | | Third-party apt repos (tailscale, Dux Labs PPA for niri, Noctalia) | `bootstrap.sh` | `bootstrap.sh` | | niri + Noctalia config | `home-modules/niri` | Home Manager (validated at build time) | | System config files | `etc/**`, mirrored into `/etc` | `bootstrap.sh` | | Self-updating tools from upstream installers (mise, herdr, tuicr) into `~/.local/bin` | `bootstrap.sh` | `bootstrap.sh tools` (kept up to date with update commands) | ## Fresh machine ```sh sudo apt install -y git curl git clone ~/nixos ~/nixos/ubuntu/bootstrap.sh sudo tailscale up # log out and back in ``` After that: - `homesw`: Home Manager only. - `syssw`: everything (same as running `bootstrap.sh`). ## Keyboard (keyd) `etc/keyd/default.conf` applies to every keyboard except YubiKeys. The IQUNIX MG75 (`etc/keyd/iqunix.conf`) skips the Alt/Meta swap; the Glove80 (`etc/keyd/glove80.conf`) keeps only the meta layer: - Caps Lock and Left Control are swapped. - Left Alt and Left Meta are swapped, so the key next to space is Meta. - Meta+C, Meta+V and Meta+X copy, paste and cut. keyd sends Ctrl+Insert, Shift+Insert and Ctrl+X, the same as omarchy's Hyprland binds. These work in GTK/Qt apps, browsers and Electron. Ghostty gets the matching bindings in `home-modules/ghostty-config.nix`. - Meta+Left/Right become Home/End, macOS-style. Niri's Mod+arrow binds never fire as a result; use Mod+H/J/K/L. To test keyd: `sudo keyd.rvaiya monitor`. To bypass a broken config: press Backspace+Escape+Enter together, which kills keyd. ## Desktop (niri + Noctalia) GNOME stays installed. Pick **Niri** or **Ubuntu** in the GDM session menu (gear icon on the password screen). - niri comes from `ppa:duxlabs/dux-repo`, pinned so the PPA's other packages don't replace Ubuntu's. Noctalia (bar, launcher, lock, idle, wallpaper) comes from `pkg.noctalia.dev`. - Config: `home-modules/niri/config.kdl` and `home-modules/niri/noctalia.toml`. `homesw` fails if either doesn't validate. - Noctalia's settings UI writes to `~/.local/state/noctalia/settings.toml`, which overrides `noctalia.toml`. Copy the keepers into the repo. - Because of keyd, Mod+C/V/X never reach niri: center is on Mod+Backslash and floating is on Mod+P. Mod+Shift+/ lists the binds. - Closing the lid suspends only on battery, so a Bluetooth keyboard or mouse can wake the screens while docked. ## TODO - [ ] **YubiKey**: port `modules/nixos/yubikey` and `home-modules/sops.nix`. ykman and pcscd from apt, the udev rule plus yubikey-up/down scripts in `etc/`, the sops age key from cold storage, and the `id_yubikey` identity files in the ssh config. - [ ] **system-manager**: explore [numtide/system-manager](https://github.com/numtide/system-manager) to move `etc/` and the systemd service setup into Nix.