A fedora-toolbox pull dies inside the user namespace ('requested 998:998
for /var/lib/unbound') when the user has no /etc/subuid and /etc/subgid
range, and distrobox only shows podman's unpack error. dot boxes now
checks both files and prints the usermod + podman system migrate fix
before pulling; dot doctor reports the same condition.
tests/boxes-subid.sh covers range summing, small ranges and the hint.
dotfiles
A reproducible dev environment for the Steam Deck (SteamOS), Fedora KDE, Arch and CachyOS. Almost everything lives in $HOME, so a SteamOS update that wipes /usr and /etc can't break it. Re-running dot system puts back the few root-owned pieces.
| Layer | Tool | Lives in |
|---|---|---|
| CLI tools, shell, git, ssh, KDE config | Nix + home-manager (this flake) + plasma-manager | /nix (on SteamOS: /home/.steamos/offload/nix), ~ |
| Language runtimes + npm/GitHub CLIs | mise (programs.mise.globalConfig) |
~/.local/share/mise |
| GUI apps | Flatpak, user scope (config/flatpaks.txt) |
~/.local/share/flatpak |
| Secrets (SSH keys, MCP tokens, WireGuard) | Bitwarden CLI (dot secrets) |
~/.config/dotfiles/secrets.env, ~/.ssh |
| Root bits (distro pkgs, browser policies, netbird + Defguard units, login shell) | dot system (sudo) |
/etc |
flowchart LR
B[bootstrap.sh] --> P[distro pkgs<br/>git curl zsh podman distrobox flatpak]
B --> N[Nix<br/>single-user on SteamOS/containers<br/>Determinate elsewhere]
N --> HM[home-manager switch<br/>profile full | headless]
HM --> S[system: browser PWA policies,<br/>netbird unit, chsh zsh]
S --> A[apps: Flatpaks, mise tools,<br/>Claude Code]
A --> W[wallpapers repo]
A -. manual .-> SEC[dot secrets pull<br/>Bitwarden]
Fresh Fedora KDE webtop after bootstrap.sh, light and dark (Plasma's day/night switch also swaps the slideshow folder):
| Light | Dark |
|---|---|
![]() |
![]() |
Install
export GITEA_TOKEN=... # read access to ziadarafat/dotfiles + wallpapers
curl -fsSL -H "Authorization: token $GITEA_TOKEN" \
https://gitea.godemperordoge.org/ziadarafat/dotfiles/raw/branch/main/bootstrap.sh | bash
| Env var | Effect |
|---|---|
DOTFILES_PROFILE=headless |
No KDE, Flatpaks, Konsole or themes (servers, SSH-only boxes, non-KDE desktops). Default: full when Plasma is present. |
DOTFILES_SKIP_SYSTEM=1 |
Never call sudo. Everything in $HOME still works. |
DOTFILES_DIR |
Checkout location (default ~/.dotfiles). |
On the personal desktop, dot apps gives the Chrome Flatpak user-scoped
write access to the two host directories used for web app launchers and
icons. Re-run dot apps to apply it to an existing installation, then quit
and reopen Chrome.
On SteamOS, the one sudo prompt makes /nix owned by deck. Nix then runs in single-user mode, with no daemon and no units in /etc.
Set up the Bitwarden CLI
Run these steps in the same terminal. If bw or dot is missing after
bootstrap, open a new terminal to pick up the installed tools.
-
Run
dot profileandbw status. Check the server URL before signing in.Profile Vaultwarden server full,headlesshttps://vault.godemperordoge.orgfull-workhttps://vault.etvamerica.comIf the server is wrong and the CLI is already signed in, run
bw logoutandunset BW_SESSION. Then configure the matching URL. For example, on a personal machine:bw --nointeraction config server https://vault.godemperordoge.org bw statusFor a custom instance, set
BW_SERVERto the same URL in the shell where you rundot secrets. -
Sign in using the method your vault requires. The personal Vaultwarden requires Authentik SSO. Run this from a local desktop terminal so your browser can complete the CLI's sign-in:
bw login --sso && BW_SESSION="$(bw unlock --raw)" && export BW_SESSIONIf the personal vault prompts for an organization identifier, enter
vaultwarden. It is a placeholder for the self-hosted server's single identity provider. For a work vault that requires SSO, use the identifier supplied by your organization. Sign into the browser first, then use your vault master password to unlock the CLI. If password login reports SSO sign-in is required, use this SSO flow.For a server that allows password login, capture the session without printing it:
BW_SESSION="$(bw login 'your-vault-email@example.com' --raw)" && export BW_SESSIONIf your server permits personal API-key login, you can use
bw login --apikeyand thenbw unlock --raw. The personal API key is available under Settings → Security → Keys in the web vault.If
bw statusalready showslocked, skip login and run onlyBW_SESSION="$(bw unlock --raw)" && export BW_SESSION. If it showsunlockedin this terminal and the server is correct, continue. -
Check that
bw statusshowsunlockedand the expected server. Import the dotfiles secrets, then lock the vault when finished.dot secrets pull bw lock unset BW_SESSIONUse
dot secrets pull --wireguardin place ofdot secrets pullonly if you also want to import the saved WireGuard connections into NetworkManager. The session key belongs in the current terminal only. See the Bitwarden CLI guide for login and unlock details, and Git authentication for the separate Git credential sessions.
Back up and restore the secretctl store
With bw unlocked on the intended vault, run this on the source machine:
dot secrets push-secretctl
This saves all entries as encrypted secure-note parts to stay below Bitwarden’s Notes limit. The manifest points to the newest complete snapshot. Older parts stay in the vault. Restore also accepts the original single-note backup format. On the destination machine, unlock the same vault and restore the snapshot:
dot secrets pull-secretctl
secretctl check
The default file is ~/secrets.txt (or $SECRETCTL_FILE, if set). Restore
creates a validated 0600 file and refuses to replace an existing file.
To restore separately for review, run
dot secrets pull-secretctl "$HOME/secrets-restored.txt" and validate it
with secretctl --file "$HOME/secrets-restored.txt" check.
These commands keep the secretctl entries separate from dot secrets pull
and its shell-sourced secrets.env.
After importing your secrets:
dot boxes # create the general and etv Distrobox containers
dot doctor
Manual sign-ins that can't be automated: Edge (work account), Chrome and Firefox (personal account), XPipe (GitHub token for RustyRaptor/xpipe-sync on first launch), and the Bitwarden desktop app and browser extension. The extension comes back through browser sync.
Desktop profiles
Git uses your personal GitHub email (anonymous0programmer@gmail.com) for full
and headless, and ziad.arafat@etvamerica.com for full-work. Both desktop
profiles install SourceGit, with browser OAuth and encrypted keyring storage
for GitHub and the appropriate Gitea origin. Headless uses terminal token prompts
and an in-memory cache. All profiles can read matching Git credentials from an
explicitly unlocked Bitwarden vault. See Git authentication
for first login, vault selection and migration from plaintext credentials.
full is the personal desktop and includes Codex alongside Claude. Codex is managed by Nix and updated by dot switch after updating flake inputs. Sign in with codex on first use; credentials stay outside this repository.
Agent environments
For full and headless, Claude's generated settings include a SessionStart hook that appends
eval "$(mise hook-env -s bash)" to CLAUDE_ENV_FILE, so its Bash commands load
the mise environment. The hook is harmless when that variable is unset.
Codex loads ~/.codex/hooks.json from this checkout after dot switch. Its
SessionStart hook instructs the agent to use mise exec -- <command> from the
project directory. Codex has no CLAUDE_ENV_FILE equivalent, so environment
changes made inside a startup hook do not persist into later tool commands.
Review and trust the new hook with /hooks in Codex before it runs; existing
Codex configuration and credentials remain machine-local. See the
Codex hook documentation.
Work desktop
full-work inherits the full desktop with these changes:
- Excludes Chrome and its managed PWAs, Telegram, Vesktop (including its settings), Krita, Defguard and the Portal 2 sound builder. Edge and its work PWAs remain.
- Uses only the Work activity and Ace Combat wallpapers, with light/dark switching. On login, other activities are removed. Wallpaper checkout uses sparse checkout to exclude the personal folder.
- Keeps notification sounds and volume feedback enabled with the default KDE Ocean sound theme.
- Excludes Codex; Claude remains available with no dotfiles-managed settings,
CLAUDE.md, or MCP configuration.dot secrets renderleaves any existing Claude configuration untouched. Switching to this profile removes the Home Manager-managed Claude settings/instructions links; independently created configuration is retained.
Apply on a desktop with:
dot profile full-work
dot switch
dot system
dot apps
dot wallpapers
Log out and back in to apply the activity layout. Flatpak installation is additive: switching an existing personal machine does not uninstall previously installed applications or games, or remove their data. A previously installed Defguard root service must be disabled separately. The profile does not install Portal 2 or require its assets.
For a fresh installation, set DOTFILES_PROFILE=full-work. headless remains the CLI-only profile. Run bash tests/profiles.sh to check the profile boundaries without applying them.
Day to day
| Command | What |
|---|---|
dot sync |
git pull --ff-only then switch — apply small dotfiles edits without upgrading anything (see below) |
dot update |
git pull, switch, flatpak update, mise upgrade, claude update |
dot update --inputs |
same, plus bump flake.lock (nixpkgs, home-manager, plasma-manager, konsole_daynight) |
dot update --switch-only |
alias for dot sync |
dot switch |
apply after editing Nix files, without pulling first |
dot profile headless / full / full-work / auto |
switch layers; then dot switch |
dot secrets push |
upload this machine's secrets.env, SSH keys and WireGuard configs to Bitwarden |
dot defguard |
preconfigure the Defguard VPN app for the home lab (see below) |
dot wallpapers --push |
re-sort the wallpapers from the external drive and push them |
dot sounds |
build the Portal 2 sound theme from your Steam install |
dot doctor |
what's installed or missing |
dot update versus dot sync
dot update is a maintenance run: process upgrades for Flatpak, mise and Claude
Code, a missing-app check (dot apps) and, with --inputs, a flake.lock bump.
That is slow and unnecessary when you only changed a dotfiles file — a secretctl
edit or a new package does not touch flake.lock.
dot sync does the small-change path and nothing else:
dot sync # git -C ~/.dotfiles pull --ff-only, then home-manager switch
dot sync headless # same, switching to another profile
dot update --switch-only # alias for dot sync
It never runs flatpak update, mise upgrade, claude update, dot apps or
nix flake update; dot sync --inputs is refused rather than ignored. Two
exceptions worth knowing:
- A newly added package is still built once.
secretctlcomes frompkgs/and is compiled from source, so the first build may fetch a Go toolchain and build dependencies far bigger than the tool. Later syncs reuse the store path. If that build printsgit-minimal/store-lock timeouts, another Home Manager run is in progress — see the next point. - Switches are serialised.
dot switch,dot syncanddot updatetake$HOME/.config/dotfiles/switch.lock; a second run prints the running pid and waits instead of competing for the Nix store. Nothing needs to be started in a second terminal — start one and let it finish. If you did start two, cancel the newer one in its own terminal.
Run bash tests/sync.sh to check that the sync path stays upgrade-free.
dot doctor checks Nix startup, store/database access, broken profile links,
daemon versus single-user setup, nix-command and flakes, and the checkout's
flake files. This catches interrupted installers and feature overrides before
dot switch fails. Probes are bounded and read-only; a failed daemon connection
gets a different repair hint from a single-user store problem. Doctor also
checks the profile's Git credential tools and desktop SourceGit/OAuth helper.
In a Distrobox with a shared home, a Home Manager nix.conf symlink can point
into the host's store while that store is absent inside the container. Doctor
reports this explicitly. dot nix and dot switch preserve a broken config
link as nix.conf.broken-link.* and create a writable bootstrap config enabling
nix-command and flakes. Existing readable settings are preserved when adding
features; healthy managed configurations remain linked. You can recover with
git -C ~/.dotfiles pull followed by dot nix and dot switch.
dot also replaces an absent/unreadable inherited Nix CA-bundle path with a
readable local system bundle (including Fedora/AlmaLinux's /etc/pki path),
while preserving valid custom bundles and keeping TLS verification enabled.
Switches use timestamped hm-bak.* backup suffixes so an older hm-bak cannot
block recovery or be overwritten.
Apps that write their own settings (Claude Code, pi, Vesktop, Konsole profiles, VSCodium, Zed, ~/.ssh/config) are linked out of the Nix store into this checkout. Changes made in the app show up in git diff, so commit them.
What's in it
- Shell: zsh + oh-my-zsh (
xiong-chiamiov-plus, git, virtualenv, archlinux, autosuggestions, syntax highlighting), direnv + nix-direnv, fzf, btop.fastfetchshows apokemon-go-colorscriptssprite: Rotom by default, in a form chosen by distro (Deck: normal, Fedora: fan, Arch/CachyOS: heat, Alma: frost, Debian: wash, other: mow), 10 % shiny. Override in~/.config/dotfiles/local.zsh:POKEMON=pikachu POKEMON_SHINY_PERCENT=25 # or POKEFETCH=0 - Dev: mise (node 24, uv, python 3.13, go, deno, java, pi, pokemon-go-colorscripts), git + lfs, tea, gh, bitwarden-cli, gitea-mcp, nmap, rclone, jq/yq, ripgrep/fd, netbird, XPipe (nixpkgs 24.6). Claude Code uses its native installer, so it keeps auto-updating.
- Agents:
config/claude/{settings.json,CLAUDE.md}linked into~/.claude. MCP servers come fromconfig/claude/mcp.jsonandconfig/pi/mcp.jsontemplates with${TOKEN}placeholders, rendered bydot secrets render. - SSH:
config/ssh/config(all work and homelab hosts). Machine-only hosts go in~/.ssh/config.local. - Containers:
config/distrobox/distrobox.ini. Podman and distrobox come from the distro, and SteamOS ships both. - GUI (full profile):
- Flatpaks: Zed, VSCodium, Kate, Bruno, Bitwarden, Edge, Chrome, Chromium, Firefox, Telegram, Vesktop, GIMP, Krita, Blender, OBS, Kdenlive, VLC, mpv, Okular, LibreOffice, Filelight, Aurynk, Flatseal.
- PWAs are force-installed by managed policies (
config/browsers/*-pwas.json→/etc/opt/{chrome,edge}/policies/managed). Flathub's Chrome and Edge read those through/run/host. - Theme: Utterly Nord, with two wrapper global themes (
dotfiles.nord.light/.dark) that keep the Utterly colours, Round decorations, Tela-circle-nord icons and Nordic cursors, but use Breeze widgets (no Kvantum on SteamOS) and never touch the wallpaper. Plasma's automatic light/dark switching flips between them on the knighttime schedule. Night Light follows the same schedule (3700 K). - Accent colour from wallpaper is on, so each slideshow change re-tints the UI.
- Panel: the Deck's layout plus four system monitors (per-core CPU bars, per-disk horizontal bars, network line graph, RAM ring with %) and a clock with Local, Arizona, Pacific, Central, Eastern, London and Beijing (scroll to cycle).
- Activities: Personal (Pokémon, 10 s slideshow) and Work (Ace Combat, 15 min slideshow).
daynight-hookspoints each at itslight/ordark/folder as the theme flips, and also sets Konsole's default profile at login. - Konsole:
Light(Solarized Light) /Dark(Breeze) profiles switched by konsole_daynight, packaged from source with Nix's PyGObject.general/etvprofiles open the distroboxes. - Defguard VPN (home lab,
vpn.godemperordoge.org): the desktop client is repackaged from the official.debinpkgs/defguard-client.nix, so it runs natively on SteamOS (no WebKitGTK 4.1 there).dot systeminstalls its root service (config/defguard/defguard-service.service, groupdefguard, aresolvconf→resolvectlshim where needed). Setup tokens are single-use and expire in 24 h, so Bitwarden holds a Defguard API token instead: create one in Defguard (your profile → API tokens) once,dot secrets set DEFGUARD_API_TOKEN, then on each new machine rundot defguardfrom home or over the VPN. It mints a fresh token and writes~/.local/share/net.defguard/provisioning.json, and the app sets itself up on its next start; you only sign in with Doge Home Lab. - Sounds:
dot soundsextracts Portal 2 sounds from your local Steam install (game assets stay out of git) into~/.local/share/sounds/portal2. Mapping:config/sounds/portal2.json.
What belongs in dotfiles (and what does not)
home-manager switch links files and reloads the user systemd manager. It does
not own everything that manager runs, so anything it reports about units may be
about the host, not about this repository.
Declared here (systemd.user.*) |
Where | Profile | Why it belongs |
|---|---|---|---|
handoff, handoff-probe + timer |
home/agents.nix |
all | ship bin/handoff/bin/free-agent from this repo |
fix-container-desktop-files (path + oneshot) |
home/gui/apps.nix |
gui only | runs this repo's launcher rewriter |
konsole-daynight, daynight-hooks |
home/gui/daynight.nix |
gui only | wrap the konsole_daynight flake input |
notification-sounds |
home/gui/sounds.nix |
gui only | plays the sound theme dot sounds builds |
pi-workers |
config/systemd/user/ |
linked by hand | not installed by home-manager; wire it with home.file or drop it |
Everything else under ~/.config/systemd/user on a machine (edge metrics, relays,
study timers) is a hand-written one-off. dot doctor lists those separately.
Two classes of unit must stay out of dotfiles:
- Desktop-session units the distro or the desktop environment owns, above all
xdg-desktop-portal*. Nix cannot know whether a session has a display, the distro already defines them in/usr/lib/systemd/user, and shadowing them breaks the desktop. Dotfiles' job on those is at most to mask them on headless hosts. - Root/system units (netbird, Defguard, podman).
dot systemputs those in/etc; they are not user-manager state and cannot be switched per profile.
"The user systemd session is degraded"
Home Manager's reloadSystemd step asks systemctl --user is-system-running
before reloading and prints every failed unit. It starts none of them and cannot
clear them, so the same two lines reappear on every dot switch until the state is
reset. On a headless machine the usual cause is a portal unit: something asks D-Bus
for org.freedesktop.portal.Desktop (an agent CLI with notification support, an
Electron app), systemd starts the distro's xdg-desktop-portal-gtk, that process
has no display, and it times out into a failed state.
dot doctor # session state, failed units, restart loops, unmanaged units
dot doctor --fix # reset-failed the units it found (the session stops looking degraded)
systemctl --user mask xdg-desktop-portal xdg-desktop-portal-gtk # headless: stop the retries
warning: unknown setting 'eval-cores' / 'lazy-trees' during activation is the
same kind of noise: those keys are Determinate Nix settings in /etc/nix/nix.conf,
while this repo pins nix.package = pkgs.nix (upstream) so the same flake works on
SteamOS and in containers. The warnings are harmless.
Custom Pokémon rules
Reusable rules live in config/pokefetch, including the Arceus holiday/weather preset and the Lugia day/night example. Add future presets there and enable one from your machine-local settings.
Simple settings still work in ~/.config/dotfiles/local.zsh: POKEMON, POKEMON_FORM and POKEMON_SHINY_PERCENT.
For normal Lugia during the day and Shadow Lugia at night, add:
source "$DOTFILES_DIR/config/pokefetch/lugia-daynight.zsh"
The example uses local time: day starts at 07:00 and night at 19:00. Optionally set POKEFETCH_DAY_START=8 and POKEFETCH_NIGHT_START=20 in local.zsh. It checks the time each time pokefetch runs; an already printed sprite stays as it is.
For full control, define your own function in local.zsh instead:
pokefetch_args() {
reply=(--no-title --name lugia)
if pokefetch_is_night; then
reply+=(--form shadow)
fi
# Optional: choose shininess, size, another Pokémon, or --random here.
# (( RANDOM % 100 < 10 )) && reply+=(--shiny)
# reply+=(--big)
return 0
}
Set reply to a Zsh array with one element per argument. The hook replaces all generated arguments, including Pokémon, form, title and shiny settings; POKEMON* defaults are ignored while it is defined. It runs directly as a function, so ordinary shell logic works without eval or parsing printed text. Return success with a nonempty array. Hook errors or colorscript errors fall back to plain fastfetch with a diagnostic.
Open a new terminal after dot switch, or reload and preview:
source "$DOTFILES_DIR/home/files/pokefetch.zsh"
source ~/.config/dotfiles/local.zsh
pokefetch
Use pokemon-go-colorscripts --help for options and --list for Pokémon names. To restore the default behavior in the current shell, run unfunction pokefetch_args and remove the hook/source line from local.zsh. POKEFETCH=0 still disables pokefetch altogether.
Selkies / Fedora containers
Bootstrap exports a missing USER from id -un and enables Nix flakes even when Nix is already installed. Container detection supports Podman, Docker and the container environment variable. Containers skip Flatpaks, distrobox setup, and host VPN daemon setup.
On Fedora containers, dot apps automatically installs the selected desktop profile natively. On a Fedora desktop, use dot apps --native to select the same path explicitly. Fedora RPMs are installed with DNF; apps unavailable in the enabled repositories fall back to Nix using this repo's pinned nixpkgs input. Re-running skips Nix packages already installed. Run dot apps --native again after updating inputs to install newer Nix app versions; old profile entries can be removed with nix profile remove.
The mapping is in config/fedora-apps.tsv, filtered through the same profile selection as Flatpaks. Flatseal is skipped because it manages Flatpaks; Aurynk is skipped with a warning because no native package is configured. Native app failures are reported and return a nonzero status. Native mode requires sudo for RPMs and a working Nix installation. Non-Fedora containers skip desktop app installation with an explanation. DOTFILES_SKIP_SYSTEM=1 skips the bootstrap system layer; it does not prevent explicit native app installation from using sudo.
Testing
tests/container-test.sh IMAGE PROFILE runs the bootstrap from scratch in a throwaway Podman container, copying in the current checkout:
tests/container-test.sh docker.io/archlinux:latest headless
tests/container-test.sh docker.io/cachyos/cachyos:latest headless
WEBTOP=1 tests/container-test.sh lscr.io/linuxserver/webtop:fedora-kde full webtop # KDE desktop at :3901
Gotchas
home-manager switchruns with--impure, because user, home and distro are read from the environment. That's how one flake servesdeck,abcandziadarafat.- Flatpak doesn't work inside unprivileged containers (webtops).
dot appswarns and moves on. - Plasma only applies panel changes from plasma-manager at the next login. Its panel script deletes
plasma-org.kde.plasma.desktop-appletsrcfirst, sodaynight-hooksre-applies the wallpapers 20 s after login. - Sensor IDs in the panel monitors are regexes. Avoid backslashes in them: KConfig unescapes them, and the JSON list then fails to parse.
- Managed browser policies show "Managed by your organization" in Chrome and Edge. That's expected.
dot boxesfails mid-pull withpotentially insufficient UIDs or GIDs available in user namespace (requested 998:998 for /var/lib/unbound)when rootless podman has no/etc/subuid//etc/subgidrange for you: the fedora-toolbox image contains uid 998 and the layer unpack cannot map it.dot boxespreflights this anddot doctorreports it, but the fix is root:If the store was created without a mapping,grep -E "^$(id -un):" /etc/subuid /etc/subgid # empty or a tiny range? sudo usermod --add-subuids 100000-165535 --add-subgids 100000-165535 "$(id -un)" podman system migrate # rebuild the mapping; keeps imagespodman system reset(deletes images and containers) thendot boxesagain.

