Fix stinky build.

This commit is contained in:
2025-10-27 16:17:26 +00:00
parent 762037d17f
commit 98769f59d6
3 changed files with 36 additions and 12 deletions

View File

@@ -49,7 +49,7 @@ Unlike btrfs-based hosts that use `/persist`, Pi hosts use `/nix/persist`:
```bash
# Build SD image for stinky
nix build .#stinky-sdImage
nix build .#packages.aarch64-linux.stinky-sdImage
# Result location
ls -lh result/sd-image/

View File

@@ -7,16 +7,19 @@
{
imports = [
../../common/global
../../common/impermanence-tmpfs.nix # Use tmpfs root with /nix/persist
../../common/impermanence-common.nix # Impermanence with custom root config (see hardware.nix)
../../common/resource-limits.nix
../../common/sshd.nix
../../common/user-ppetru.nix
../../common/systemd-boot.nix
# Note: No systemd-boot.nix - Raspberry Pi uses generic-extlinux-compatible (from sd-image module)
./hardware.nix
];
networking.hostName = "stinky";
# Configure impermanence for tmpfs root (filesystem config in hardware.nix)
custom.impermanence.persistPath = "/nix/persist";
# Tailscale configuration
services.tailscaleAutoconnect.authkey = "PLACEHOLDER"; # Will be set in secrets
@@ -35,7 +38,7 @@
environment.systemPackages = with pkgs; [
libcamera
raspberrypi-tools
libraspberrypi
];
# Firewall: Allow access to OctoPrint
@@ -43,5 +46,6 @@
5000 # OctoPrint
];
system.stateVersion = "25.05";
# Override global default (stinky is a new system with 25.05)
system.stateVersion = lib.mkForce "25.05";
}

View File

@@ -13,25 +13,45 @@
# Raspberry Pi 4 platform
nixpkgs.hostPlatform = lib.mkDefault "aarch64-linux";
# Disable ZFS (not needed, and broken with latest kernel)
boot.supportedFilesystems.zfs = lib.mkForce false;
# Boot configuration - provided by sd-image-aarch64.nix
# (grub disabled, generic-extlinux-compatible enabled, U-Boot setup)
# Override root filesystem to use tmpfs (from impermanence-tmpfs.nix)
# The sd-image module sets root to /dev/disk/by-label/NIXOS_SD (ext4)
# but impermanence-tmpfs.nix overrides it to tmpfs
# /boot/firmware is automatically configured by sd-image module
# Device: /dev/disk/by-label/FIRMWARE (vfat)
# Mount /nix from the NIXOS_SD partition
# /nix/persist will be a directory on this partition (not a separate mount)
fileSystems."/nix" = {
# tmpfs root with impermanence
# Override sd-image module's ext4 root definition with mkForce
fileSystems."/" = lib.mkForce {
device = "none";
fsType = "tmpfs";
options = [
"defaults"
"size=2G"
"mode=755"
];
};
# The SD partition contains /nix/store and /nix/persist at its root
# Mount it at a hidden location, then bind mount its /nix to /nix
fileSystems."/mnt/nixos-sd" = {
device = "/dev/disk/by-label/NIXOS_SD";
fsType = "ext4";
options = [ "noatime" ];
neededForBoot = true;
};
# Bind mount /nix from the SD partition
fileSystems."/nix" = {
device = "/mnt/nixos-sd/nix";
fsType = "none";
options = [ "bind" ];
neededForBoot = true;
depends = [ "/mnt/nixos-sd" ];
};
# No swap on SD card (wear concern)
swapDevices = [ ];