Bernardo Magri f318585dc4 fix(installer): harden disk selection and partitioning phase
The disk phase was the dominant source of incomplete installs. Six
concrete failure modes addressed in one pass:

1. Live-ISO USB excluded from the disk picker. select_disk previously
   filtered loop|ram|zram|sr but not the device the installer booted
   from; picking it would format the boot media mid-install. New
   detect_live_iso_devices walks /, /iso, /run/initramfs/live,
   /nix/.ro-store, /nix/store and resolves each backing device to its
   parent disk via lsblk -no PKNAME. Override with
   NOMARCHY_INSTALL_ALLOW_ISO_TARGET=1 for the developer case.

2. 10 GiB minimum-capacity preflight. Disko fails late and obscurely
   on undersized media; surface it while the picker is still open.

3. prewipe_target_drive rewritten:
   - Enumerates every active dm-crypt mapping via dmsetup ls and
     closes those whose backing device is on the target drive. The
     old version only knew about the hardcoded names "crypted" /
     "crypted_main" so an aborted multi-disk run or a non-Nomarchy
     install would leave a holder open and silently break the wipe.
   - Drops `|| true` from wipefs / sgdisk / dd. After the LUKS and
     swap teardown above, a real failure means something is still
     holding the device — surface that instead of papering over it.
   - udevadm settle bounded to 30s so a flapping USB can't hang.
   - Post-wipe sanity check: refuse to hand the disk to disko if
     anything is still mounted off it.

4. run_disko_with_retry wraps the disko call. On failure, shows the
   last 30 lines of output via gum style and offers Retry /
   View full log / Abort. set -e is suspended for the disko call so
   the exit code can be inspected. The previous bare `disko --mode
   disko` aborted the whole installer with output scrolled past.

5. Sed-templated disko-golden.nix + disko-btrfs-multi.nix pair
   replaced by a single disko-config.nix Nix function of
   { mainDrive, extraDrives ? [] } called via --argstr / --arg.
   Templating Nix via shell-escaped string substitution caused at
   least one production bug (3aadc36 fixed embedded-newline
   escaping); function arguments are the right shape and eliminate
   the entire class of escaping concerns. Single-disk path is
   `extraDrives = []`; multi-disk gets BTRFS `-d single -m raid1`
   plus the additional /dev/mapper/* devices. Hosts that shipped
   /etc/disko-golden.nix now ship /etc/disko-config.nix.

6. EXIT trap added so the tmpfs LUKS key file (/dev/shm/nomarchy-
   luks.key) is removed even if the script aborts between key-write
   and the explicit unset. Replaced redundant `shred -u` on tmpfs
   with `rm -f` (already in RAM).

Verification: bash -n on install.sh, nix-instantiate parse + strict
eval on disko-config.nix in both single and multi shapes, full
nix flake check --no-build evaluating all three NixOS configurations
(default, nomarchy-installer, nomarchy-live) plus the installerVm.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-30 19:42:00 +01:00

👑 Nomarchy

Nomarchy is a professional-grade NixOS distribution that replicates the Omarchy Wayland workflow with a strictly declarative, flake-based architecture. It provides a highly polished, "it just works" experience for power users who want a beautiful Hyprland environment without sacrificing the reliability of NixOS.

Key Features

  • Purely Declarative: Your entire desktop—themes, fonts, wallpapers, and toolchains—is defined in code.
  • Modular Merging Architecture: Distro code and user code are strictly separated. You can update the distro core without ever touching or breaking your personal configurations.
  • Interactive "Smart" Installer: Detects hardware, sets up networking, localizes timezones/keymaps, and offers multi-select software profiles.
  • Erase Your Darlings (Optional): Optional BTRFS root-wipe on boot ensures your system stays pristine and 100% declarative.
  • Dynamic Theming Engine: 20+ built-in themes with instant UI feedback via IPC (swww, waybar, and stylix).
  • Portable State (nomarchy-sync): Easily backup and sync your declarative config and dynamic state (theme/wallpaper choices) to a private Git repo.

📂 Component-Based Architecture

Nomarchy uses a Feature-Centric Directory Structure. For a comprehensive breakdown of the system architecture, folder roles, and module logic, see the Detailed Architecture Documentation.

Configuration, modules, and utilities are strictly organized to maintain sanity as the system grows.

  • core/: Foundational OS & User defaults (Bootloader, Audio, Bluetooth, core system features).
  • features/: Isolated modules containing Nix logic and raw dotfiles.
    • features/apps/: App-specific configs (e.g., features/apps/btop/, features/apps/kitty/), each containing their own default.nix and standalone config/ directory mapped via Home Manager.
    • features/desktop/: Desktop environment components (e.g., Hyprland, Waybar).
    • features/scripts/utils/: Consolidated repository for all custom Nomarchy bash scripts, centrally packaged and injected into the user's PATH with correct dependencies.
  • themes/: The global theming engine. It holds pure color data and logic. Theme-specific app layouts (like a custom Waybar layout) are stored directly inside the app's feature folder, solving the matrix problem of theming.

📥 Installation

Verify the experience without touching your hardware:

./bin/utils/nomarchy-test-installer

This builds a full graphical VM of the installer environment. Once inside, click the Install Nomarchy icon or run nomarchy-install.

2. Build the Installer ISO

To install on physical hardware, generate your own bootable image:

nix build .#nixosConfigurations.nomarchy-installer.config.system.build.isoImage

The ISO will be located at ./result/iso/nixos-*.iso. Flash it to a USB drive and boot.

3. Run the Installer

Once booted into the Live environment, launch the installer:

nomarchy-install

The wizard will guide you through:

  • Networking: An interactive wizard to connect to Wi-Fi if needed.
  • Hardware: Optimized profiles for Dell XPS, Framework, Apple T2, and more.
  • Storage: Choice between Standard Ext4 or Encrypted BTRFS with optional Impermanence.
  • Localization: Searchable timezones and keyboard layout selection.

Already on NixOS?

Layer Nomarchy onto an existing 25.11 install without reformatting — see the Migration Guide.


🛠️ Configuration & Usage

Nomarchy uses a "Downstream" model. After installation, your configuration lives in /etc/nixos/ and is split into three main parts:

1. Distro Core (Upstream)

Managed via the public Git repository. This is the engine. You should generally not modify files here.

2. Your System (system.nix)

Add system-wide packages, services, and hardware tweaks here. Example: Adding a persistent directory for Docker if using Impermanence:

environment.persistence."/persist" = {
  directories = [ "/var/lib/docker" ];
};

3. Your User Environment (home.nix)

Add user-level packages, aliases, and dotfiles here. Example: Overriding the default terminal:

nomarchy.home.terminal = "kitty";

For the full list of nomarchy.* options you can set in system.nix and home.nix, see the Options Reference. Hit a rebuild error? Check Troubleshooting. For where the project is heading next, see the Roadmap.

Applying Changes

After editing your files, apply them instantly. IMPORTANT: Nomarchy requires the --impure flag for evaluation. You MUST use the following aliases rather than standard NixOS commands:

sys-update  # Rebuilds the NixOS system (Runs: sudo nixos-rebuild switch --flake .#default --impure)
env-update  # Reloads your Home Manager environment (Runs: home-manager switch --flake .#default --impure)

🚀 Commands & Keybindings

The full list lives in docs/KEYBINDINGS.md (auto-generated from the Hyprland configs). A few highlights:

Keybinding Action
Super + Space App Launcher (Walker)
Super + Shift + Space Nomarchy Menu (Walker)
Super + Alt + Space Toggle Top Bar (Waybar)
Super + Return Open Terminal
Super + Q Close Window

Utility Scripts

Nomarchy includes dozens of productivity scripts available in your PATH. Some highlights:

  • nomarchy-sync push <repo>: Backup your setup to Git.
  • nomarchy-theme-bg-next: Cycle to the next wallpaper in the current theme.
  • nomarchy-menu: The central hub for all utilities and pickers.

Built with ❤️ using NixOS, Hyprland, Stylix, and the spirit of Omarchy.

Description
NixOS based distribution with Omarchy flavour
Readme 182 MiB
Languages
Shell 65.4%
Nix 25.6%
Smarty 2.4%
CSS 2.3%
Lua 2.1%
Other 2.2%