From 2f18d4efcf954c74a9e005f414cb938eab30b8d5 Mon Sep 17 00:00:00 2001 From: Bernardo Magri Date: Sat, 2 May 2026 11:07:02 +0100 Subject: [PATCH] fix(installer): unblock disko, bootloader, HM activation, hyprland res MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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 --- core/system/nix.nix | 8 ++++++ .../desktop/hyprland/config/monitors.conf | 2 +- flake.nix | 4 +-- installer/install.sh | 26 ++++++++++++++----- 4 files changed, 30 insertions(+), 10 deletions(-) diff --git a/core/system/nix.nix b/core/system/nix.nix index 3855ba0..62fc380 100644 --- a/core/system/nix.nix +++ b/core/system/nix.nix @@ -11,6 +11,14 @@ # Optimize storage by hard-linking identical files 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. diff --git a/features/desktop/hyprland/config/monitors.conf b/features/desktop/hyprland/config/monitors.conf index 5506311..ed050fd 100644 --- a/features/desktop/hyprland/config/monitors.conf +++ b/features/desktop/hyprland/config/monitors.conf @@ -13,7 +13,7 @@ # Straight 1x setup for low-resolution displays like 1080p or 1440p # Or for ultrawide monitors like 34" 3440x1440 or 49" 5120x1440 env = GDK_SCALE,1 - monitor=,preferred,auto,1 + monitor=,highres,auto,1 # Portrait/rotated secondary monitor (transform: 1 = 90°, 3 = 270°) # monitor = DP-2, preferred, auto, 1, transform, 1 diff --git a/flake.nix b/flake.nix index d36cf7b..7a7a521 100644 --- a/flake.nix +++ b/flake.nix @@ -168,10 +168,10 @@ # Live-ISO-only welcome. Pops a notification a few seconds # after the graphical session is up and opens a terminal # 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. 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 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"' diff --git a/installer/install.sh b/installer/install.sh index 0699904..87f6c61 100755 --- a/installer/install.sh +++ b/installer/install.sh @@ -1110,6 +1110,7 @@ run_disko_with_retry() { if [[ "$NOMARCHY_VERBOSE_DISKO" == "1" ]]; then set +e disko --mode destroy,format,mount \ + --yes-wipe-all-disks \ --argstr mainDrive "$main_drive" \ --arg extraDrives "$extras_nix" \ "$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..." -- \ bash -c ' disko --mode destroy,format,mount \ + --yes-wipe-all-disks \ --argstr mainDrive "$1" \ --arg extraDrives "$2" \ "$3" > "$4" 2>&1 @@ -1256,16 +1258,18 @@ execute_installation() { # 9.8 Activate Home Manager for $USERNAME inside the new system so the # 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 - # `runuser` (sudo -u keeps the caller's HOME → files land in /root). + # switch` must run as the target user with a real \$HOME *and* a + # \$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..." if nixos-enter --root /mnt -- bash -c " set -e install -d -o '$USERNAME' -g users -m 0755 '/home/$USERNAME' - runuser -u '$USERNAME' -- env HOME='/home/$USERNAME' \ - nix --extra-experimental-features 'nix-command flakes' \ - run 'home-manager/release-25.11' -- switch \ - --flake '/etc/nixos#$USERNAME' --impure + runuser -l '$USERNAME' -c \"nix --extra-experimental-features 'nix-command flakes' run 'home-manager/release-25.11' -- switch --flake '/etc/nixos#$USERNAME' --impure\" "; then success "Home Manager activated" else @@ -1424,9 +1428,12 @@ generate_flake_config() { in { nixosConfigurations.$HOSTNAME = nixpkgs.lib.nixosSystem { - inherit pkgs; specialArgs = { inputs = nomarchy.inputs; }; modules = [ + { + nixpkgs.hostPlatform = system; + nixpkgs.overlays = [ nomarchy.overlays.default ]; + } ./hardware-configuration.nix ./hardware-selection.nix nomarchy.nixosModules.system @@ -1479,6 +1486,11 @@ EOF networking.hostName = "$HOSTNAME"; 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. console.keyMap = "$KEYMAP_LAYOUT"; i18n.defaultLocale = "$LOCALE";