feat: Nomarchy ground-up rewrite on NixOS 26.05

Full replacement of the previous iteration, rebuilt around three ideas:

- Pure evaluation: theme-state.json lives inside the flake and is read
  via the nomarchy.stateFile option — no --impure, ever.
- All-Home-Manager theming: `nomarchy-theme-sync apply` writes the JSON
  and runs `home-manager switch`; every theme change is one atomic,
  rollbackable generation. Wallpaper (swww) is the sole runtime piece.
- Flat, downstream-first layout: modules/{nixos,home} with one
  options.nix each, exported as nixosModules/homeModules + overlay +
  flake template; system (nixos-rebuild) and desktop (home-manager
  switch) rebuild paths are fully split.

Ships 21 themes imported from the previous iteration (palettes,
wallpapers, btop themes, six whole-swap Waybar identities), Stylix for
the GTK/Qt/cursor long tail, a live ISO target with offline theme
switching, and docs/TESTING.md with the QEMU verification workflow.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Bernardo Magri
2026-06-10 10:59:13 +01:00
commit f211ef0d09
131 changed files with 4844 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
# Reference host — machine specifics ONLY.
# The distro itself comes from nixosModules.nomarchy (modules/nixos),
# imported in flake.nix. Keep this file boring.
{ pkgs, username, ... }:
{
imports = [ ./hardware-configuration.nix ];
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
boot.kernelPackages = pkgs.linuxPackages_latest;
networking.hostName = "nomarchy";
time.timeZone = "UTC"; # adjust per machine
i18n.defaultLocale = "en_US.UTF-8";
users.users.${username} = {
isNormalUser = true;
description = "Nomarchy user";
extraGroups = [ "wheel" "networkmanager" "video" "input" ];
};
system.stateVersion = "26.05";
}

View File

@@ -0,0 +1,15 @@
# PLACEHOLDER — replace with the output of `nixos-generate-config` on the
# target machine. The mkDefault values below only exist so the flake
# evaluates and `nix flake check` passes before first install.
{ lib, ... }:
{
boot.initrd.availableKernelModules = lib.mkDefault [ "xhci_pci" "ahci" "nvme" "usbhid" "sd_mod" ];
fileSystems."/" = lib.mkDefault {
device = "/dev/disk/by-label/nixos";
fsType = "ext4";
};
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
}

85
hosts/live.nix Normal file
View File

@@ -0,0 +1,85 @@
# Live ISO host — boot the full Nomarchy desktop from a USB stick or QEMU
# without touching the disk. No installer yet (see roadmap); this target
# exists to test the distro end-to-end on real hardware.
{ lib, pkgs, username, nomarchySrc, ... }:
{
networking.hostName = "nomarchy-live";
isoImage.volumeID = lib.mkForce "NOMARCHY_LIVE";
isoImage.edition = lib.mkForce "live";
# The minimal-CD profile enables wpa_supplicant; Nomarchy ships
# NetworkManager and the two must not run together.
networking.wireless.enable = lib.mkForce false;
# ── Live user: no password, straight into the desktop ──────────────
users.users.${username} = {
isNormalUser = true;
initialHashedPassword = "";
extraGroups = [ "wheel" "networkmanager" "video" "render" "audio" "input" ];
};
security.sudo.wheelNeedsPassword = false;
services.getty.autologinUser = lib.mkForce username;
# Boot straight into Hyprland once; logging out lands on tuigreet.
services.greetd.settings.initial_session = {
command = "Hyprland";
user = username;
};
# ── Hardware breadth ────────────────────────────────────────────────
# Force-loading every GPU driver in the initrd (amdgpu+radeon+nouveau+
# i915) panics most machines — only one of them can claim the GPU and
# the others explode. `availableKernelModules` lets udev load just the
# one that matches; virtio_gpu covers QEMU (tools/test-live-iso.sh).
boot.initrd.availableKernelModules = [ "amdgpu" "radeon" "nouveau" "i915" "virtio_gpu" ];
services.qemuGuest.enable = lib.mkDefault true;
# ── The Nomarchy flake on board ─────────────────────────────────────
# Read-only copy in /etc (also pins the flake source into the ISO
# closure); seeded writable into the live home so theme switching —
# state write + `home-manager switch` — works exactly like on an
# installed system. $NOMARCHY_PATH already defaults to ~/.nomarchy.
environment.etc."nomarchy".source = nomarchySrc;
systemd.services.nomarchy-seed-flake = {
description = "Seed a writable Nomarchy flake into the live user's home";
wantedBy = [ "multi-user.target" ];
serviceConfig.Type = "oneshot";
script = ''
home=/home/${username}
if [ ! -e "$home/.nomarchy" ]; then
cp -r ${nomarchySrc} "$home/.nomarchy"
chmod -R u+w "$home/.nomarchy"
chown -R ${username}:users "$home/.nomarchy"
fi
'';
};
services.getty.helpLine = lib.mkForce ''
Welcome to the Nomarchy live environment.
The graphical session autologins as '${username}' (no password).
Theme switching: nomarchy-theme-sync apply <name> (or SUPER+T)
Wallpapers: nomarchy-theme-sync bg next (or SUPER+SHIFT+T)
The flake lives at ~/.nomarchy.
'';
# ── Live-session desktop tweaks ─────────────────────────────────────
home-manager.users.${username} = {
wayland.windowManager.hyprland.settings = {
# QEMU (and some panels) report a tiny "preferred" mode; ask for
# the highest resolution instead.
monitor = lib.mkForce [ ",highres,auto,1" ];
# Welcome toast once the session is up (concatenated onto the
# base exec-once list).
exec-once = [
"sh -c 'sleep 3; notify-send -a Nomarchy \"Welcome to Nomarchy\" \"SUPER+Return terminal · SUPER+T themes · SUPER+SHIFT+T wallpaper\"'"
];
};
};
system.stateVersion = "26.05";
}