Fix stinky build.
This commit is contained in:
@@ -49,7 +49,7 @@ Unlike btrfs-based hosts that use `/persist`, Pi hosts use `/nix/persist`:
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Build SD image for stinky
|
# Build SD image for stinky
|
||||||
nix build .#stinky-sdImage
|
nix build .#packages.aarch64-linux.stinky-sdImage
|
||||||
|
|
||||||
# Result location
|
# Result location
|
||||||
ls -lh result/sd-image/
|
ls -lh result/sd-image/
|
||||||
|
|||||||
@@ -7,16 +7,19 @@
|
|||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
../../common/global
|
../../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/resource-limits.nix
|
||||||
../../common/sshd.nix
|
../../common/sshd.nix
|
||||||
../../common/user-ppetru.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
|
./hardware.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
networking.hostName = "stinky";
|
networking.hostName = "stinky";
|
||||||
|
|
||||||
|
# Configure impermanence for tmpfs root (filesystem config in hardware.nix)
|
||||||
|
custom.impermanence.persistPath = "/nix/persist";
|
||||||
|
|
||||||
# Tailscale configuration
|
# Tailscale configuration
|
||||||
services.tailscaleAutoconnect.authkey = "PLACEHOLDER"; # Will be set in secrets
|
services.tailscaleAutoconnect.authkey = "PLACEHOLDER"; # Will be set in secrets
|
||||||
|
|
||||||
@@ -35,7 +38,7 @@
|
|||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
libcamera
|
libcamera
|
||||||
raspberrypi-tools
|
libraspberrypi
|
||||||
];
|
];
|
||||||
|
|
||||||
# Firewall: Allow access to OctoPrint
|
# Firewall: Allow access to OctoPrint
|
||||||
@@ -43,5 +46,6 @@
|
|||||||
5000 # OctoPrint
|
5000 # OctoPrint
|
||||||
];
|
];
|
||||||
|
|
||||||
system.stateVersion = "25.05";
|
# Override global default (stinky is a new system with 25.05)
|
||||||
|
system.stateVersion = lib.mkForce "25.05";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,25 +13,45 @@
|
|||||||
# Raspberry Pi 4 platform
|
# Raspberry Pi 4 platform
|
||||||
nixpkgs.hostPlatform = lib.mkDefault "aarch64-linux";
|
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
|
# Boot configuration - provided by sd-image-aarch64.nix
|
||||||
# (grub disabled, generic-extlinux-compatible enabled, U-Boot setup)
|
# (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
|
# /boot/firmware is automatically configured by sd-image module
|
||||||
# Device: /dev/disk/by-label/FIRMWARE (vfat)
|
# Device: /dev/disk/by-label/FIRMWARE (vfat)
|
||||||
|
|
||||||
# Mount /nix from the NIXOS_SD partition
|
# tmpfs root with impermanence
|
||||||
# /nix/persist will be a directory on this partition (not a separate mount)
|
# Override sd-image module's ext4 root definition with mkForce
|
||||||
fileSystems."/nix" = {
|
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";
|
device = "/dev/disk/by-label/NIXOS_SD";
|
||||||
fsType = "ext4";
|
fsType = "ext4";
|
||||||
options = [ "noatime" ];
|
options = [ "noatime" ];
|
||||||
neededForBoot = true;
|
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)
|
# No swap on SD card (wear concern)
|
||||||
swapDevices = [ ];
|
swapDevices = [ ];
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user