diff options
| author | 2026-09-24 11:34:23 +0000 | |
|---|---|---|
| committer | 2026-09-24 11:34:23 +0000 | |
| commit | 096e82ca45a5360b4b2dd084e0fb1a937a227a69 (patch) | |
| tree | 47e6a3757da156f37606bef55812783a18856847 /modules/nixos | |
| parent | d09bdcd6b9fd6d815d6272a7bc337b410b19b665 (diff) | |
| download | desktop-flake-096e82ca45a5360b4b2dd084e0fb1a937a227a69.tar.gz desktop-flake-096e82ca45a5360b4b2dd084e0fb1a937a227a69.tar.bz2 desktop-flake-096e82ca45a5360b4b2dd084e0fb1a937a227a69.zip | |
Switch Docker to rootful after the rootless setup broke in practice
Rootless Docker's per-user systemd unit didn't start in a session
that was already logged in before a switch, and DOCKER_HOST only
reaches freshly-started shells -- both bit Tom immediately (docker
run failed against the default rootful socket path, which never
existed under rootless). virtualisation.docker.enable = true now
runs dockerd as a standard root system service, started at boot;
tom joins the docker group for sudo-less access. Trades rootless's
isolation guarantee for reliability on a long-lived desktop session.
Archives switch-docker-rootful and syncs the container-runtime
capability's requirements and Purpose text to match.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HngxrvqEzq8oBEBDtrYJyB
Diffstat (limited to 'modules/nixos')
| -rw-r--r-- | modules/nixos/common.nix | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/modules/nixos/common.nix b/modules/nixos/common.nix index 10f48c6..9ee164b 100644 --- a/modules/nixos/common.nix +++ b/modules/nixos/common.nix | |||
| @@ -18,7 +18,10 @@ | |||
| 18 | 18 | ||
| 19 | users.users.tom = { | 19 | users.users.tom = { |
| 20 | isNormalUser = true; | 20 | isNormalUser = true; |
| 21 | extraGroups = [ "wheel" ]; | 21 | extraGroups = [ |
| 22 | "wheel" | ||
| 23 | "docker" | ||
| 24 | ]; | ||
| 22 | shell = pkgs.bash; | 25 | shell = pkgs.bash; |
| 23 | # Fetched once from https://github.com/tomvanderlee.keys and pinned here | 26 | # Fetched once from https://github.com/tomvanderlee.keys and pinned here |
| 24 | # as a static literal (not fetched at build time, which would require | 27 | # as a static literal (not fetched at build time, which would require |
| @@ -69,9 +72,10 @@ | |||
| 69 | openFirewall = true; | 72 | openFirewall = true; |
| 70 | }; | 73 | }; |
| 71 | 74 | ||
| 72 | # Rootless: runs as the user's own systemd user service, not as root, and | 75 | # Rootful: standard system service, starts at boot independent of any |
| 73 | # has no docker-group privilege-escalation path. setSocketVariable exports | 76 | # login session (rootless was tried first but its per-user systemd unit |
| 74 | # DOCKER_HOST automatically so the docker CLI (dev-tools.nix) just works. | 77 | # didn't reliably start in already-logged-in sessions after a switch). |
| 75 | virtualisation.docker.rootless.enable = true; | 78 | # tom's docker group membership is root-equivalent access, accepted here |
| 76 | virtualisation.docker.rootless.setSocketVariable = true; | 79 | # for reliability over the rootless isolation guarantee. |
| 80 | virtualisation.docker.enable = true; | ||
| 77 | } | 81 | } |
