From e08bf42eaa67073fd2d6f8d09e650c93bafa6ede Mon Sep 17 00:00:00 2001 From: Dominik Polakovics Date: Sun, 7 Dec 2025 12:59:27 +0100 Subject: [PATCH] fix: nas leds and disks --- hosts/nas/hardware-configuration.nix | 2 -- hosts/nas/modules/power-management.nix | 2 +- hosts/nas/modules/ugreen-leds.nix | 6 +++--- .../pyload-ng/patches/declarative-env-config.patch | 12 ++++++------ 4 files changed, 10 insertions(+), 12 deletions(-) diff --git a/hosts/nas/hardware-configuration.nix b/hosts/nas/hardware-configuration.nix index 6f82f8b..1e43f96 100644 --- a/hosts/nas/hardware-configuration.nix +++ b/hosts/nas/hardware-configuration.nix @@ -30,8 +30,6 @@ mdadmConf = '' DEVICE /dev/disk/by-id/nvme-KIOXIA-EXCERIA_PLUS_G3_SSD_7FJKS1MAZ0E7-part1 DEVICE /dev/disk/by-id/nvme-KIOXIA-EXCERIA_PLUS_G3_SSD_7FJKS1M9Z0E7-part1 - DEVICE /dev/disk/by-id/ata-ST18000NM000J-2TV103_ZR52TBSB-part1 - DEVICE /dev/disk/by-id/ata-ST18000NM000J-2TV103_ZR52V9QX-part1 DEVICE /dev/disk/by-id/ata-TOSHIBA_MG10ACA20TE_8582A01SF4MJ-part1 DEVICE /dev/disk/by-id/ata-TOSHIBA_MG10ACA20TE_75V2A0H3F4MJ-part1 ''; diff --git a/hosts/nas/modules/power-management.nix b/hosts/nas/modules/power-management.nix index 2138963..51a812c 100644 --- a/hosts/nas/modules/power-management.nix +++ b/hosts/nas/modules/power-management.nix @@ -18,7 +18,7 @@ # Toshiba 20TB NAS drives - same settings ACTION=="add", KERNEL=="sd[a-z]", SUBSYSTEM=="block", \ - ATTRS{model}=="TOSHIBA MG10ACA20TE*", \ + ATTRS{model}=="TOSHIBA MG10ACA2*", \ RUN+="${pkgs.hdparm}/bin/hdparm -B 127 -S 180 /dev/%k" ''; } diff --git a/hosts/nas/modules/ugreen-leds.nix b/hosts/nas/modules/ugreen-leds.nix index b859427..a9360e2 100644 --- a/hosts/nas/modules/ugreen-leds.nix +++ b/hosts/nas/modules/ugreen-leds.nix @@ -4,11 +4,11 @@ let # Disk mapping: ata port -> LED name - # DXP4800 has bays 1-4, currently bays 2 and 4 are populated + # DXP4800 has bays 1-4, all populated diskMapping = { - # ata-2 (sdb) -> disk2 + "1" = "disk1"; "2" = "disk2"; - # ata-4 (sdc) -> disk4 + "3" = "disk3"; "4" = "disk4"; }; diff --git a/utils/pkgs/pyload-ng/patches/declarative-env-config.patch b/utils/pkgs/pyload-ng/patches/declarative-env-config.patch index 589a041..1052d62 100644 --- a/utils/pkgs/pyload-ng/patches/declarative-env-config.patch +++ b/utils/pkgs/pyload-ng/patches/declarative-env-config.patch @@ -1,5 +1,3 @@ -diff --git a/src/pyload/core/__init__.py b/src/pyload/core/__init__.py -index 4324fc700..5d915a85e 100644 --- a/src/pyload/core/__init__.py +++ b/src/pyload/core/__init__.py @@ -130,6 +130,14 @@ class Core: @@ -17,12 +15,13 @@ index 4324fc700..5d915a85e 100644 # If no argument set, read storage dir from config file, # otherwise save setting to config dir if storagedir is None: -@@ -227,6 +235,18 @@ class Core: +@@ -226,6 +234,20 @@ class Core: + self.acm = self.account_manager = AccountManager(self) self.thm = self.thread_manager = ThreadManager(self) self.cpm = self.captcha_manager = CaptchaManager(self) - self.adm = self.addon_manager = AddonManager(self) + -+ # Process plugin config environment variables after plugins are loaded (NixOS declarative config) ++ # Process plugin config environment variables BEFORE AddonManager (NixOS declarative config) ++ # This must happen before AddonManager reads the enabled flag to decide which addons to start + # Build case-insensitive lookup map for plugin names + plugin_name_map = {name.lower(): name for name in self.config.plugin.keys()} + @@ -33,6 +32,7 @@ index 4324fc700..5d915a85e 100644 + if len(parts) == 2 and parts[0] in plugin_name_map: + actual_plugin_name = plugin_name_map[parts[0]] + self.config.set_plugin(actual_plugin_name, parts[1], value) ++ + self.adm = self.addon_manager = AddonManager(self) def _setup_permissions(self): - self.log.debug("Setup permissions...")