diff options
| author | 2026-09-18 15:36:22 +0200 | |
|---|---|---|
| committer | 2026-09-18 15:36:22 +0200 | |
| commit | 302961367a4e04cd411c5ca282acd3b1479947a4 (patch) | |
| tree | bd9c05ed929c1ce7acd81a3870df16bf1044bd14 | |
| parent | d4437daf6fa0c0e8142ef51d16d5bf04d6cd15db (diff) | |
| download | desktop-flake-302961367a4e04cd411c5ca282acd3b1479947a4.tar.gz desktop-flake-302961367a4e04cd411c5ca282acd3b1479947a4.tar.bz2 desktop-flake-302961367a4e04cd411c5ca282acd3b1479947a4.zip | |
Enable GNOME desktop by default on every NixOS host
Add GDM+GNOME, NetworkManager, PipeWire audio, and CUPS+Avahi
printing to modules/nixos/common.nix, applied unconditionally to
every NixOS host built from this flake, per add-gnome-desktop.
nix flake check remains unverified: Nix isn't installed on this
machine and no live NixOS host exists yet to boot-test against.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BBSd4VBfoKHjE1HR3P8kmn
| -rw-r--r-- | README.md | 6 | ||||
| -rw-r--r-- | modules/nixos/common.nix | 19 | ||||
| -rw-r--r-- | openspec/changes/add-gnome-desktop/tasks.md | 16 |
3 files changed, 32 insertions, 9 deletions
| @@ -6,7 +6,7 @@ A single Nix flake for provisioning both NixOS hosts and non-NixOS systems (any | |||
| 6 | 6 | ||
| 7 | - `flake.nix` — inputs (`nixpkgs`, `home-manager`) and outputs (`nixosConfigurations`, `homeConfigurations`, `formatter`, `devShells`) | 7 | - `flake.nix` — inputs (`nixpkgs`, `home-manager`) and outputs (`nixosConfigurations`, `homeConfigurations`, `formatter`, `devShells`) |
| 8 | - `lib/` — `mkNixos` and `mkHome` helper functions that build `nixosConfigurations` / `homeConfigurations` entries | 8 | - `lib/` — `mkNixos` and `mkHome` helper functions that build `nixosConfigurations` / `homeConfigurations` entries |
| 9 | - `modules/nixos/common.nix` — shared NixOS-only system settings applied to every NixOS host: flakes enabled, `tom` user (bash as the login shell), locale/timezone defaults, gc policy, sshd (key-only auth) with a firewall allowing port 22 | 9 | - `modules/nixos/common.nix` — shared NixOS-only system settings applied to every NixOS host: flakes enabled, `tom` user (bash as the login shell), locale/timezone defaults, gc policy, sshd (key-only auth) with a firewall allowing port 22, and a GNOME desktop (GDM login, NetworkManager, PipeWire audio, CUPS+Avahi printing) — see below |
| 10 | - `modules/home/` — the shared, cross-platform home-manager profile (shell, editor, CLI tools, dev tools, dotfiles). The same modules are consumed whether activated via a NixOS host's home-manager module or standalone `home-manager switch` | 10 | - `modules/home/` — the shared, cross-platform home-manager profile (shell, editor, CLI tools, dev tools, dotfiles). The same modules are consumed whether activated via a NixOS host's home-manager module or standalone `home-manager switch` |
| 11 | - `users/tom.nix` — identity/profile file consumed by both `mkNixos` and `mkHome` | 11 | - `users/tom.nix` — identity/profile file consumed by both `mkNixos` and `mkHome` |
| 12 | - `hosts/template/` — a copy-source-only NixOS host skeleton; **never** wired into `flake.nix` outputs directly (excluded from discovery by name — see below). Copy it via `scripts/bootstrap-host.sh` (or `nix run .#bootstrap-host`) when provisioning a real machine | 12 | - `hosts/template/` — a copy-source-only NixOS host skeleton; **never** wired into `flake.nix` outputs directly (excluded from discovery by name — see below). Copy it via `scripts/bootstrap-host.sh` (or `nix run .#bootstrap-host`) when provisioning a real machine |
| @@ -33,6 +33,10 @@ This flake does not partition disks for you — do that first, with the standard | |||
| 33 | 8. Reboot and remove the install media. | 33 | 8. Reboot and remove the install media. |
| 34 | 9. Afterwards, clone the flake to a stable path (e.g. `/etc/nix-config`) so future updates are just `sudo nixos-rebuild switch --flake /etc/nix-config#<real-hostname>`. | 34 | 9. Afterwards, clone the flake to a stable path (e.g. `/etc/nix-config`) so future updates are just `sudo nixos-rebuild switch --flake /etc/nix-config#<real-hostname>`. |
| 35 | 35 | ||
| 36 | ## Desktop environment | ||
| 37 | |||
| 38 | Every NixOS host built from this flake boots into a GNOME desktop by default (GDM as the login manager), applied unconditionally in `modules/nixos/common.nix` rather than as a per-host opt-in. Necessary companions are enabled alongside it: `networking.networkmanager` (GNOME's own network settings UI), `services.pipewire` + `security.rtkit` (audio, including PulseAudio-compatible clients), and `services.printing` (CUPS) + `services.avahi` (`nssmdns4`, `openFirewall`) for printing and network/AirPrint printer discovery — `openFirewall` is required so mDNS discovery traffic isn't blocked by the port-22-only firewall this repo already enables. This is a system-level toggle only; per-user GNOME customization (dconf, Shell extensions) is out of scope. | ||
| 39 | |||
| 36 | ## Installing on a non-NixOS system (any Linux, or macOS once supported) | 40 | ## Installing on a non-NixOS system (any Linux, or macOS once supported) |
| 37 | 41 | ||
| 38 | Non-NixOS hosts are unaffected by `bootstrap-host` — there's nothing per-host to scaffold. `homeConfigurations` has one generic entry per platform (`tom@linux` for x86_64-linux, `tom@darwin` for aarch64-darwin), shared by every standalone machine of that platform. | 42 | Non-NixOS hosts are unaffected by `bootstrap-host` — there's nothing per-host to scaffold. `homeConfigurations` has one generic entry per platform (`tom@linux` for x86_64-linux, `tom@darwin` for aarch64-darwin), shared by every standalone machine of that platform. |
diff --git a/modules/nixos/common.nix b/modules/nixos/common.nix index df947c0..1b34e4e 100644 --- a/modules/nixos/common.nix +++ b/modules/nixos/common.nix | |||
| @@ -38,4 +38,23 @@ | |||
| 38 | enable = true; | 38 | enable = true; |
| 39 | allowedTCPPorts = [ 22 ]; | 39 | allowedTCPPorts = [ 22 ]; |
| 40 | }; | 40 | }; |
| 41 | |||
| 42 | services.xserver.enable = true; | ||
| 43 | services.displayManager.gdm.enable = true; | ||
| 44 | services.desktopManager.gnome.enable = true; | ||
| 45 | |||
| 46 | networking.networkmanager.enable = true; | ||
| 47 | |||
| 48 | services.pipewire = { | ||
| 49 | enable = true; | ||
| 50 | pulse.enable = true; | ||
| 51 | }; | ||
| 52 | security.rtkit.enable = true; | ||
| 53 | |||
| 54 | services.printing.enable = true; | ||
| 55 | services.avahi = { | ||
| 56 | enable = true; | ||
| 57 | nssmdns4 = true; | ||
| 58 | openFirewall = true; | ||
| 59 | }; | ||
| 41 | } | 60 | } |
diff --git a/openspec/changes/add-gnome-desktop/tasks.md b/openspec/changes/add-gnome-desktop/tasks.md index e30615d..0e9cfb0 100644 --- a/openspec/changes/add-gnome-desktop/tasks.md +++ b/openspec/changes/add-gnome-desktop/tasks.md | |||
| @@ -1,23 +1,23 @@ | |||
| 1 | ## 1. GNOME desktop and login manager | 1 | ## 1. GNOME desktop and login manager |
| 2 | 2 | ||
| 3 | - [ ] 1.1 In `modules/nixos/common.nix`, add `services.xserver.enable = true;` — verify by reading the file | 3 | - [x] 1.1 In `modules/nixos/common.nix`, add `services.xserver.enable = true;` — verify by reading the file |
| 4 | - [ ] 1.2 Add `services.displayManager.gdm.enable = true;` and `services.desktopManager.gnome.enable = true;` — verify by reading the added block, and flag the option-path uncertainty from design.md (post-migration `services.displayManager.*`/`services.desktopManager.*` vs. older `services.xserver.displayManager.*`/`services.xserver.desktopManager.*`) as a known risk to re-check once `nix flake check` can run | 4 | - [x] 1.2 Add `services.displayManager.gdm.enable = true;` and `services.desktopManager.gnome.enable = true;` — verify by reading the added block, and flag the option-path uncertainty from design.md (post-migration `services.displayManager.*`/`services.desktopManager.*` vs. older `services.xserver.displayManager.*`/`services.xserver.desktopManager.*`) as a known risk to re-check once `nix flake check` can run |
| 5 | 5 | ||
| 6 | ## 2. Networking and audio companions | 6 | ## 2. Networking and audio companions |
| 7 | 7 | ||
| 8 | - [ ] 2.1 Add `networking.networkmanager.enable = true;` — verify by reading the added line | 8 | - [x] 2.1 Add `networking.networkmanager.enable = true;` — verify by reading the added line |
| 9 | - [ ] 2.2 Add `services.pipewire = { enable = true; pulse.enable = true; };` and `security.rtkit.enable = true;` — verify by reading the added block | 9 | - [x] 2.2 Add `services.pipewire = { enable = true; pulse.enable = true; };` and `security.rtkit.enable = true;` — verify by reading the added block |
| 10 | 10 | ||
| 11 | ## 3. Printing | 11 | ## 3. Printing |
| 12 | 12 | ||
| 13 | - [ ] 3.1 Add `services.printing.enable = true;` — verify by reading the added line | 13 | - [x] 3.1 Add `services.printing.enable = true;` — verify by reading the added line |
| 14 | - [ ] 3.2 Add `services.avahi = { enable = true; nssmdns4 = true; openFirewall = true; };` — verify by reading the added block, and confirm `openFirewall = true` is present so mDNS/printer discovery isn't blocked by the firewall enabled in `add-developer-environment` | 14 | - [x] 3.2 Add `services.avahi = { enable = true; nssmdns4 = true; openFirewall = true; };` — verify by reading the added block, and confirm `openFirewall = true` is present so mDNS/printer discovery isn't blocked by the firewall enabled in `add-developer-environment` |
| 15 | 15 | ||
| 16 | ## 4. Documentation | 16 | ## 4. Documentation |
| 17 | 17 | ||
| 18 | - [ ] 4.1 Update `README.md` to document that NixOS hosts from this flake now boot into GNOME (GDM login) by default, with NetworkManager, PipeWire, and CUPS+Avahi printing enabled as necessary companions — verify by reading the updated section for consistency with the actual module changes | 18 | - [x] 4.1 Update `README.md` to document that NixOS hosts from this flake now boot into GNOME (GDM login) by default, with NetworkManager, PipeWire, and CUPS+Avahi printing enabled as necessary companions — verify by reading the updated section for consistency with the actual module changes |
| 19 | 19 | ||
| 20 | ## 5. Validation | 20 | ## 5. Validation |
| 21 | 21 | ||
| 22 | - [ ] 5.1 Run `nix flake check` and confirm `modules/nixos/common.nix` still evaluates without error with the new services added, resolving the option-path question from task 1.2 (blocked — Nix is not installed on this machine, and there's still no live NixOS host to boot; run this once Nix/a real host are available — this is the real acceptance gate, not the individual checkboxes above) | 22 | - [ ] 5.1 Run `nix flake check` and confirm `modules/nixos/common.nix` still evaluates without error with the new services added, resolving the option-path question from task 1.2 (blocked — Nix is not installed on this machine, and there's still no live NixOS host to boot; run this once Nix/a real host are available — this is the real acceptance gate, not the individual checkboxes above) |
| 23 | - [ ] 5.2 Manually trace through each spec scenario in `specs/gnome-desktop/spec.md` against the implemented module, confirming each is satisfied by inspection given #5.1 cannot run locally | 23 | - [x] 5.2 Manually trace through each spec scenario in `specs/gnome-desktop/spec.md` against the implemented module, confirming each is satisfied by inspection given #5.1 cannot run locally |
