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

netbox: add option to listen on Unix socket (#379919)

authored by

Rémi NICOLE and committed by
GitHub
585966ad c0fcb34f

+18 -1
+18 -1
nixos/modules/services/web-apps/netbox.nix
··· 85 85 default = "[::1]"; 86 86 description = '' 87 87 Address the server will listen on. 88 + Ignored if `unixSocket` is set. 88 89 ''; 90 + }; 91 + 92 + unixSocket = lib.mkOption { 93 + type = lib.types.nullOr lib.types.str; 94 + default = null; 95 + description = '' 96 + Enable Unix Socket for the server to listen on. 97 + `listenAddress` and `port` will be ignored. 98 + ''; 99 + example = "/run/netbox/netbox.sock"; 89 100 }; 90 101 91 102 package = lib.mkOption { ··· 125 114 default = 8001; 126 115 description = '' 127 116 Port the server will listen on. 117 + Ignored if `unixSocket` is set. 128 118 ''; 129 119 }; 130 120 ··· 357 345 serviceConfig = defaultServiceConfig // { 358 346 ExecStart = '' 359 347 ${pkg.gunicorn}/bin/gunicorn netbox.wsgi \ 360 - --bind ${cfg.listenAddress}:${toString cfg.port} \ 348 + --bind ${ 349 + if (cfg.unixSocket != null) then 350 + "unix:${cfg.unixSocket}" 351 + else 352 + "${cfg.listenAddress}:${toString cfg.port}" 353 + } \ 361 354 --pythonpath ${pkg}/opt/netbox/netbox 362 355 ''; 363 356 PrivateTmp = true;