Compare commits
2 Commits
fix/uconso
...
feat/temp-
| Author | SHA1 | Date | |
|---|---|---|---|
| 7a3885a036 | |||
| 44b8121edb |
Submodule assets/compose updated: d3f2e3b7b9...dab158da0a
95
flake.nix
95
flake.nix
@@ -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,16 +34,20 @@
|
|||||||
"/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 = {
|
nixosConfigurations = {
|
||||||
lazyworkhorse = nixpkgs.lib.nixosSystem {
|
lazyworkhorse = nixpkgs.lib.nixosSystem {
|
||||||
specialArgs = { inherit system self keys paths inputs; };
|
specialArgs = { inherit system self keys paths inputs; };
|
||||||
@@ -55,13 +56,16 @@
|
|||||||
nixpkgs.overlays = overlays;
|
nixpkgs.overlays = overlays;
|
||||||
nixpkgs.config.allowUnfree = true;
|
nixpkgs.config.allowUnfree = true;
|
||||||
nixpkgs.config.rocmSupport = true;
|
nixpkgs.config.rocmSupport = true;
|
||||||
nixpkgs.config.permittedInsecurePackages = [ "openclaw-2026.3.12" ];
|
nixpkgs.config.permittedInsecurePackages = [
|
||||||
|
"openclaw-2026.3.12"
|
||||||
|
];
|
||||||
nix.package = lix.packages.${system}.default;
|
nix.package = lix.packages.${system}.default;
|
||||||
}
|
}
|
||||||
agenix.nixosModules.default
|
agenix.nixosModules.default
|
||||||
./hosts/lazyworkhorse/configuration.nix
|
./hosts/lazyworkhorse/configuration.nix
|
||||||
./hosts/lazyworkhorse/hardware-configuration.nix
|
./hosts/lazyworkhorse/hardware-configuration.nix
|
||||||
./modules/nixos/filesystem/hoardingcow-mount.nix
|
./modules/nixos/filesystem/hoardingcow-mount.nix
|
||||||
|
./modules/nixos/filesystem/poup-16t-disk.nix
|
||||||
./modules/nixos/services/docker_manager.nix
|
./modules/nixos/services/docker_manager.nix
|
||||||
./modules/nixos/services/open_code_server.nix
|
./modules/nixos/services/open_code_server.nix
|
||||||
./modules/nixos/services/ollama_init_custom_models.nix
|
./modules/nixos/services/ollama_init_custom_models.nix
|
||||||
@@ -86,71 +90,22 @@
|
|||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
uconsole-cm5 = nixpkgs-uconsole.lib.nixosSystem {
|
uConsole = nixos-raspberrypi.lib.nixosSystem {
|
||||||
system = "aarch64-linux";
|
specialArgs = { inherit self keys paths inputs nixos-raspberrypi; };
|
||||||
specialArgs = {
|
|
||||||
inherit self keys paths inputs;
|
|
||||||
nixos-raspberrypi = nixos-raspberrypi;
|
|
||||||
isCM4 = false;
|
|
||||||
};
|
|
||||||
modules = [
|
modules = [
|
||||||
{
|
{
|
||||||
nixpkgs.buildPlatform = "x86_64-linux";
|
nixpkgs.overlays = overlays;
|
||||||
nixpkgs.hostPlatform = "aarch64-linux";
|
|
||||||
nixpkgs.config.allowUnfree = true;
|
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;
|
|
||||||
|
|
||||||
packages.${system} = {
|
|
||||||
uconsole-cm5-image = (nixos-raspberrypi.lib.nixosSystem {
|
|
||||||
system = "aarch64-linux";
|
|
||||||
specialArgs = {
|
|
||||||
inherit self keys inputs;
|
|
||||||
nixos-raspberrypi = nixos-raspberrypi;
|
|
||||||
isCM4 = false;
|
|
||||||
};
|
|
||||||
modules = [
|
|
||||||
{
|
|
||||||
nixpkgs.buildPlatform = system;
|
|
||||||
nixpkgs.hostPlatform = "aarch64-linux";
|
nixpkgs.hostPlatform = "aarch64-linux";
|
||||||
|
nix.package = lix.packages."aarch64-linux".default;
|
||||||
}
|
}
|
||||||
nixos-raspberrypi.nixosModules.nixpkgs-rpi
|
|
||||||
nixos-raspberrypi.nixosModules.raspberry-pi-5.base
|
nixos-raspberrypi.nixosModules.raspberry-pi-5.base
|
||||||
nixos-raspberrypi.lib.inject-overlays-global
|
|
||||||
nixos-raspberrypi.nixosModules.sd-image
|
|
||||||
nixos-uconsole.nixosModules.uconsole-cm5
|
nixos-uconsole.nixosModules.uconsole-cm5
|
||||||
agenix.nixosModules.default
|
./hosts/uConsole/configuration.nix
|
||||||
./hosts/uconsole-cm5/configuration.nix
|
./hosts/uConsole/hardware-configuration.nix
|
||||||
];
|
];
|
||||||
}).config.system.build.sdImage;
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
devShells.${system}.default = devShell;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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" ];
|
||||||
|
|||||||
121
modules/nixos/filesystem/poup-16t-disk.nix
Normal file
121
modules/nixos/filesystem/poup-16t-disk.nix
Normal 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 = ".";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -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);
|
|
||||||
Reference in New Issue
Block a user