Declare the disk layout with disko

Installing used to mean six manual steps through Calamares, one of which
copied hardware-configuration.nix into the repo — a step that fails
silently unless the file is also git added, since Nix only sees tracked
files. It also did not scale past one machine.

modules/disk.nix defines moonarch.disk.{enable,device,encrypt,espSize,
swapSize} and builds disko.devices from it, so another machine is a
device path rather than a new layout. Installing is a single
disko-install run from the ISO.

hardware-configuration.nix is no longer needed: nvme, ahci, sd_mod and
the USB HID modules are in the initrd via
boot.initrd.includeDefaultModules, and nixpkgs.hostPlatform comes from
nixosSystem. The testvm copy described a qcow2 that no longer exists and
is deleted; that host now uses the module against /dev/vda.

The user password no longer arrives with the installer, so it is set
once via nixos-enter after installing instead of committing a hash.
This commit is contained in:
nevaforget committed 2026-08-11 09:50:55 +02:00
1 parent 9988dc1e7b
commit 1ec12da9ff
7 files changed
+279 -81

No files matched your search

+9 -1
View File
@@ -4,7 +4,15 @@
{ pkgs, ... }:
{
imports = [ ./hardware-configuration.nix ];
# The launcher attaches the qcow2 as if=virtio, so the guest sees /dev/vda.
# There is no by-id path for it — the disk only exists inside the VM.
# Encryption stays on: this is where the LUKS layer gets exercised before it
# runs on real hardware.
moonarch.disk = {
enable = true;
device = "/dev/vda";
swapSize = "2G";
};
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
-44
View File
@@ -1,44 +0,0 @@
# Do not modify this file! It was generated by ‘nixos-generate-config’
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/profiles/qemu-guest.nix")
];
boot.initrd.availableKernelModules = [ "ata_piix" "virtio_pci" "floppy" "sr_mod" "virtio_blk" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/b88b75df-3999-4110-9e37-b8b76bf8206d";
fsType = "btrfs";
};
fileSystems."/home" =
{ device = "/dev/disk/by-uuid/b88b75df-3999-4110-9e37-b8b76bf8206d";
fsType = "btrfs";
options = [ "subvol=home" ];
};
fileSystems."/nix" =
{ device = "/dev/disk/by-uuid/b88b75df-3999-4110-9e37-b8b76bf8206d";
fsType = "btrfs";
options = [ "subvol=nix" ];
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/77FC-6FE3";
fsType = "vfat";
options = [ "fmask=0077" "dmask=0077" ];
};
swapDevices =
[ { device = "/dev/disk/by-uuid/47747ffb-51b7-44c5-a2f3-6db564497c5c"; }
];
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
}