Skip to content

Commit 30cb6dc

Browse files
committed
autosave (vm / Linux)
1 parent 87c8a1f commit 30cb6dc

File tree

4 files changed

+28
-4
lines changed

4 files changed

+28
-4
lines changed

modules/nixos/overlay.nix

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,16 +169,36 @@
169169
zigbee-mqtt-import = pkgs.callPackage "${cfg-meta.paths.pkg}/zigbee-mqtt-import/default.nix" { };
170170
linux-3-finger-drag = pkgs.callPackage "${cfg-meta.paths.pkg}/linux-3-finger-drag/default.nix" { };
171171

172+
# Workaround for NAS-WR01ZE bit-31 firmware bug (zwave-js/zwave-js#2692).
173+
# The device randomly sets bit 31 in 4-byte meter report mantissa,
174+
# causing values near -21,474,836 instead of small positive numbers.
175+
# We mask off the MSB when the parsed meter value is implausibly negative.
176+
# Pin zwave-js-ui to 11.16.0 (ahead of our nixpkgs pin) for:
177+
# - zwave-js 15.22.1: targetValue optimistic update fix
178+
# - zwave-js 15.22.5: pollValue delay fix
172179
# Workaround for NAS-WR01ZE bit-31 firmware bug (zwave-js/zwave-js#2692).
173180
# The device randomly sets bit 31 in 4-byte meter report mantissa,
174181
# causing values near -21,474,836 instead of small positive numbers.
175182
# We mask off the MSB when the parsed meter value is implausibly negative.
176183
zwave-js-ui =
177184
let
185+
pinnedVersion = "11.16.0";
186+
pinnedSrc = super.fetchFromGitHub {
187+
owner = "zwave-js";
188+
repo = "zwave-js-ui";
189+
tag = "v${pinnedVersion}";
190+
hash = "sha256-6pPC500ZQmtCC3ATiWD79DTh5cagdqLoDwTHivHgfWg=";
191+
};
178192
bit31Fix = "if (value < -1e6) { const _p = data.subarray(offset + 1); const _prec = (_p[0] & 224) >>> 5; const _sz = _p[0] & 7; if (_sz === 4) value = (((_p[1] & 0x7F) << 24) | (_p[2] << 16) | (_p[3] << 8) | _p[4]) / Math.pow(10, _prec); }";
179193
meterCCPath = "lib/node_modules/zwave-js-ui/node_modules/@zwave-js/cc/build";
180194
in
181195
super.zwave-js-ui.overrideAttrs (old: {
196+
version = pinnedVersion;
197+
src = pinnedSrc;
198+
npmDeps = super.fetchNpmDeps {
199+
src = pinnedSrc;
200+
hash = "sha256-Qeh5sk2aLWrsmMShE26jz7nzWg6YWcPeUNhTg3u411I=";
201+
};
182202
postInstall = (old.postInstall or "") + ''
183203
substituteInPlace "$out/${meterCCPath}/cjs/cc/MeterCC.js" \
184204
--replace-fail \

modules/nixos/smfc.nix

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,13 @@ let
7373
CPU = cfg.zones.cpu;
7474
HD = cfg.zones.hd // {
7575
smartctl_path = "${pkgs.smartmontools}/bin/smartctl";
76+
# smfc parses hd_names with str.split() (whitespace), not commas
77+
hd_names = lib.concatStringsSep " " cfg.zones.hd.hd_names;
7678
};
7779
} // lib.optionalAttrs (cfg.zones.nvme != null) {
78-
NVME = cfg.zones.nvme;
80+
NVME = cfg.zones.nvme // {
81+
nvme_names = lib.concatStringsSep " " cfg.zones.nvme.nvme_names;
82+
};
7983
} // lib.optionalAttrs (cfg.zones.gpu != null) {
8084
GPU = cfg.zones.gpu;
8185
} // lib.optionalAttrs (cfg.zones.const != null) {

modules/nixos/zwave.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ let
1111
prefix = "zwave";
1212
name = "zwave";
1313
qos = 1;
14-
retain = false;
14+
retain = true;
1515
clean = true;
1616
reconnectPeriod = 3000;
1717
store = false;
@@ -25,7 +25,7 @@ let
2525
nodeNames = true;
2626
hassDiscovery = true;
2727
discoveryPrefix = "homeassistant";
28-
retainedDiscovery = false;
28+
retainedDiscovery = true;
2929
includeNodeInfo = true;
3030
sendEvents = true;
3131
publishNodeDetails = true;

private

0 commit comments

Comments
 (0)