Compare commits

..

3 Commits

Author SHA1 Message Date
Bernardo Magri
55f0653e59 feat(desktop): default to highest monitor resolution
- Change default monitor rule from 'preferred' to 'highres' in monitors.conf.
- Explicitly force 'highres' in the live ISO (nomarchy-live) to avoid low-res fallbacks on some hardware.
- Update roadmap.
2026-04-26 20:03:46 +01:00
Bernardo Magri
dd48411013 feat(scripts): extend nomarchy-welcome into a guided wizard
- Added nomarchy.panelPosition option and state persistence.
- Updated Waybar to respect the panelPosition setting.
- Refactored nomarchy-welcome to use state.json instead of a flag file.
- Added prompts for theme, font, panel position, and starter home.nix generation.
- Updated documentation and roadmap.
2026-04-26 20:02:52 +01:00
Bernardo Magri
c66f0b19cd feat(installer): add multi-disk BTRFS support
- Allow selecting multiple drives in the TTY installer using gum choose --no-limit.
- Add installer/disko-btrfs-multi.nix template for BTRFS RAID/Single setups.
- Dynamically generate multi-disk disko configurations with LUKS-on-every-disk.
- Default to BTRFS 'single' data and 'raid1' metadata for maximum capacity across mismatched drives (e.g., 20GB + 120GB SSDs).
- Update roadmap and structure documentation to reflect the new capabilities.
2026-04-26 19:44:34 +01:00
13 changed files with 244 additions and 19 deletions

View File

@@ -61,6 +61,11 @@
default = ""; default = "";
description = "System wallpaper path."; description = "System wallpaper path.";
}; };
panelPosition = lib.mkOption {
type = lib.types.enum [ "top" "bottom" ];
default = "top";
description = "Waybar panel position.";
};
hyprland = { hyprland = {
gaps_in = lib.mkOption { gaps_in = lib.mkOption {
type = lib.types.int; type = lib.types.int;

View File

@@ -21,6 +21,7 @@ in
nightlightTemperature = togglesState.nightlightTemperature or 4000; nightlightTemperature = togglesState.nightlightTemperature or 4000;
theme = togglesState.theme or "summer-night"; theme = togglesState.theme or "summer-night";
wallpaper = togglesState.wallpaper or ""; wallpaper = togglesState.wallpaper or "";
panelPosition = togglesState.panelPosition or "top";
hyprland = { hyprland = {
gaps_in = togglesState.hyprland.gaps_in or 5; gaps_in = togglesState.hyprland.gaps_in or 5;
gaps_out = togglesState.hyprland.gaps_out or 10; gaps_out = togglesState.hyprland.gaps_out or 10;

View File

@@ -147,6 +147,10 @@ Wired in `features/desktop/waybar/default.nix` (filters the battery widget out o
`str`, default `"summer-night"`. Active theme name. Available themes are the directories under `themes/palettes/`. `str`, default `"summer-night"`. Active theme name. Available themes are the directories under `themes/palettes/`.
### `nomarchy.panelPosition`
`enum ["top", "bottom"]`, default `"top"`. Waybar panel position.
### `nomarchy.formFactor` ### `nomarchy.formFactor`
`enum [ "laptop" "desktop" ]`, default `"laptop"`. Mirror of `nomarchy.system.formFactor`. Filters laptop-only widgets out of waybar (battery) when set to `"desktop"`. The installer writes both system and home values together. `enum [ "laptop" "desktop" ]`, default `"laptop"`. Mirror of `nomarchy.system.formFactor`. Filters laptop-only widgets out of waybar (battery) when set to `"desktop"`. The installer writes both system and home values together.

View File

@@ -26,7 +26,6 @@ Guardrails (apply when adding anything):
- **Accessibility — home-side companion.** Hyprland-side bits the system preset can't reach: slower `input.repeat_rate` / `repeat_delay` defaults, `SUPER+ALT+S` keybinding to launch Orca, and a high-contrast palette under `themes/palettes/`. Gated on a new `nomarchy.accessibility.enable` mirror of the system option. - **Accessibility — home-side companion.** Hyprland-side bits the system preset can't reach: slower `input.repeat_rate` / `repeat_delay` defaults, `SUPER+ALT+S` keybinding to launch Orca, and a high-contrast palette under `themes/palettes/`. Gated on a new `nomarchy.accessibility.enable` mirror of the system option.
- **Gaming — Hyprland window rule.** Companion to the gaming preset: a Hyprland `windowrulev2 = fullscreen, class:^(steam_app_).*$` (or similar) so games launched from Steam grab the whole screen. Lives in `core/home/config/nomarchy/default/hypr/` and gates on a new `nomarchy.gaming.enable` mirror. - **Gaming — Hyprland window rule.** Companion to the gaming preset: a Hyprland `windowrulev2 = fullscreen, class:^(steam_app_).*$` (or similar) so games launched from Steam grab the whole screen. Lives in `core/home/config/nomarchy/default/hypr/` and gates on a new `nomarchy.gaming.enable` mirror.
- **Gaming — declarative flathub remote.** `services.flatpak.enable` doesn't ship a declarative remote API in nixpkgs. Either add the `flatpak-managed-install` overlay, write a one-shot systemd unit that runs `flatpak remote-add --if-not-exists flathub …`, or surface the manual step in `nomarchy-welcome`. - **Gaming — declarative flathub remote.** `services.flatpak.enable` doesn't ship a declarative remote API in nixpkgs. Either add the `flatpak-managed-install` overlay, write a one-shot systemd unit that runs `flatpak remote-add --if-not-exists flathub …`, or surface the manual step in `nomarchy-welcome`.
- **First-run welcome wizard.** Extend `nomarchy-welcome` from a one-shot greeter into a guided picker: theme, panel position, monospace font, "what's a sane home.nix to start with?". Runs once, persists "done" in `state.json`.
- **Plymouth theme variants per palette.** Currently one Plymouth theme; could template per-palette so the boot splash matches the active theme. - **Plymouth theme variants per palette.** Currently one Plymouth theme; could template per-palette so the boot splash matches the active theme.
### Later (speculative or research-shaped) ### Later (speculative or research-shaped)
@@ -78,7 +77,7 @@ Each PR description should reference the row(s) in `docs/SCRIPTS.md` it closes,
- Software-profile multi-select (Now). - Software-profile multi-select (Now).
- Richer disk metadata (Shipped). - Richer disk metadata (Shipped).
- Form-factor → laptop preset (Now, depends on Pillar 5). - Form-factor → laptop preset (Now, depends on Pillar 5).
- `disko-golden.nix` variants for software-RAID and BTRFS-pool-as-root. - `disko-golden.nix` variants for software-RAID and BTRFS-pool-as-root (Shipped).
- Pre-flight resume polish (Next). - Pre-flight resume polish (Next).
- "What's installed?" summary screen on boot of a freshly-installed system, sourced from `state.json` + `nomarchy-system-scripts` introspection. - "What's installed?" summary screen on boot of a freshly-installed system, sourced from `state.json` + `nomarchy-system-scripts` introspection.
- Optional non-LUKS branch in the installer for users who explicitly opt out of FDE. - Optional non-LUKS branch in the installer for users who explicitly opt out of FDE.
@@ -138,6 +137,9 @@ Nomarchy is moving away from being a "flavor" of Omarchy to its own distinct ide
(Move items here when they land — keep them brief, link the commit/PR.) (Move items here when they land — keep them brief, link the commit/PR.)
- _2026-04-26_ — Default to highest resolution (`highres`) for monitors. Updated `features/desktop/hyprland/config/monitors.conf` and forced it in the live ISO (`nomarchy-live`) to resolve issues where some hardware would default to a low resolution (1024x768).
- _2026-04-26_ — First-run welcome wizard (`nomarchy-welcome`). Extended from a one-shot greeter into a guided picker for theme, font, and panel position. Added Step 4 to generate a starter `home.nix` if missing. State is now persisted in `state.json` via `.welcome_done`. Added `nomarchy.panelPosition` option to Waybar.
- _2026-04-26_ — Multi-disk BTRFS support in the installer. Added `installer/disko-btrfs-multi.nix` template and updated `installer/install.sh` to allow selecting multiple drives via `gum choose --no-limit`. Implements BTRFS "single" data + RAID1 metadata across multiple LUKS-encrypted drives.
- _2026-04-26_ — Distro Branding Phase 2. Updated bootloader entries to use "Nomarchy" as the label. Set ISO volume IDs to `NOMARCHY_INSTALLER` and `NOMARCHY_LIVE`. Fixed branding in Plymouth theme metadata and SDDM metadata. - _2026-04-26_ — Distro Branding Phase 2. Updated bootloader entries to use "Nomarchy" as the label. Set ISO volume IDs to `NOMARCHY_INSTALLER` and `NOMARCHY_LIVE`. Fixed branding in Plymouth theme metadata and SDDM metadata.
- _2026-04-26_ — Distro Branding Phase 1. Renamed `installerIso` to `nomarchy-installer` and `installerIsoGraphical` to `nomarchy-live`. Updated metadata and host configurations. Scrubbed "Omarchy" from Plymouth and installer messages. - _2026-04-26_ — Distro Branding Phase 1. Renamed `installerIso` to `nomarchy-installer` and `installerIsoGraphical` to `nomarchy-live`. Updated metadata and host configurations. Scrubbed "Omarchy" from Plymouth and installer messages.
- _2026-04-26_ — Fix `hardware-db.sh` missing in `nomarchy-installer.nix`. Resolved boot error where `install.sh` failed to source the hardware database on the TTY installer ISO. - _2026-04-26_ — Fix `hardware-db.sh` missing in `nomarchy-installer.nix`. Resolved boot error where `install.sh` failed to source the hardware database on the TTY installer ISO.

View File

@@ -135,8 +135,8 @@ Phase B (per-batch PRs) refines those into `port-from-omarchy`,
| `nomarchy-show-logo` | `themes/engine/scripts` | features/scripts/utils/nomarchy-launch-floating-terminal-with-presentation | `kept` | | | `nomarchy-show-logo` | `themes/engine/scripts` | features/scripts/utils/nomarchy-launch-floating-terminal-with-presentation | `kept` | |
| `nomarchy-skill` | `features/scripts/utils` | core/home/configs.nix | `kept` | | | `nomarchy-skill` | `features/scripts/utils` | core/home/configs.nix | `kept` | |
| `nomarchy-snapshot` | `features/scripts/utils` | — | `unused?` | | | `nomarchy-snapshot` | `features/scripts/utils` | — | `unused?` | |
| `nomarchy-state` | `features/scripts/utils` | core/system/scripts/nomarchy-system-reboot,core/system/scripts/nomarchy-system-shutdown, +1 more | `kept` | | | `nomarchy-state` | `features/scripts/utils` | core/system/scripts/nomarchy-system-reboot,core/system/scripts/nomarchy-system-shutdown, +2 more | `kept` | |
| `nomarchy-state-write` | `features/scripts/utils` | — | `unused?` | | | `nomarchy-state-write` | `features/scripts/utils` | features/scripts/utils/nomarchy-welcome | `kept` | |
| `nomarchy-sudo-keepalive` | `core/system/scripts` | — | `unused?` | | | `nomarchy-sudo-keepalive` | `core/system/scripts` | — | `unused?` | |
| `nomarchy-sudo-passwordless-toggle` | `core/system/scripts` | — | `unused?` | | | `nomarchy-sudo-passwordless-toggle` | `core/system/scripts` | — | `unused?` | |
| `nomarchy-sudo-reset` | `core/system/scripts` | — | `unused?` | | | `nomarchy-sudo-reset` | `core/system/scripts` | — | `unused?` | |
@@ -213,7 +213,7 @@ Tokens grepped from `core/`, `features/`, `themes/`, `installer/`, `hosts/`, `bi
| `nomarchy-installer` | features/scripts/utils/nomarchy-build-iso,README.md | `missing` | | `nomarchy-installer` | features/scripts/utils/nomarchy-build-iso,README.md | `missing` |
| `nomarchy-launch` | core/home/config/nomarchy/default/hypr/bindings/clipboard.conf,core/home/config/nomarchy/default/hypr/bindings/utilities.conf, +24 more | `missing` | | `nomarchy-launch` | core/home/config/nomarchy/default/hypr/bindings/clipboard.conf,core/home/config/nomarchy/default/hypr/bindings/utilities.conf, +24 more | `missing` |
| `nomarchy-live` | features/scripts/utils/nomarchy-build-live-iso,features/scripts/utils/nomarchy-on-boot, +1 more | `missing` | | `nomarchy-live` | features/scripts/utils/nomarchy-build-live-iso,features/scripts/utils/nomarchy-on-boot, +1 more | `missing` |
| `nomarchy-luks` | installer/disko-golden.nix,installer/install.sh | `missing` | | `nomarchy-luks` | installer/disko-btrfs-multi.nix,installer/disko-golden.nix, +1 more | `missing` |
| `nomarchy-menu-rows` | bin/utils/nomarchy-docs-scripts,features/scripts/utils/nomarchy-docs-scripts | `missing` | | `nomarchy-menu-rows` | bin/utils/nomarchy-docs-scripts,features/scripts/utils/nomarchy-docs-scripts | `missing` |
| `nomarchy-nopasswd` | core/system/scripts/nomarchy-sudo-passwordless-toggle | `missing` | | `nomarchy-nopasswd` | core/system/scripts/nomarchy-sudo-passwordless-toggle | `missing` |
| `nomarchy-nopasswd-expire` | core/system/scripts/nomarchy-sudo-passwordless-toggle | `missing` | | `nomarchy-nopasswd-expire` | core/system/scripts/nomarchy-sudo-passwordless-toggle | `missing` |

View File

@@ -126,6 +126,7 @@ The `lib/` directory provides centralized logic and data structures to maintain
### `installer/` (Bootstrap) ### `installer/` (Bootstrap)
- **`install.sh`**: The interactive TTY-based installer. It handles disk partitioning, NixOS installation, and generating a clean "Downstream" flake for the user. - **`install.sh`**: The interactive TTY-based installer. It handles disk partitioning, NixOS installation, and generating a clean "Downstream" flake for the user.
- **`disko-golden.nix`**: The standard partition layout (BTRFS on top of LUKS2). - **`disko-golden.nix`**: The standard partition layout (BTRFS on top of LUKS2).
- **`disko-btrfs-multi.nix`**: Multi-disk BTRFS RAID/Single layout template.
- **`disko-btrfs-luks.nix`**: A simpler reference layout for disk management. - **`disko-btrfs-luks.nix`**: A simpler reference layout for disk management.
### `hosts/` (Targets) ### `hosts/` (Targets)

View File

@@ -13,7 +13,7 @@
# Straight 1x setup for low-resolution displays like 1080p or 1440p # Straight 1x setup for low-resolution displays like 1080p or 1440p
# Or for ultrawide monitors like 34" 3440x1440 or 49" 5120x1440 # Or for ultrawide monitors like 34" 3440x1440 or 49" 5120x1440
env = GDK_SCALE,1 env = GDK_SCALE,1
monitor=,preferred,auto,1 monitor=,highres,auto,1
# Portrait/rotated secondary monitor (transform: 1 = 90°, 3 = 270°) # Portrait/rotated secondary monitor (transform: 1 = 90°, 3 = 270°)
# monitor = DP-2, preferred, auto, 1, transform, 1 # monitor = DP-2, preferred, auto, 1, transform, 1

View File

@@ -28,6 +28,7 @@ let
else builtins.filter (m: !(builtins.elem m laptopOnlyModules)) mods; else builtins.filter (m: !(builtins.elem m laptopOnlyModules)) mods;
settings = rawSettings // { settings = rawSettings // {
position = config.nomarchy.panelPosition;
modules-left = filterModules (rawSettings.modules-left or []); modules-left = filterModules (rawSettings.modules-left or []);
modules-center = filterModules (rawSettings.modules-center or []); modules-center = filterModules (rawSettings.modules-center or []);
modules-right = filterModules (rawSettings.modules-right or []); modules-right = filterModules (rawSettings.modules-right or []);

View File

@@ -1,9 +1,13 @@
#!/usr/bin/env bash #!/usr/bin/env bash
FLAG_FILE="$HOME/.config/nomarchy/.first-run-done" STATE_FILE="$HOME/.config/nomarchy/state.json"
if [ -f "$FLAG_FILE" ]; then # Check if welcome wizard has already been completed
exit 0 if [ -f "$STATE_FILE" ]; then
DONE=$(jq -r '.welcome_done' "$STATE_FILE" 2>/dev/null)
if [ "$DONE" == "true" ]; then
exit 0
fi
fi fi
# Ensure we have a terminal for the wizard # Ensure we have a terminal for the wizard
@@ -29,8 +33,44 @@ nomarchy-theme-set "$(nomarchy-theme-list | gum filter --placeholder 'Select a t
echo "Step 2: Choose your preferred font" echo "Step 2: Choose your preferred font"
nomarchy-font-set "$(nomarchy-font-list | gum filter --placeholder 'Select a font...')" nomarchy-font-set "$(nomarchy-font-list | gum filter --placeholder 'Select a font...')"
# 3. Setup Local Repo (Crucial for nomarchy-env-update to work) # 3. Select panel position
echo "Step 3: Choose your preferred panel position"
POSITION=$(gum choose "top" "bottom")
nomarchy-state-write panelPosition "$POSITION"
# 4. Starter home.nix
echo "" echo ""
echo "Step 4: Starter home.nix"
HOME_NIX="$HOME/.config/home-manager/home.nix"
if [ ! -f "$HOME_NIX" ]; then
echo "It looks like you don't have a ~/.config/home-manager/home.nix file yet."
echo "Nomarchy uses this file to manage your user-level packages and settings."
if gum confirm "Would you like to generate a starter home.nix?"; then
mkdir -p "$(dirname "$HOME_NIX")"
cat <<EOF > "$HOME_NIX"
{ pkgs, ... }:
{
# Nomarchy starter home.nix
# Add your user packages here.
home.packages = with pkgs; [
btop
fastfetch
chromium
# Add more packages here
];
# home.stateVersion = "25.11"; # Consult docs/MIGRATION.md if you change this
}
EOF
echo "Starter home.nix generated at $HOME_NIX"
fi
else
echo "Detected existing home.nix at $HOME_NIX. Skipping generation."
fi
# 5. Setup Local Repo (Crucial for nomarchy-env-update to work)
echo ""
echo "Step 5: Git Repository Check"
echo "Nomarchy relies on a local git repository for declarative updates." echo "Nomarchy relies on a local git repository for declarative updates."
if [ ! -d "/etc/nixos/.git" ]; then if [ ! -d "/etc/nixos/.git" ]; then
echo "Warning: /etc/nixos is not a git repository. Declarative updates might fail." echo "Warning: /etc/nixos is not a git repository. Declarative updates might fail."
@@ -41,9 +81,11 @@ if [ ! -d "/etc/nixos/.git" ]; then
fi fi
fi fi
# 4. Success # 6. Success
mkdir -p "$(dirname "$FLAG_FILE")" nomarchy-state-write welcome_done true --type bool
touch "$FLAG_FILE"
# Remove legacy flag file if it exists
rm -f "$HOME/.config/nomarchy/.first-run-done"
gum style --foreground 82 "Setup complete! Enjoy your Nomarchy experience." gum style --foreground 82 "Setup complete! Enjoy your Nomarchy experience."
sleep 3 sleep 3

View File

@@ -168,8 +168,10 @@
# Live-ISO-only welcome. Pops a notification a few seconds # Live-ISO-only welcome. Pops a notification a few seconds
# after the graphical session is up and opens a terminal # after the graphical session is up and opens a terminal
# parked at the installer command, so the user never has to # parked at the installer command, so the user never has to
# hunt for it. # hunt for it. Force highres monitor detection as some
# hardware defaults to 1024x768.
wayland.windowManager.hyprland.extraConfig = nixpkgs.lib.mkAfter '' wayland.windowManager.hyprland.extraConfig = nixpkgs.lib.mkAfter ''
monitor = , highres, auto, 1
exec-once = sh -c 'sleep 3; notify-send -u critical -t 0 "Welcome to Nomarchy" "Run \`sudo /etc/install.sh\` in the open terminal or \`--dry-run\` to preview."' exec-once = sh -c 'sleep 3; notify-send -u critical -t 0 "Welcome to Nomarchy" "Run \`sudo /etc/install.sh\` in the open terminal or \`--dry-run\` to preview."'
exec-once = sh -c 'sleep 4; alacritty --title "Nomarchy Installer" -e bash -lc "echo; echo \"Welcome to the Nomarchy live ISO.\"; echo; echo \" sudo /etc/install.sh # install\"; echo \" sudo /etc/install.sh --dry-run # preview only\"; echo \" sudo /etc/install.sh --resume # resume after an interrupt\"; echo; exec bash"' exec-once = sh -c 'sleep 4; alacritty --title "Nomarchy Installer" -e bash -lc "echo; echo \"Welcome to the Nomarchy live ISO.\"; echo; echo \" sudo /etc/install.sh # install\"; echo \" sudo /etc/install.sh --dry-run # preview only\"; echo \" sudo /etc/install.sh --resume # resume after an interrupt\"; echo; exec bash"'
''; '';

View File

@@ -0,0 +1,76 @@
{
disko.devices = {
disk = {
main = {
type = "disk";
device = "@MAIN_DRIVE@";
content = {
type = "gpt";
partitions = {
ESP = {
priority = 1;
name = "ESP";
start = "1M";
end = "1G";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
mountOptions = [ "umask=0077" ];
};
};
luks = {
size = "100%";
content = {
type = "luks";
name = "crypted_main";
settings = {
allowDiscards = true;
passwordFile = "/dev/shm/nomarchy-luks.key";
};
content = {
type = "btrfs";
extraArgs = [ "-f" "-d single" "-m raid1" @BTRFS_DEVICES@ ];
subvolumes = {
"@" = {
mountpoint = "/";
mountOptions = [ "compress=zstd" "noatime" ];
};
"@persist" = {
mountpoint = "/persist";
mountOptions = [ "compress=zstd" "noatime" ];
};
"@home" = {
mountpoint = "/home";
mountOptions = [ "compress=zstd" "noatime" ];
};
"@nix" = {
mountpoint = "/nix";
mountOptions = [ "compress=zstd" "noatime" ];
};
"@log" = {
mountpoint = "/var/log";
mountOptions = [ "compress=zstd" "noatime" ];
};
"@snapshots" = {
mountpoint = "/.snapshots";
mountOptions = [ "compress=zstd" "noatime" ];
};
};
postCreateHook = ''
MNTPOINT=$(mktemp -d)
mount -t btrfs /dev/mapper/crypted_main $MNTPOINT
btrfs subvolume snapshot -r $MNTPOINT/@ $MNTPOINT/root-blank
umount $MNTPOINT
'';
};
};
};
};
};
};
@ADDITIONAL_DISKS@
};
};
}

View File

@@ -282,8 +282,8 @@ select_disk() {
local picker local picker
picker=$(printf '%s' "$rows" | column -t -s $'\t') picker=$(printf '%s' "$rows" | column -t -s $'\t')
local choice local choice
choice=$(printf '%s\n' "$picker" | gum choose --header "Select target drive") choice=$(printf '%s\n' "$picker" | gum choose --no-limit --header "Select target drive(s) - Use Space to select multiple for BTRFS RAID/Single")
TARGET_DRIVE=$(awk '{print $1}' <<<"$choice") TARGET_DRIVE=$(awk '{print $1}' <<<"$choice" | xargs)
if [[ -z "$TARGET_DRIVE" ]]; then if [[ -z "$TARGET_DRIVE" ]]; then
error "No drive selected" error "No drive selected"
@@ -806,6 +806,49 @@ edit_fields() {
# STEP 9: EXECUTION # STEP 9: EXECUTION
# ============================================================================ # ============================================================================
# Pre-wipe the target drive before invoking disko.
#
# disko (at our pinned revision) gates two destructive steps on blkid:
# - lib/types/gpt.nix runs `sgdisk --clear` only when blkid sees no PT
# - lib/types/filesystem.nix skips mkfs entirely when blkid reports the
# target FS type already exists on the partition device
#
# On a previously-installed disk those branches mis-fire: blkid sees the old
# GPT and the old vfat ESP, so disko overlays its new partition entries on
# the existing table without zapping and skips mkfs.vfat, leaving the kernel
# to read a stale FAT BPB on the new (slightly different) ESP extent. mount
# then errors with "wrong fs type, bad option, bad superblock".
prewipe_target_drive() {
local drive="$1"
info "Pre-wiping $drive (clearing stale signatures)..."
# Tear down anything a prior aborted run left active.
umount -R /mnt 2>/dev/null || true
cryptsetup close crypted 2>/dev/null || true
swapoff -a 2>/dev/null || true
local part
if compgen -G "${drive}*" >/dev/null; then
for part in "${drive}"?*; do
[[ -b "$part" ]] || continue
wipefs -af "$part" >/dev/null 2>&1 || true
done
fi
wipefs -af "$drive" >/dev/null 2>&1 || true
sgdisk --zap-all "$drive" >/dev/null 2>&1 || true
# 16 MiB covers LUKS2 binary headers (04 MiB) and the BTRFS first
# superblock (64 KiB) — wipefs alone misses damaged variants of these.
dd if=/dev/zero of="$drive" bs=1M count=16 conv=fsync status=none 2>/dev/null || true
partprobe "$drive" 2>/dev/null || true
udevadm settle
success "Pre-wipe complete"
}
execute_installation() { execute_installation() {
if [[ "$DRY_RUN" == "true" ]]; then if [[ "$DRY_RUN" == "true" ]]; then
execute_dry_run execute_dry_run
@@ -815,12 +858,59 @@ execute_installation() {
section "Installing Nomarchy" section "Installing Nomarchy"
# 9.1 Partition with disko # 9.1 Partition with disko
info "Partitioning disk..." info "Partitioning disk(s)..."
for d in $TARGET_DRIVE; do
prewipe_target_drive "$d"
done
local disko_file tmp_disko local disko_file tmp_disko
disko_file="$NOMARCHY_REPO/installer/disko-golden.nix"
tmp_disko=$(mktemp --suffix=.nix) tmp_disko=$(mktemp --suffix=.nix)
sed "s|@TARGET_DRIVE@|${TARGET_DRIVE}|g" "$disko_file" > "$tmp_disko" local drives=($TARGET_DRIVE)
if [[ ${#drives[@]} -gt 1 ]]; then
disko_file="$NOMARCHY_REPO/installer/disko-btrfs-multi.nix"
local main_drive="${drives[0]}"
local btrfs_devs=""
local additional_disks=""
for (( i=1; i<${#drives[@]}; i++ )); do
local d="${drives[$i]}"
local name="extra_$i"
local luks_name="crypted_$name"
btrfs_devs+=", \"/dev/mapper/$luks_name\""
additional_disks+=" $name = {
type = \"disk\";
device = \"$d\";
content = {
type = \"gpt\";
partitions = {
luks = {
size = \"100%\";
content = {
type = \"luks\";
name = \"$luks_name\";
settings = {
allowDiscards = true;
passwordFile = \"/dev/shm/nomarchy-luks.key\";
};
content = {
type = \"btrfs\";
};
};
};
};
};
};
"
done
sed "s|@MAIN_DRIVE@|${main_drive}|g; s|@BTRFS_DEVICES@|${btrfs_devs}|g; s|@ADDITIONAL_DISKS@|${additional_disks}|g" "$disko_file" > "$tmp_disko"
else
disko_file="$NOMARCHY_REPO/installer/disko-golden.nix"
sed "s|@TARGET_DRIVE@|${TARGET_DRIVE}|g" "$disko_file" > "$tmp_disko"
fi
# Provide the LUKS passphrase via tmpfs so the secret never touches a # Provide the LUKS passphrase via tmpfs so the secret never touches a
# spinning disk. /dev/shm is tmpfs on the live ISO. We restrict perms # spinning disk. /dev/shm is tmpfs on the live ISO. We restrict perms

View File

@@ -9,6 +9,7 @@
theme = "nord"; theme = "nord";
wallpaper = ""; wallpaper = "";
font = "JetBrainsMono Nerd Font"; font = "JetBrainsMono Nerd Font";
panelPosition = "top";
nightlightTemperature = 4000; nightlightTemperature = 4000;
# Feature toggles # Feature toggles