nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
fork

Configure Feed

Select the types of activity you want to include in your feed.

zwave-js: module init, zwave-js-server: init at 1.33.0

Co-authored-by: Martin Weinelt <mweinelt@users.noreply.github.com>
Co-authored-by: h7x4 <h7x4@nani.wtf>

+224 -203
+2
nixos/doc/manual/release-notes/rl-2311.section.md
··· 104 104 105 105 - hardware/infiniband.nix adds infiniband subnet manager support using an [opensm](https://github.com/linux-rdma/opensm) systemd-template service, instantiated on card guids. The module also adds kernel modules and cli tooling to help administrators debug and measure performance. Available as [hardware.infiniband.enable](#opt-hardware.infiniband.enable). 106 106 107 + - [zwave-js](https://github.com/zwave-js/zwave-js-server), a small server wrapper around Z-Wave JS to access it via a WebSocket. Available as [services.zwave-js](#opt-services.zwave-js.enable). 108 + 107 109 - [Honk](https://humungus.tedunangst.com/r/honk), a complete ActivityPub server with minimal setup and support costs. 108 110 Available as [services.honk](#opt-services.honk.enable). 109 111
+1
nixos/modules/module-list.nix
··· 563 563 ./services/home-automation/home-assistant.nix 564 564 ./services/home-automation/homeassistant-satellite.nix 565 565 ./services/home-automation/zigbee2mqtt.nix 566 + ./services/home-automation/zwave-js.nix 566 567 ./services/logging/SystemdJournal2Gelf.nix 567 568 ./services/logging/awstats.nix 568 569 ./services/logging/filebeat.nix
+152
nixos/modules/services/home-automation/zwave-js.nix
··· 1 + {config, pkgs, lib, ...}: 2 + 3 + with lib; 4 + 5 + let 6 + cfg = config.services.zwave-js; 7 + mergedConfigFile = "/run/zwave-js/config.json"; 8 + settingsFormat = pkgs.formats.json {}; 9 + in { 10 + options.services.zwave-js = { 11 + enable = mkEnableOption (mdDoc "the zwave-js server on boot"); 12 + 13 + package = mkPackageOptionMD pkgs "zwave-js-server" { }; 14 + 15 + port = mkOption { 16 + type = types.port; 17 + default = 3000; 18 + description = mdDoc '' 19 + Port for the server to listen on. 20 + ''; 21 + }; 22 + 23 + serialPort = mkOption { 24 + type = types.path; 25 + description = mdDoc '' 26 + Serial port device path for Z-Wave controller. 27 + ''; 28 + example = "/dev/ttyUSB0"; 29 + }; 30 + 31 + secretsConfigFile = mkOption { 32 + type = types.path; 33 + description = mdDoc '' 34 + JSON file containing secret keys. A dummy example: 35 + 36 + ``` 37 + { 38 + "securityKeys": { 39 + "S0_Legacy": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", 40 + "S2_Unauthenticated": "BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB", 41 + "S2_Authenticated": "CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC", 42 + "S2_AccessControl": "DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD" 43 + } 44 + } 45 + ``` 46 + 47 + See 48 + <https://zwave-js.github.io/node-zwave-js/#/getting-started/security-s2> 49 + for details. This file will be merged with the module-generated config 50 + file (taking precedence). 51 + 52 + Z-Wave keys can be generated with: 53 + 54 + {command}`< /dev/urandom tr -dc A-F0-9 | head -c32 ;echo` 55 + 56 + 57 + ::: {.warning} 58 + A file in the nix store should not be used since it will be readable to 59 + all users. 60 + ::: 61 + ''; 62 + example = "/secrets/zwave-js-keys.json"; 63 + }; 64 + 65 + settings = mkOption { 66 + type = lib.types.submodule { 67 + freeformType = settingsFormat.type; 68 + 69 + options = { 70 + storage = { 71 + cacheDir = mkOption { 72 + type = types.path; 73 + default = "/var/cache/zwave-js"; 74 + readOnly = true; 75 + description = lib.mdDoc "Cache directory"; 76 + }; 77 + }; 78 + }; 79 + }; 80 + default = {}; 81 + description = mdDoc '' 82 + Configuration settings for the generated config 83 + file. 84 + ''; 85 + }; 86 + 87 + extraFlags = lib.mkOption { 88 + type = with lib.types; listOf str; 89 + default = [ ]; 90 + example = [ "--mock-driver" ]; 91 + description = lib.mdDoc '' 92 + Extra flags to pass to command 93 + ''; 94 + }; 95 + }; 96 + 97 + config = mkIf cfg.enable { 98 + systemd.services.zwave-js = let 99 + configFile = settingsFormat.generate "zwave-js-config.json" cfg.settings; 100 + in { 101 + wantedBy = [ "multi-user.target" ]; 102 + after = [ "network.target" ]; 103 + description = "Z-Wave JS Server"; 104 + serviceConfig = { 105 + ExecStartPre = '' 106 + /bin/sh -c "${pkgs.jq}/bin/jq -s '.[0] * .[1]' ${configFile} ${cfg.secretsConfigFile} > ${mergedConfigFile}" 107 + ''; 108 + ExecStart = lib.concatStringsSep " " [ 109 + "${cfg.package}/bin/zwave-server" 110 + "--config ${mergedConfigFile}" 111 + "--port ${toString cfg.port}" 112 + cfg.serialPort 113 + (escapeShellArgs cfg.extraFlags) 114 + ]; 115 + Restart = "on-failure"; 116 + User = "zwave-js"; 117 + SupplementaryGroups = [ "dialout" ]; 118 + CacheDirectory = "zwave-js"; 119 + RuntimeDirectory = "zwave-js"; 120 + 121 + # Hardening 122 + CapabilityBoundingSet = ""; 123 + DeviceAllow = [cfg.serialPort]; 124 + DevicePolicy = "closed"; 125 + DynamicUser = true; 126 + LockPersonality = true; 127 + MemoryDenyWriteExecute = false; 128 + NoNewPrivileges = true; 129 + PrivateUsers = true; 130 + PrivateTmp = true; 131 + ProtectClock = true; 132 + ProtectControlGroups = true; 133 + ProtectHome = true; 134 + ProtectHostname = true; 135 + ProtectKernelLogs = true; 136 + ProtectKernelModules = true; 137 + RemoveIPC = true; 138 + RestrictNamespaces = true; 139 + RestrictRealtime = true; 140 + RestrictSUIDSGID = true; 141 + SystemCallArchitectures = "native"; 142 + SystemCallFilter = [ 143 + "@system-service @pkey" 144 + "~@privileged @resources" 145 + ]; 146 + UMask = "0077"; 147 + }; 148 + }; 149 + }; 150 + 151 + meta.maintainers = with lib.maintainers; [ graham33 ]; 152 + }
+1
nixos/tests/all-tests.nix
··· 932 932 zram-generator = handleTest ./zram-generator.nix {}; 933 933 zrepl = handleTest ./zrepl.nix {}; 934 934 zsh-history = handleTest ./zsh-history.nix {}; 935 + zwave-js = handleTest ./zwave-js.nix {}; 935 936 }
+31
nixos/tests/zwave-js.nix
··· 1 + import ./make-test-python.nix ({ pkgs, lib, ...} : 2 + 3 + let 4 + secretsConfigFile = pkgs.writeText "secrets.json" (builtins.toJSON { 5 + securityKeys = { 6 + "S0_Legacy" = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"; 7 + }; 8 + }); 9 + in { 10 + name = "zwave-js"; 11 + meta.maintainers = with lib.maintainers; [ graham33 ]; 12 + 13 + nodes = { 14 + machine = { config, ... }: { 15 + services.zwave-js = { 16 + enable = true; 17 + serialPort = "/dev/null"; 18 + extraFlags = ["--mock-driver"]; 19 + inherit secretsConfigFile; 20 + }; 21 + }; 22 + }; 23 + 24 + testScript = '' 25 + start_all() 26 + 27 + machine.wait_for_unit("zwave-js.service") 28 + machine.wait_for_open_port(3000) 29 + machine.wait_until_succeeds("journalctl --since -1m --unit zwave-js --grep 'ZwaveJS server listening'") 30 + ''; 31 + })
+36
pkgs/by-name/zw/zwave-js-server/package.nix
··· 1 + { lib 2 + , buildNpmPackage 3 + , fetchFromGitHub 4 + , nixosTests 5 + }: 6 + 7 + buildNpmPackage rec { 8 + pname = "zwave-js-server"; 9 + version = "1.33.0"; 10 + 11 + src = fetchFromGitHub { 12 + owner = "zwave-js"; 13 + repo = pname; 14 + rev = version; 15 + hash = "sha256-Lll3yE1v4ybJTjKO8dhPXMD/3VCn+9+fpnN7XczqaE4="; 16 + }; 17 + 18 + npmDepsHash = "sha256-Re9fo+9+Z/+UGyDPlNWelH/4tLxcITPYXOCddQE9YDY="; 19 + 20 + # For some reason the zwave-js dependency is in devDependencies 21 + npmFlags = [ "--include=dev" ]; 22 + 23 + passthru = { 24 + tests = { 25 + inherit (nixosTests) zwave-js; 26 + }; 27 + }; 28 + 29 + meta = { 30 + changelog = "https://github.com/zwave-js/zwave-js-server/releases/tag/${version}"; 31 + description = "Small server wrapper around Z-Wave JS to access it via a WebSocket"; 32 + license = lib.licenses.asl20; 33 + homepage = "https://github.com/zwave-js/zwave-js-server"; 34 + maintainers = with lib.maintainers; [ graham33 ]; 35 + }; 36 + }
+1
pkgs/development/node-packages/aliases.nix
··· 49 49 "@mermaid-js/mermaid-cli" = pkgs.mermaid-cli; # added 2023-10-01 50 50 "@nerdwallet/shepherd" = pkgs.shepherd; # added 2023-09-30 51 51 "@nestjs/cli" = pkgs.nest-cli; # Added 2023-05-06 52 + "@zwave-js/server" = pkgs.zwave-js-server; # Added 2023-09-09 52 53 alloy = pkgs.titanium-alloy; # added 2023-08-17 53 54 antennas = pkgs.antennas; # added 2023-07-30 54 55 inherit (pkgs) asar; # added 2023-08-26
-1
pkgs/development/node-packages/main-programs.nix
··· 60 60 vscode-html-languageserver-bin = "html-languageserver"; 61 61 vscode-json-languageserver-bin = "json-languageserver"; 62 62 webtorrent-cli = "webtorrent"; 63 - "@zwave-js/server" = "zwave-server"; 64 63 }
-1
pkgs/development/node-packages/node-packages.json
··· 310 310 , "@yaegassy/coc-nginx" 311 311 , "yalc" 312 312 , "yarn" 313 - , "@zwave-js/server" 314 313 ]
-201
pkgs/development/node-packages/node-packages.nix
··· 102095 102095 bypassCache = true; 102096 102096 reconstructLock = true; 102097 102097 }; 102098 - "@zwave-js/server" = nodeEnv.buildNodePackage { 102099 - name = "_at_zwave-js_slash_server"; 102100 - packageName = "@zwave-js/server"; 102101 - version = "1.33.0"; 102102 - src = fetchurl { 102103 - url = "https://registry.npmjs.org/@zwave-js/server/-/server-1.33.0.tgz"; 102104 - sha512 = "jHRpbeWcDVhTWidDTmln9x+lTveJ0H1cLJxl6dWIeWQ6YnB7YzRuHFDPhY+6ewAyUrc+Eq8tl+QnhjmVuevq+A=="; 102105 - }; 102106 - dependencies = [ 102107 - (sources."@alcalzone/jsonl-db-3.1.0" // { 102108 - dependencies = [ 102109 - sources."fs-extra-10.1.0" 102110 - ]; 102111 - }) 102112 - (sources."@alcalzone/pak-0.9.0" // { 102113 - dependencies = [ 102114 - sources."execa-5.0.1" 102115 - sources."fs-extra-10.1.0" 102116 - ]; 102117 - }) 102118 - sources."@alcalzone/proper-lockfile-4.1.3-0" 102119 - sources."@colors/colors-1.6.0" 102120 - sources."@dabh/diagnostics-2.0.3" 102121 - sources."@homebridge/ciao-1.1.7" 102122 - sources."@leichtgewicht/ip-codec-2.0.4" 102123 - sources."@serialport/binding-mock-10.2.2" 102124 - (sources."@serialport/bindings-cpp-12.0.1" // { 102125 - dependencies = [ 102126 - sources."@serialport/parser-delimiter-11.0.0" 102127 - sources."@serialport/parser-readline-11.0.0" 102128 - sources."node-gyp-build-4.6.0" 102129 - ]; 102130 - }) 102131 - sources."@serialport/bindings-interface-1.2.2" 102132 - sources."@serialport/parser-byte-length-12.0.0" 102133 - sources."@serialport/parser-cctalk-12.0.0" 102134 - sources."@serialport/parser-delimiter-12.0.0" 102135 - sources."@serialport/parser-inter-byte-timeout-12.0.0" 102136 - sources."@serialport/parser-packet-length-12.0.0" 102137 - sources."@serialport/parser-readline-12.0.0" 102138 - sources."@serialport/parser-ready-12.0.0" 102139 - sources."@serialport/parser-regex-12.0.0" 102140 - sources."@serialport/parser-slip-encoder-12.0.0" 102141 - sources."@serialport/parser-spacepacket-12.0.0" 102142 - sources."@serialport/stream-12.0.0" 102143 - sources."@sindresorhus/is-5.6.0" 102144 - sources."@szmarczak/http-timer-5.0.1" 102145 - sources."@types/http-cache-semantics-4.0.3" 102146 - sources."@types/triple-beam-1.3.4" 102147 - sources."@zwave-js/cc-12.3.0" 102148 - sources."@zwave-js/config-12.3.0" 102149 - sources."@zwave-js/core-12.3.0" 102150 - sources."@zwave-js/host-12.3.0" 102151 - sources."@zwave-js/nvmedit-12.3.0" 102152 - sources."@zwave-js/serial-12.3.0" 102153 - sources."@zwave-js/shared-12.2.3" 102154 - sources."@zwave-js/testing-12.3.0" 102155 - sources."alcalzone-shared-4.0.8" 102156 - sources."ansi-colors-4.1.3" 102157 - sources."ansi-regex-5.0.1" 102158 - sources."ansi-styles-4.3.0" 102159 - sources."async-3.2.4" 102160 - sources."asynckit-0.4.0" 102161 - sources."axios-0.27.2" 102162 - sources."buffer-from-1.1.2" 102163 - sources."bufferutil-4.0.8" 102164 - sources."cacheable-lookup-7.0.0" 102165 - sources."cacheable-request-10.2.14" 102166 - sources."cliui-8.0.1" 102167 - (sources."color-3.2.1" // { 102168 - dependencies = [ 102169 - sources."color-convert-1.9.3" 102170 - sources."color-name-1.1.3" 102171 - ]; 102172 - }) 102173 - sources."color-convert-2.0.1" 102174 - sources."color-name-1.1.4" 102175 - sources."color-string-1.9.1" 102176 - sources."colorspace-1.1.4" 102177 - sources."combined-stream-1.0.8" 102178 - sources."cross-spawn-7.0.3" 102179 - sources."dayjs-1.11.10" 102180 - sources."debug-4.3.4" 102181 - (sources."decompress-response-6.0.0" // { 102182 - dependencies = [ 102183 - sources."mimic-response-3.1.0" 102184 - ]; 102185 - }) 102186 - sources."defer-to-connect-2.0.1" 102187 - sources."delayed-stream-1.0.0" 102188 - sources."dns-packet-5.6.1" 102189 - sources."emoji-regex-8.0.0" 102190 - sources."enabled-2.0.0" 102191 - sources."escalade-3.1.1" 102192 - sources."eventemitter3-5.0.1" 102193 - sources."execa-5.1.1" 102194 - sources."fast-deep-equal-3.1.3" 102195 - sources."fecha-4.2.3" 102196 - sources."file-stream-rotator-0.6.1" 102197 - sources."fn.name-1.1.0" 102198 - sources."follow-redirects-1.15.3" 102199 - sources."form-data-4.0.0" 102200 - sources."form-data-encoder-2.1.4" 102201 - sources."fs-extra-11.1.1" 102202 - sources."get-caller-file-2.0.5" 102203 - sources."get-stream-6.0.1" 102204 - sources."globalyzer-0.1.0" 102205 - sources."globrex-0.1.2" 102206 - sources."got-13.0.0" 102207 - sources."graceful-fs-4.2.11" 102208 - sources."http-cache-semantics-4.1.1" 102209 - sources."http2-wrapper-2.2.0" 102210 - sources."human-signals-2.1.0" 102211 - sources."inherits-2.0.4" 102212 - sources."is-arrayish-0.3.2" 102213 - sources."is-fullwidth-code-point-3.0.0" 102214 - sources."is-stream-2.0.1" 102215 - sources."isexe-2.0.0" 102216 - sources."json-buffer-3.0.1" 102217 - sources."json-logic-js-2.0.2" 102218 - sources."json5-2.2.3" 102219 - sources."jsonfile-6.1.0" 102220 - sources."keyv-4.5.4" 102221 - sources."kuler-2.0.0" 102222 - sources."logform-2.6.0" 102223 - sources."lowercase-keys-3.0.0" 102224 - sources."lru-cache-6.0.0" 102225 - sources."mdns-server-1.0.11" 102226 - sources."merge-stream-2.0.0" 102227 - sources."mime-db-1.52.0" 102228 - sources."mime-types-2.1.35" 102229 - sources."mimic-fn-2.1.0" 102230 - sources."mimic-response-4.0.0" 102231 - sources."minimist-1.2.8" 102232 - sources."moment-2.29.4" 102233 - sources."ms-2.1.2" 102234 - sources."node-addon-api-7.0.0" 102235 - sources."node-gyp-build-4.6.1" 102236 - sources."normalize-url-8.0.0" 102237 - sources."npm-run-path-4.0.1" 102238 - sources."nrf-intel-hex-1.3.0" 102239 - sources."object-hash-2.2.0" 102240 - sources."one-time-1.0.0" 102241 - sources."onetime-5.1.2" 102242 - sources."p-cancelable-3.0.0" 102243 - sources."p-queue-7.4.1" 102244 - sources."p-timeout-5.1.0" 102245 - sources."path-key-3.1.1" 102246 - sources."proper-lockfile-4.1.2" 102247 - sources."quick-lru-5.1.1" 102248 - sources."readable-stream-3.6.2" 102249 - sources."reflect-metadata-0.1.13" 102250 - sources."require-directory-2.1.1" 102251 - sources."resolve-alpn-1.2.1" 102252 - sources."responselike-3.0.0" 102253 - sources."retry-0.12.0" 102254 - sources."safe-buffer-5.2.1" 102255 - sources."safe-stable-stringify-2.4.3" 102256 - sources."semver-7.5.4" 102257 - sources."serialport-12.0.0" 102258 - sources."shebang-command-2.0.0" 102259 - sources."shebang-regex-3.0.0" 102260 - sources."signal-exit-3.0.7" 102261 - sources."simple-swizzle-0.2.2" 102262 - sources."source-map-0.6.1" 102263 - sources."source-map-support-0.5.21" 102264 - sources."stack-trace-0.0.10" 102265 - sources."string-width-4.2.3" 102266 - sources."string_decoder-1.3.0" 102267 - sources."strip-ansi-6.0.1" 102268 - sources."strip-final-newline-2.0.0" 102269 - sources."text-hex-1.0.0" 102270 - sources."tiny-glob-0.2.9" 102271 - sources."triple-beam-1.4.1" 102272 - sources."tslib-2.6.2" 102273 - sources."universalify-2.0.1" 102274 - sources."utf-8-validate-6.0.3" 102275 - sources."util-deprecate-1.0.2" 102276 - sources."which-2.0.2" 102277 - sources."winston-3.11.0" 102278 - sources."winston-daily-rotate-file-4.7.1" 102279 - sources."winston-transport-4.6.0" 102280 - sources."wrap-ansi-7.0.0" 102281 - sources."ws-8.14.2" 102282 - sources."xstate-4.38.2" 102283 - sources."y18n-5.0.8" 102284 - sources."yallist-4.0.0" 102285 - sources."yargs-17.7.2" 102286 - sources."yargs-parser-21.1.1" 102287 - sources."zwave-js-12.3.0" 102288 - ]; 102289 - buildInputs = globalBuildInputs; 102290 - meta = { 102291 - description = "Full access to zwave-js driver through Websockets"; 102292 - homepage = "https://github.com/zwave-js/zwave-js-server#readme"; 102293 - license = "Apache-2.0"; 102294 - }; 102295 - production = true; 102296 - bypassCache = true; 102297 - reconstructLock = true; 102298 - }; 102299 102098 }