Add README and DECISIONS
This commit is contained in:
1 parent
00cbdfceea
commit
090699ca64
2 files changed
+170
No files matched your search
@@ -0,0 +1,79 @@
|
||||
# Decisions
|
||||
|
||||
## 2026-08-07 – Separate repo instead of Nix files in the project repos
|
||||
|
||||
- **Who**: Dominik, ClaudeCode
|
||||
- **Why**: NixOS should be testable without giving up Arch. The Nix build
|
||||
recipes had to live somewhere without disturbing the existing repos.
|
||||
- **Tradeoffs**: Files inside each project repo would keep version, code and
|
||||
build recipe in one commit — no drift between PKGBUILD `pkgver` and flake
|
||||
input. A separate repo keeps the Arch repos untouched, at the cost of one
|
||||
extra commit per version bump (tag in `flake.nix`, then `nix flake update`).
|
||||
- **How**: New repo `moonix/`, consuming the project repos as flake inputs
|
||||
pinned to release tags.
|
||||
|
||||
## 2026-08-07 – Configs deployed as files, not translated to Nix options
|
||||
|
||||
- **Who**: Dominik
|
||||
- **Why**: `moonarch/defaults/` has to stay the single source of truth for both
|
||||
distributions.
|
||||
- **Tradeoffs**: Native Nix options (`programs.niri.settings`) are idiomatic and
|
||||
type checked, but every config would exist twice and drift on each change.
|
||||
- **How**: `environment.etc.<path>.source` pointing into the moonarch flake
|
||||
input. Only files containing FHS paths are generated instead of copied.
|
||||
|
||||
## 2026-08-07 – No Home Manager
|
||||
|
||||
- **Who**: Dominik
|
||||
- **Why**: Initially proposed for the three home-directory tasks in
|
||||
`post-install.sh` (GTK4 symlinks, `gsettings`, seeding the stasis config).
|
||||
- **Tradeoffs**: None in favour, as it turned out. Every one of those tasks is
|
||||
equally doable with `ln`, `gsettings` and `install`; the argument for Home
|
||||
Manager was convention, not need. Two of the three cases disappeared
|
||||
entirely: dconf defaults can be set system-wide via
|
||||
`programs.dconf.profiles.user.databases`, and stasis reads
|
||||
`/etc/stasis/stasis.rune` as a documented fallback.
|
||||
- **How**: Rejected. For files that genuinely have no system-wide fallback,
|
||||
`systemd.user.tmpfiles` with the `C` directive seeds a copy into `$HOME`
|
||||
without overwriting later edits.
|
||||
|
||||
## 2026-08-07 – FHS paths fixed in the source, not bridged with symlinks
|
||||
|
||||
- **Who**: Dominik
|
||||
- **Why**: moonlock, moongreet and moonset invoked `systemctl`, `loginctl` and
|
||||
`moonlock` through absolute `/usr/bin` paths, and moongreet scanned
|
||||
`/usr/share/{wayland-,x}sessions`. All of it fails on NixOS.
|
||||
- **Tradeoffs**: `systemd.tmpfiles` symlinks would have avoided touching the
|
||||
code, but they recreate an FHS layout under NixOS and only cover the paths
|
||||
known at the time — a new one surfaces at runtime, when the user presses the
|
||||
button.
|
||||
- **How**: Programs resolve via `PATH`, session directories walk
|
||||
`XDG_DATA_DIRS` with `/usr/share` as fallback. Behaviour on Arch is
|
||||
unchanged. Released as moonlock 0.6.21, moongreet 0.10.2, moonset 0.9.2.
|
||||
- **Remaining exception**: the polkit agent is spawned by its FHS path from
|
||||
`defaults/xdg/niri/config.kdl`, which is shared with Arch, where the binary
|
||||
lives outside `PATH`. That one stays a symlink.
|
||||
|
||||
## 2026-08-07 – waybar and swaync dropped
|
||||
|
||||
- **Who**: Dominik
|
||||
- **Why**: Both are marked "kept as a reserve" in the Arch config — a note left
|
||||
over from the migration to the Quickshell bar.
|
||||
- **Tradeoffs**: Keeping them would mirror the Arch package exactly; dropping
|
||||
them means a fresh setup does not inherit the migration's leftovers.
|
||||
- **How**: Packages, configs and the `moonarch-waybar*` helper scripts are not
|
||||
installed.
|
||||
|
||||
## 2026-08-07 – QEMU/KVM as the test host, with a caveat
|
||||
|
||||
- **Who**: Dominik, ClaudeCode
|
||||
- **Why**: VirtualBox was the first choice, but its 3D acceleration is
|
||||
documented as broken with Wayland compositors.
|
||||
- **Tradeoffs**: QEMU needs no DKMS module on `linux-zen` and virtio-gpu
|
||||
carries Wayland. However, passing the guest through to the host GPU triggered
|
||||
an amdgpu hard recovery twice, killing the QEMU process. Software rendering
|
||||
is not an alternative: without a 3D capable virtio GPU, niri's TTY backend
|
||||
fails every buffer import with `Error::DeviceMissing` and never creates an
|
||||
output.
|
||||
- **How**: `virtio-vga-gl` with `gl=on`, and the VM is shut down when not in
|
||||
use. The underlying amdgpu problem is a host issue, unrelated to Moonarch.
|
||||
@@ -0,0 +1,91 @@
|
||||
# moonix
|
||||
|
||||
Moonarch on NixOS — packages and NixOS modules that reproduce the Moonarch
|
||||
desktop from the same sources as the Arch packages.
|
||||
|
||||
Arch stays the primary target. This repo is the parallel NixOS path: it
|
||||
consumes `moonarch/defaults/` unchanged and builds the Rust projects with Nix
|
||||
instead of `makepkg`.
|
||||
|
||||
## Layout
|
||||
|
||||
```
|
||||
flake.nix Inputs (project repos pinned to tags) and outputs
|
||||
pkgs/ Build recipes — counterparts to the PKGBUILDs
|
||||
moonlock.nix
|
||||
moongreet.nix
|
||||
moonset.nix
|
||||
stasis.nix
|
||||
sweet-cursors.nix
|
||||
modules/
|
||||
desktop.nix /etc deployment, package set, theme
|
||||
greetd.nix greetd + moongreet
|
||||
services.nix systemd system and user services
|
||||
hosts/
|
||||
moonarch-vm/ QEMU test VM
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
Build a single package:
|
||||
|
||||
```bash
|
||||
nix build .#moonlock
|
||||
```
|
||||
|
||||
Build the whole system without activating it:
|
||||
|
||||
```bash
|
||||
nix build .#nixosConfigurations.moonarch-vm.config.system.build.toplevel
|
||||
```
|
||||
|
||||
Activate:
|
||||
|
||||
```bash
|
||||
sudo nixos-rebuild switch --flake .#moonarch-vm
|
||||
```
|
||||
|
||||
## Version bumps
|
||||
|
||||
The project repos are pinned to release tags. After tagging a new version:
|
||||
|
||||
```bash
|
||||
# adjust the tag in flake.nix, then
|
||||
nix flake update moonlock
|
||||
```
|
||||
|
||||
## Configuration sources
|
||||
|
||||
`moonarch/defaults/` is the single source of truth for both distributions.
|
||||
Files are deployed as-is wherever possible. Three exceptions exist, each
|
||||
because the file contains an FHS path that does not exist under Nix:
|
||||
|
||||
| File | Reason |
|
||||
|---|---|
|
||||
| `moongreet.toml` | wallpaper path, generated with the store path |
|
||||
| `waypaper/config.ini` | wallpaper path, generated and seeded into `$HOME` |
|
||||
| fontconfig defaults | `/etc/fonts/conf.d` is owned by the NixOS module |
|
||||
|
||||
Two files from `defaults/xdg/` are deliberately not deployed:
|
||||
|
||||
- `walker/` — walker is not part of this setup, the Quickshell launcher
|
||||
replaced it
|
||||
- `kanshi/config` — a 0-byte placeholder, unused on Arch as well; kanshi
|
||||
rejects it and restarts in a loop
|
||||
|
||||
## Test VM
|
||||
|
||||
`hosts/moonarch-vm` targets a QEMU guest. The launcher script lives outside
|
||||
this repo at `~/VMs/moonix-vm.sh`.
|
||||
|
||||
The guest needs a 3D capable virtio GPU: niri's TTY backend fails every buffer
|
||||
import with `Error::DeviceMissing` otherwise, and software rendering is not a
|
||||
workaround. On the current host that path has twice triggered an amdgpu hard
|
||||
recovery, killing the QEMU process — shut the VM down when not testing.
|
||||
|
||||
## Not covered
|
||||
|
||||
- Clipboard history and the `walker -d` menus in
|
||||
`moonarch-sink-switcher`, `moonarch-vpn` and `moonarch-cpugov` — walker was
|
||||
dropped without a replacement yet
|
||||
- Bare metal installation (disk layout, encryption, bootloader)
|
||||
Reference in new issue
Block a user