(untested) config for stinky and diff script.

This commit is contained in:
2025-10-27 12:21:57 +00:00
parent 32a22c783d
commit 762037d17f
22 changed files with 899 additions and 37 deletions

47
hosts/stinky/default.nix Normal file
View File

@@ -0,0 +1,47 @@
{
lib,
pkgs,
config,
...
}:
{
imports = [
../../common/global
../../common/impermanence-tmpfs.nix # Use tmpfs root with /nix/persist
../../common/resource-limits.nix
../../common/sshd.nix
../../common/user-ppetru.nix
../../common/systemd-boot.nix
./hardware.nix
];
networking.hostName = "stinky";
# Tailscale configuration
services.tailscaleAutoconnect.authkey = "PLACEHOLDER"; # Will be set in secrets
# OctoPrint for 3D printer
services.octoprint = {
enable = true;
};
# Persist OctoPrint data
environment.persistence.${config.custom.impermanence.persistPath}.directories = [
"/var/lib/octoprint"
];
# Pi HQ Camera support
boot.kernelModules = [ "bcm2835-v4l2" ];
environment.systemPackages = with pkgs; [
libcamera
raspberrypi-tools
];
# Firewall: Allow access to OctoPrint
networking.firewall.allowedTCPPorts = [
5000 # OctoPrint
];
system.stateVersion = "25.05";
}

53
hosts/stinky/hardware.nix Normal file
View File

@@ -0,0 +1,53 @@
{
config,
lib,
pkgs,
modulesPath,
...
}:
{
imports = [
(modulesPath + "/installer/sd-card/sd-image-aarch64.nix")
];
# Raspberry Pi 4 platform
nixpkgs.hostPlatform = lib.mkDefault "aarch64-linux";
# 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" = {
device = "/dev/disk/by-label/NIXOS_SD";
fsType = "ext4";
options = [ "noatime" ];
neededForBoot = true;
};
# No swap on SD card (wear concern)
swapDevices = [ ];
# SD image build configuration
sdImage = {
compressImage = true;
# Populate root with directories
populateRootCommands = ''
mkdir -p ./files/boot
${config.boot.loader.generic-extlinux-compatible.populateCmd} -c ${config.system.build.toplevel} -d ./files/boot
# Create /nix/persist directory structure for impermanence
mkdir -p ./files/nix/persist/var/lib/nixos
mkdir -p ./files/nix/persist/home/ppetru
mkdir -p ./files/nix/persist/etc
'';
};
}