fix(installer): unblock disko, bootloader, HM activation, hyprland res

- Pass --yes-wipe-all-disks to disko so the silent gum-spin path no
  longer hangs forever waiting on a hidden "yes" confirmation prompt
  (added in disko 1.13's destroy,format,mount mode).
- Stop threading an externally-built pkgs into the user flake's
  nixosSystem; configure nixpkgs through the module system instead so
  core/system/default.nix's nixpkgs.config.allowUnfree stops conflicting
  with the assertion "system configures nixpkgs with an externally
  created instance".
- Enable boot.loader.systemd-boot in the generated system.nix so the
  installed system has an actual bootloader (disko already lays out a
  1 GiB ESP at /boot).
- Bump nix.settings.download-buffer-size to 512 MiB to silence the
  "download buffer is full" warning on large NAR fetches.
- Activate home-manager via `runuser -l` instead of `runuser -u … --
  env HOME=…`. The latter only switches uid and leaves \$USER=root, so
  HM's activation script saw root, warned, and wrote dotfiles into
  /root/ — meaning the user's first login had no Hyprland config.
- Revert default Hyprland monitor line back to highres (live ISO and
  user default) — preferred falls back to EDID's 1024x768 in QEMU and
  on several laptop panels, which is the bug highres was put there to
  defeat.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Bernardo Magri
2026-05-02 11:07:02 +01:00
parent 329dc009b6
commit 2f18d4efcf
4 changed files with 30 additions and 10 deletions

View File

@@ -11,6 +11,14 @@
# Optimize storage by hard-linking identical files # Optimize storage by hard-linking identical files
auto-optimise-store = lib.mkDefault true; auto-optimise-store = lib.mkDefault true;
# Bump the substituter download buffer from the 64 MiB default to
# 512 MiB. Large NARs (kernels, electron apps, the full NixOS
# closure on first install) overrun 64 MiB and Nix prints
# "download buffer is full" until the consumer catches up — the
# warning is harmless but slows substitution and looks like an
# error. 512 MiB comfortably covers everything in our closure.
download-buffer-size = 524288000;
}; };
# Populates NIX_PATH with the nixpkgs input from the flake. # Populates NIX_PATH with the nixpkgs input from the flake.

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

@@ -168,10 +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. Force preferred monitor detection as some # hunt for it. Force highres monitor detection as some
# hardware defaults to 1024x768. # hardware defaults to 1024x768.
wayland.windowManager.hyprland.extraConfig = nixpkgs.lib.mkAfter '' wayland.windowManager.hyprland.extraConfig = nixpkgs.lib.mkAfter ''
monitor = , preferred, auto, 1 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

@@ -1110,6 +1110,7 @@ run_disko_with_retry() {
if [[ "$NOMARCHY_VERBOSE_DISKO" == "1" ]]; then if [[ "$NOMARCHY_VERBOSE_DISKO" == "1" ]]; then
set +e set +e
disko --mode destroy,format,mount \ disko --mode destroy,format,mount \
--yes-wipe-all-disks \
--argstr mainDrive "$main_drive" \ --argstr mainDrive "$main_drive" \
--arg extraDrives "$extras_nix" \ --arg extraDrives "$extras_nix" \
"$disko_file" 2>&1 | tee "$log" "$disko_file" 2>&1 | tee "$log"
@@ -1125,6 +1126,7 @@ run_disko_with_retry() {
nrun gum spin --spinner dot --title "Partitioning disk(s) with disko..." -- \ nrun gum spin --spinner dot --title "Partitioning disk(s) with disko..." -- \
bash -c ' bash -c '
disko --mode destroy,format,mount \ disko --mode destroy,format,mount \
--yes-wipe-all-disks \
--argstr mainDrive "$1" \ --argstr mainDrive "$1" \
--arg extraDrives "$2" \ --arg extraDrives "$2" \
"$3" > "$4" 2>&1 "$3" > "$4" 2>&1
@@ -1256,16 +1258,18 @@ execute_installation() {
# 9.8 Activate Home Manager for $USERNAME inside the new system so the # 9.8 Activate Home Manager for $USERNAME inside the new system so the
# user's first login already has Nomarchy's dotfiles. `home-manager # user's first login already has Nomarchy's dotfiles. `home-manager
# switch` must run as the target user with a real $HOME, so we use # switch` must run as the target user with a real \$HOME *and* a
# `runuser` (sudo -u keeps the caller's HOME → files land in /root). # \$USER env var pointing at them — home-manager's activation script
# bails with "running as root" if \$USER is still root, even when the
# uid has been switched. `runuser -l` runs a login shell, which sets
# HOME, USER, LOGNAME, and SHELL from the user database; plain
# `runuser -u … -- env HOME=…` switches uid only and leaves \$USER
# as root, which is what landed the dotfiles in /root previously.
info "Activating Home Manager for $USERNAME..." info "Activating Home Manager for $USERNAME..."
if nixos-enter --root /mnt -- bash -c " if nixos-enter --root /mnt -- bash -c "
set -e set -e
install -d -o '$USERNAME' -g users -m 0755 '/home/$USERNAME' install -d -o '$USERNAME' -g users -m 0755 '/home/$USERNAME'
runuser -u '$USERNAME' -- env HOME='/home/$USERNAME' \ runuser -l '$USERNAME' -c \"nix --extra-experimental-features 'nix-command flakes' run 'home-manager/release-25.11' -- switch --flake '/etc/nixos#$USERNAME' --impure\"
nix --extra-experimental-features 'nix-command flakes' \
run 'home-manager/release-25.11' -- switch \
--flake '/etc/nixos#$USERNAME' --impure
"; then "; then
success "Home Manager activated" success "Home Manager activated"
else else
@@ -1424,9 +1428,12 @@ generate_flake_config() {
in in
{ {
nixosConfigurations.$HOSTNAME = nixpkgs.lib.nixosSystem { nixosConfigurations.$HOSTNAME = nixpkgs.lib.nixosSystem {
inherit pkgs;
specialArgs = { inputs = nomarchy.inputs; }; specialArgs = { inputs = nomarchy.inputs; };
modules = [ modules = [
{
nixpkgs.hostPlatform = system;
nixpkgs.overlays = [ nomarchy.overlays.default ];
}
./hardware-configuration.nix ./hardware-configuration.nix
./hardware-selection.nix ./hardware-selection.nix
nomarchy.nixosModules.system nomarchy.nixosModules.system
@@ -1479,6 +1486,11 @@ EOF
networking.hostName = "$HOSTNAME"; networking.hostName = "$HOSTNAME";
time.timeZone = "$TIMEZONE"; time.timeZone = "$TIMEZONE";
# UEFI bootloader. Disko lays out a 1 GiB ESP at /boot — switch to
# boot.loader.grub if you're installing on a legacy-BIOS machine.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
# Keyboard & language — set by the installer. # Keyboard & language — set by the installer.
console.keyMap = "$KEYMAP_LAYOUT"; console.keyMap = "$KEYMAP_LAYOUT";
i18n.defaultLocale = "$LOCALE"; i18n.defaultLocale = "$LOCALE";