Compare commits

..

2 Commits

Author SHA1 Message Date
7a3885a036 rename: temp_16tb -> Poup_16T throughout
- Module renamed to poup-16t-disk.nix
- Option namespace: gortium.poup16t (was gortium.temp16tb)
- LUKS name: poup_16t (was temp_16tb)
- Mount point: /mnt/Poup_16T (was /mnt/temp_16tb)
- btrbk instance: poup16t (was temp16tb)
- flake.nix import and host config updated
2026-06-17 14:57:37 -04:00
44b8121edb feat: add btrfs + btrbk module for 16TB data disk
- New module: modules/nixos/filesystem/temp-16tb-disk.nix with btrfs kernel support, btrfs-progs + btrbk, LUKS2 auto-unlock, nofail mount, btrbk daily snapshots (14d/4w/3m)
- Registered in flake.nix for lazyworkhorse
- Host config with commented-out enable block (fill UUID when disk reconnected)
2026-06-17 14:51:47 -04:00
5 changed files with 199 additions and 160 deletions

183
flake.nix
View File

@@ -12,21 +12,18 @@
url = "git+https://git.lix.systems/lix-project/lix?ref=main"; url = "git+https://git.lix.systems/lix-project/lix?ref=main";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
nixpkgs-uconsole.url = "github:NixOS/nixpkgs/nixos-25.11";
nixos-uconsole = { nixos-uconsole = {
url = "github:nixos-uconsole/nixos-uconsole/v1.1.0"; url = "github:nixos-uconsole/nixos-uconsole";
inputs.nixpkgs.follows = "nixpkgs-uconsole"; inputs.nixpkgs.follows = "nixpkgs";
inputs.nixos-raspberrypi.follows = "nixos-raspberrypi";
}; };
nixos-raspberrypi = { nixos-raspberrypi = {
url = "github:gortium/nixos-raspberrypi/cm5-cross-v1"; url = "github:nvmd/nixos-raspberrypi/v1.20260517.0";
inputs.nixpkgs.follows = "nixpkgs-uconsole"; inputs.nixpkgs.follows = "nixpkgs";
}; };
self.submodules = true;
}; };
outputs = { self, nixpkgs, agenix, lix outputs = { self, nixpkgs, agenix, lix, nixos-uconsole, nixos-raspberrypi, ... }@inputs:
, nixpkgs-uconsole, nixos-uconsole, nixos-raspberrypi
, ... }@inputs:
let let
system = "x86_64-linux"; system = "x86_64-linux";
keys = import ./lib/keys.nix; keys = import ./lib/keys.nix;
@@ -37,120 +34,78 @@
"/etc/ssh/ssh_host_ed25519_key" "/etc/ssh/ssh_host_ed25519_key"
"/root/.age/bootstrap.key" ]; "/root/.age/bootstrap.key" ];
}; };
overlays = [ agenix.overlays.default ]; overlays = [ agenix.overlays.default (import ./overlays/reticulum.nix) ];
pkgs = import nixpkgs { pkgs = import nixpkgs {
inherit system overlays; inherit system overlays;
config.allowUnfree = true; config.allowUnfree = true;
config.permittedInsecurePackages = [ "openclaw-2026.3.12" ]; config.permittedInsecurePackages = [
"openclaw-2026.3.12"
];
}; };
devShell = import ./shells/nix_dev.nix { devShell = import ./shells/nix_dev.nix {
inherit pkgs system agenix; inherit pkgs system agenix;
}; };
in { in
nixosConfigurations = { {
lazyworkhorse = nixpkgs.lib.nixosSystem { nixosConfigurations = {
specialArgs = { inherit system self keys paths inputs; }; lazyworkhorse = nixpkgs.lib.nixosSystem {
modules = [ specialArgs = { inherit system self keys paths inputs; };
{ modules = [
nixpkgs.overlays = overlays; {
nixpkgs.config.allowUnfree = true; nixpkgs.overlays = overlays;
nixpkgs.config.rocmSupport = true; nixpkgs.config.allowUnfree = true;
nixpkgs.config.permittedInsecurePackages = [ "openclaw-2026.3.12" ]; nixpkgs.config.rocmSupport = true;
nix.package = lix.packages.${system}.default; nixpkgs.config.permittedInsecurePackages = [
} "openclaw-2026.3.12"
agenix.nixosModules.default ];
./hosts/lazyworkhorse/configuration.nix nix.package = lix.packages.${system}.default;
./hosts/lazyworkhorse/hardware-configuration.nix }
./modules/nixos/filesystem/hoardingcow-mount.nix agenix.nixosModules.default
./modules/nixos/services/docker_manager.nix ./hosts/lazyworkhorse/configuration.nix
./modules/nixos/services/open_code_server.nix ./hosts/lazyworkhorse/hardware-configuration.nix
./modules/nixos/services/ollama_init_custom_models.nix ./modules/nixos/filesystem/hoardingcow-mount.nix
./modules/nixos/services/openclaw_node.nix ./modules/nixos/filesystem/poup-16t-disk.nix
./modules/nixos/security/ai-worker-restricted.nix ./modules/nixos/services/docker_manager.nix
./users/gortium.nix ./modules/nixos/services/open_code_server.nix
./users/ai-worker.nix ./modules/nixos/services/ollama_init_custom_models.nix
]; ./modules/nixos/services/openclaw_node.nix
}; ./modules/nixos/security/ai-worker-restricted.nix
./users/gortium.nix
cyt-pi = nixpkgs.lib.nixosSystem { ./users/ai-worker.nix
specialArgs = { inherit self keys paths inputs; }; ];
modules = [
{
nixpkgs.overlays = overlays;
nixpkgs.config.allowUnfree = true;
nixpkgs.hostPlatform = "aarch64-linux";
nix.package = lix.packages."aarch64-linux".default;
}
./hosts/cyt-pi/configuration.nix
./hosts/cyt-pi/hardware-configuration.nix
];
};
uconsole-cm5 = nixpkgs-uconsole.lib.nixosSystem {
system = "aarch64-linux";
specialArgs = {
inherit self keys paths inputs;
nixos-raspberrypi = nixos-raspberrypi;
isCM4 = false;
}; };
modules = [
{
nixpkgs.buildPlatform = "x86_64-linux";
nixpkgs.hostPlatform = "aarch64-linux";
nixpkgs.config.allowUnfree = true;
boot.loader.raspberry-pi.bootloader = "kernel";
}
nixos-raspberrypi.nixosModules.nixpkgs-rpi
# Fix display timings from Rex's kernel: native 720x1280 instead of
# rotated 1280x720, plus DCS-based panel detection.
({ lib, ... }: {
boot.kernelPatches = [{
name = "panel-cwu50-rex-timing-fix";
patch = ./patches/0008-panel-cwu50-rex-timing-fix.patch;
}];
})
nixos-raspberrypi.nixosModules.raspberry-pi-5.base
nixos-raspberrypi.lib.inject-overlays
nixos-raspberrypi.lib.inject-overlays-global
nixos-uconsole.nixosModules.uconsole-cm5
({ config, lib, pkgs, inputs, ... }: let
lix-cross = import inputs.nixpkgs-uconsole {
localSystem = { system = "x86_64-linux"; };
crossSystem = { system = "aarch64-linux"; };
overlays = [ inputs.lix.overlays.default ];
};
in { nix.package = lix-cross.lix; })
agenix.nixosModules.default
./hosts/uconsole-cm5/configuration.nix
./hosts/uconsole-cm5/hardware-configuration.nix
];
};
};
devShells.${system}.default = devShell; cyt-pi = nixpkgs.lib.nixosSystem {
specialArgs = { inherit self keys paths inputs; };
packages.${system} = { modules = [
uconsole-cm5-image = (nixos-raspberrypi.lib.nixosSystem { {
system = "aarch64-linux"; nixpkgs.overlays = overlays;
specialArgs = { nixpkgs.config.allowUnfree = true;
inherit self keys inputs; nixpkgs.hostPlatform = "aarch64-linux";
nixos-raspberrypi = nixos-raspberrypi; nix.package = lix.packages."aarch64-linux".default;
isCM4 = false; }
./hosts/cyt-pi/configuration.nix
./hosts/cyt-pi/hardware-configuration.nix
];
}; };
modules = [
{ uConsole = nixos-raspberrypi.lib.nixosSystem {
nixpkgs.buildPlatform = system; specialArgs = { inherit self keys paths inputs nixos-raspberrypi; };
nixpkgs.hostPlatform = "aarch64-linux"; modules = [
} {
nixos-raspberrypi.nixosModules.nixpkgs-rpi nixpkgs.overlays = overlays;
nixos-raspberrypi.nixosModules.raspberry-pi-5.base nixpkgs.config.allowUnfree = true;
nixos-raspberrypi.lib.inject-overlays-global nixpkgs.hostPlatform = "aarch64-linux";
nixos-raspberrypi.nixosModules.sd-image nix.package = lix.packages."aarch64-linux".default;
nixos-uconsole.nixosModules.uconsole-cm5 }
agenix.nixosModules.default nixos-raspberrypi.nixosModules.raspberry-pi-5.base
./hosts/uconsole-cm5/configuration.nix nixos-uconsole.nixosModules.uconsole-cm5
]; ./hosts/uConsole/configuration.nix
}).config.system.build.sdImage; ./hosts/uConsole/hardware-configuration.nix
];
};
};
devShells.${system}.default = devShell;
}; };
};
} }

View File

@@ -8,6 +8,14 @@
# NAS Mounting # NAS Mounting
hoardingcow-mount.enable = true; hoardingcow-mount.enable = true;
# 16TB btrfs storage disk (WD Red Pro — Poup_16T — LUKS2 + btrfs + btrbk snapshots)
# ⚠ SETUP REQUIRED: Connect the disk, get the LUKS UUID with 'blkid /dev/sdb',
# then set gortium.poup16t.luksUuid here and deploy.
# gortium.poup16t = {
# enable = true;
# luksUuid = "REPLACE_ME_WITH_REAL_UUID";
# };
# Flakesss # Flakesss
nix.settings.experimental-features = [ "nix-command" "flakes" "flake-self-attrs" ]; nix.settings.experimental-features = [ "nix-command" "flakes" "flake-self-attrs" ];
nix.settings.trusted-users = [ "root" "gortium" ]; nix.settings.trusted-users = [ "root" "gortium" ];

View File

@@ -0,0 +1,121 @@
{ config, lib, pkgs, ... }:
let
cfg = config.gortium.poup16t;
luksName = cfg.luksName;
in
with lib;
{
options.gortium.poup16t = {
enable = mkEnableOption "Poup_16T storage disk (btrfs + LUKS + btrbk snapshots)";
luksUuid = mkOption {
type = types.str;
description = ''
UUID of the LUKS partition on the 16TB disk (WD Red Pro).
Find this by running as root when the disk is connected:
blkid /dev/sdb # or wherever the disk appears
lsblk -o NAME,SIZE,FSTYPE,UUID
Since btrfs is inside LUKS, the FS UUID is hidden use the
LUKS partition UUID from blkid (it'll show TYPE=\"crypto_LUKS\").
'';
example = "00000000-0000-0000-0000-000000000000";
};
luksName = mkOption {
type = types.str;
default = "poup_16t";
description = "Name for the LUKS /dev/mapper/ mapping";
};
mountPoint = mkOption {
type = types.str;
default = "/mnt/Poup_16T";
description = "Mount point for the 16TB data disk";
};
btrfsOptions = mkOption {
type = types.listOf types.str;
default = [ "defaults" "noatime" "compress=zstd:3" "nofail" ];
description = "Mount options for the btrfs filesystem. 'nofail' ensures boot succeeds when disk is disconnected.";
};
btrbk = {
enable = mkOption {
type = types.bool;
default = true;
description = "Enable btrbk snapshot management on this volume";
};
schedule = mkOption {
type = types.str;
default = "daily";
description = "systemd calendar event for btrbk (e.g. 'daily', 'hourly', '*-*-* 00:00:00')";
};
preserveMin = mkOption {
type = types.str;
default = "2d";
description = "btrbk snapshot_preserve_min minimum age before pruning";
};
preserve = mkOption {
type = types.str;
default = "14d 4w 3m";
description = "btrbk snapshot_preserve retention policy (daily, weekly, monthly)";
};
snapshotDir = mkOption {
type = types.str;
default = ".snapshots";
description = "Directory name for snapshots relative to volume root";
};
};
};
config = mkIf cfg.enable {
# Enable btrfs kernel support (no DKMS needed — it's in-tree)
boot.supportedFilesystems = [ "btrfs" ];
# Install btrfs administration tools
environment.systemPackages = with pkgs; [
btrfs-progs # mkfs.btrfs, btrfs, fsck, balance, scrub
btrbk # Snapshot management + rotation
];
# LUKS2 unlock at boot (uses keyfile or prompts if unavailable)
# Since the disk may be disconnected, initrd times out gracefully (~30s)
boot.initrd.luks.devices.${luksName} = {
device = "/dev/disk/by-uuid/${cfg.luksUuid}";
preLVM = false;
allowDiscards = true;
};
# Mount the unlocked mapper device as btrfs
fileSystems.${cfg.mountPoint} = {
device = "/dev/mapper/${luksName}";
fsType = "btrfs";
options = cfg.btrfsOptions;
};
# btrbk — automated snapshot creation and rotation
services.btrbk = mkIf cfg.btrbk.enable {
instances.poup16t = {
onCalendar = cfg.btrbk.schedule;
settings = {
snapshot_preserve_min = cfg.btrbk.preserveMin;
snapshot_preserve = cfg.btrbk.preserve;
volume.${cfg.mountPoint} = {
snapshot_create = "always";
snapshot_dir = cfg.btrbk.snapshotDir;
subvolume = ".";
};
};
};
};
};
}

View File

@@ -1,45 +0,0 @@
--- a/drivers/gpu/drm/panel/panel-cwu50.c
+++ b/drivers/gpu/drm/panel/panel-cwu50.c
@@ -27,12 +27,12 @@ static const struct drm_display_mode default_mode = {
.clock = 61020,
- .hdisplay = 1280,
- .hsync_start = 1280 + 8,
- .hsync_end = 1280 + 8 + 2,
- .htotal = 1280 + 8 + 2 + 16,
- .vdisplay = 720,
- .vsync_start = 720 + 30,
- .vsync_end = 720 + 30 + 15,
- .vtotal = 720 + 30 + 15 + 15,
+ .hdisplay = 720,
+ .hsync_start = 720 + 30,
+ .hsync_end = 720 + 30 + 15,
+ .htotal = 720 + 30 + 15 + 15,
+ .vdisplay = 1280,
+ .vsync_start = 1280 + 8,
+ .vsync_end = 1280 + 8 + 2,
+ .vtotal = 1280 + 8 + 2 + 16,
};
static inline struct cwu50 *panel_to_cwu50(struct drm_panel *panel)
@@ -586,7 +586,8 @@ static int cwu50_init_sequence2(struct cwu50 *ctx)
{
struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev);
- int err;
+ int err;
+ u8 buf[4];
dcs_write_seq(0xE0,0x00);
@@ -633,6 +634,12 @@ static int cwu50_init_sequence2(struct cwu50 *ctx)
dcs_write_seq(0x11);// SLPOUT
msleep (200);
+ dcs_write_seq(0xE0,0x00);
+ mipi_dsi_dcs_read(dsi, 0x04, buf, 3);
+
+ if(buf[0] == 0x39) ctx->is_new_panel = 1;
+
+ dcs_write_seq(0xE0,0x00);
dcs_write_seq(0x29);// DSiPON
msleep (100);