git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #11920 from bjornfor/rename-host-to-listen-address

Rename NixOS option names: 'host' to 'listenAddress'

commitd807b057eddc45093566b0b515b03a4217c165fa authorPeter Simons <simons@cryp.to> dateTue 5 Jan 2016, 12:54 (11 years ago) parentf4b2c3dc7c3c95
12 files changed+42−29
nixos/modules/rename.nix+13 nixos/modules/services/audio/mpd.nix+2−2 nixos/modules/services/databases/neo4j.nix+2−2 nixos/modules/services/misc/docker-registry.nix+3−3 nixos/modules/services/misc/subsonic.nix+2−2 nixos/modules/services/monitoring/cadvisor.nix+3−3 nixos/modules/services/monitoring/graphite.nix+6−6 nixos/modules/services/monitoring/statsd.nix+2−2 nixos/modules/services/networking/shout.nix+2−2 nixos/modules/services/networking/sslh.nix+2−2 nixos/modules/services/search/elasticsearch.nix+3−3 nixos/modules/services/search/kibana.nix+2−2
nixos/modules/rename.nix+13
@@ -14,6 +14,19 @@ with lib;
1414 (mkRenamedOptionModule [ "networking" "enableWLAN" ] [ "networking" "wireless" "enable" ])
1515 (mkRenamedOptionModule [ "networking" "enableRT73Firmware" ] [ "networking" "enableRalinkFirmware" ])
1616
17+ (mkRenamedOptionModule [ "services" "cadvisor" "host" ] [ "services" "cadvisor" "listenAddress" ])
18+ (mkRenamedOptionModule [ "services" "dockerRegistry" "host" ] [ "services" "dockerRegistry" "listenAddress" ])
19+ (mkRenamedOptionModule [ "services" "elasticsearch" "host" ] [ "services" "elasticsearch" "listenAddress" ])
20+ (mkRenamedOptionModule [ "services" "graphite" "api" "host" ] [ "services" "graphite" "api" "listenAddress" ])
21+ (mkRenamedOptionModule [ "services" "graphite" "web" "host" ] [ "services" "graphite" "web" "listenAddress" ])
22+ (mkRenamedOptionModule [ "services" "kibana" "host" ] [ "services" "kibana" "listenAddress" ])
23+ (mkRenamedOptionModule [ "services" "mpd" "network" "host" ] [ "services" "mpd" "network" "listenAddress" ])
24+ (mkRenamedOptionModule [ "services" "neo4j" "host" ] [ "services" "neo4j" "listenAddress" ])
25+ (mkRenamedOptionModule [ "services" "shout" "host" ] [ "services" "shout" "listenAddress" ])
26+ (mkRenamedOptionModule [ "services" "sslh" "host" ] [ "services" "sslh" "listenAddress" ])
27+ (mkRenamedOptionModule [ "services" "statsd" "host" ] [ "services" "statsd" "listenAddress" ])
28+ (mkRenamedOptionModule [ "services" "subsonic" "host" ] [ "services" "subsonic" "listenAddress" ])
29+
1730 # Old Grub-related options.
1831 (mkRenamedOptionModule [ "boot" "initrd" "extraKernelModules" ] [ "boot" "initrd" "kernelModules" ])
1932 (mkRenamedOptionModule [ "boot" "extraKernelParams" ] [ "boot" "kernelParams" ])
nixos/modules/services/audio/mpd.nix+2−2
@@ -18,7 +18,7 @@ let
1818 user "${cfg.user}"
1919 group "${cfg.group}"
2020
21− ${optionalString (cfg.network.host != "any") ''bind_to_address "${cfg.network.host}"''}
21+ ${optionalString (cfg.network.listenAddress != "any") ''bind_to_address "${cfg.network.listenAddress}"''}
2222 ${optionalString (cfg.network.port != 6600) ''port "${toString cfg.network.port}"''}
2323
2424 ${cfg.extraConfig}
@@ -75,7 +75,7 @@ in {
7575
7676 network = {
7777
78− host = mkOption {
78+ listenAddress = mkOption {
7979 default = "any";
8080 description = ''
8181 This setting sets the address for the daemon to listen on. Careful attention
nixos/modules/services/databases/neo4j.nix+2−2
@@ -7,7 +7,7 @@ let
77
88 serverConfig = pkgs.writeText "neo4j-server.properties" ''
99 org.neo4j.server.database.location=${cfg.dataDir}/data/graph.db
10− org.neo4j.server.webserver.address=${cfg.host}
10+ org.neo4j.server.webserver.address=${cfg.listenAddress}
1111 org.neo4j.server.webserver.port=${toString cfg.port}
1212 ${optionalString cfg.enableHttps ''
1313 org.neo4j.server.webserver.https.enabled=true
@@ -52,7 +52,7 @@ in {
5252 type = types.package;
5353 };
5454
55− host = mkOption {
55+ listenAddress = mkOption {
5656 description = "Neo4j listen address.";
5757 default = "127.0.0.1";
5858 type = types.str;
nixos/modules/services/misc/docker-registry.nix+3−3
@@ -15,7 +15,7 @@ in {
1515 type = types.bool;
1616 };
1717
18− host = mkOption {
18+ listenAddress = mkOption {
1919 description = "Docker registry host or ip to bind to.";
2020 default = "127.0.0.1";
2121 type = types.str;
@@ -50,7 +50,7 @@ in {
5050 after = [ "network.target" ];
5151
5252 environment = {
53− REGISTRY_HOST = cfg.host;
53+ REGISTRY_HOST = cfg.listenAddress;
5454 REGISTRY_PORT = toString cfg.port;
5555 GUNICORN_OPTS = "[--preload]"; # see https://github.com/docker/docker-registry#sqlalchemy
5656 STORAGE_PATH = cfg.storagePath;
@@ -65,7 +65,7 @@ in {
6565 };
6666
6767 postStart = ''
68− until ${pkgs.curl}/bin/curl -s -o /dev/null 'http://${cfg.host}:${toString cfg.port}/'; do
68+ until ${pkgs.curl}/bin/curl -s -o /dev/null 'http://${cfg.listenAddress}:${toString cfg.port}/'; do
6969 sleep 1;
7070 done
7171 '';
nixos/modules/services/misc/subsonic.nix+2−2
@@ -21,7 +21,7 @@ in
2121 '';
2222 };
2323
24− host = mkOption {
24+ listenAddress = mkOption {
2525 type = types.string;
2626 default = "0.0.0.0";
2727 description = ''
@@ -115,7 +115,7 @@ in
115115 ExecStart = ''
116116 ${pkgs.jre}/bin/java -Xmx${toString cfg.maxMemory}m \
117117 -Dsubsonic.home=${cfg.home} \
118− -Dsubsonic.host=${cfg.host} \
118+ -Dsubsonic.host=${cfg.listenAddress} \
119119 -Dsubsonic.port=${toString cfg.port} \
120120 -Dsubsonic.httpsPort=${toString cfg.httpsPort} \
121121 -Dsubsonic.contextPath=${cfg.contextPath} \
nixos/modules/services/monitoring/cadvisor.nix+3−3
@@ -14,7 +14,7 @@ in {
1414 description = "Whether to enable cadvisor service.";
1515 };
1616
17− host = mkOption {
17+ listenAddress = mkOption {
1818 default = "127.0.0.1";
1919 type = types.str;
2020 description = "Cadvisor listening host";
@@ -71,7 +71,7 @@ in {
7171 after = [ "network.target" "docker.service" "influxdb.service" ];
7272
7373 postStart = mkBefore ''
74− until ${pkgs.curl}/bin/curl -s -o /dev/null 'http://${cfg.host}:${toString cfg.port}/containers/'; do
74+ until ${pkgs.curl}/bin/curl -s -o /dev/null 'http://${cfg.listenAddress}:${toString cfg.port}/containers/'; do
7575 sleep 1;
7676 done
7777 '';
@@ -79,7 +79,7 @@ in {
7979 serviceConfig = {
8080 ExecStart = ''${pkgs.cadvisor}/bin/cadvisor \
8181 -logtostderr=true \
82− -listen_ip=${cfg.host} \
82+ -listen_ip=${cfg.listenAddress} \
8383 -port=${toString cfg.port} \
8484 ${optionalString (cfg.storageDriver != null) ''
8585 -storage_driver ${cfg.storageDriver} \
nixos/modules/services/monitoring/graphite.nix+6−6
@@ -77,7 +77,7 @@ in {
7777 type = types.bool;
7878 };
7979
80− host = mkOption {
80+ listenAddress = mkOption {
8181 description = "Graphite web frontend listen address.";
8282 default = "127.0.0.1";
8383 type = types.str;
@@ -121,7 +121,7 @@ in {
121121 type = types.listOf types.str;
122122 };
123123
124− host = mkOption {
124+ listenAddress = mkOption {
125125 description = "Graphite web service listen address.";
126126 default = "127.0.0.1";
127127 type = types.str;
@@ -292,7 +292,7 @@ in {
292292 };
293293
294294 graphiteUrl = mkOption {
295− default = "http://${cfg.web.host}:${toString cfg.web.port}";
295+ default = "http://${cfg.web.listenAddress}:${toString cfg.web.port}";
296296 description = "Host where graphite service runs.";
297297 type = types.str;
298298 };
@@ -337,7 +337,7 @@ in {
337337
338338 graphiteUrl = mkOption {
339339 description = "URL to your graphite service.";
340− default = "http://${cfg.web.host}:${toString cfg.web.port}";
340+ default = "http://${cfg.web.listenAddress}:${toString cfg.web.port}";
341341 type = types.str;
342342 };
343343
@@ -452,7 +452,7 @@ in {
452452 serviceConfig = {
453453 ExecStart = ''
454454 ${pkgs.python27Packages.waitress}/bin/waitress-serve \
455− --host=${cfg.web.host} --port=${toString cfg.web.port} \
455+ --host=${cfg.web.listenAddress} --port=${toString cfg.web.port} \
456456 --call django.core.handlers.wsgi:WSGIHandler'';
457457 User = "graphite";
458458 Group = "graphite";
@@ -494,7 +494,7 @@ in {
494494 serviceConfig = {
495495 ExecStart = ''
496496 ${pkgs.python27Packages.waitress}/bin/waitress-serve \
497− --host=${cfg.api.host} --port=${toString cfg.api.port} \
497+ --host=${cfg.api.listenAddress} --port=${toString cfg.api.port} \
498498 graphite_api.app:app
499499 '';
500500 User = "graphite";
nixos/modules/services/monitoring/statsd.nix+2−2
@@ -11,7 +11,7 @@ let
1111
1212 configFile = pkgs.writeText "statsd.conf" ''
1313 {
14− address: "${cfg.host}",
14+ address: "${cfg.listenAddress}",
1515 port: "${toString cfg.port}",
1616 mgmt_address: "${cfg.mgmt_address}",
1717 mgmt_port: "${toString cfg.mgmt_port}",
@@ -48,7 +48,7 @@ in
4848 type = types.bool;
4949 };
5050
51− host = mkOption {
51+ listenAddress = mkOption {
5252 description = "Address that statsd listens on over UDP";
5353 default = "127.0.0.1";
5454 type = types.str;
nixos/modules/services/networking/shout.nix+2−2
@@ -19,7 +19,7 @@ in {
1919 '';
2020 };
2121
22− host = mkOption {
22+ listenAddress = mkOption {
2323 type = types.string;
2424 default = "0.0.0.0";
2525 description = "IP interface to listen on for http connections.";
@@ -66,7 +66,7 @@ in {
6666 "${pkgs.shout}/bin/shout"
6767 (if cfg.private then "--private" else "--public")
6868 "--port" (toString cfg.port)
69− "--host" (toString cfg.host)
69+ "--host" (toString cfg.listenAddress)
7070 "--home" shoutHome
7171 ];
7272 serviceConfig = {
nixos/modules/services/networking/sslh.nix+2−2
@@ -16,7 +16,7 @@ let
1616
1717 listen:
1818 (
19− { host: "${cfg.host}"; port: "${toString cfg.port}"; }
19+ { host: "${cfg.listenAddress}"; port: "${toString cfg.port}"; }
2020 );
2121
2222 ${cfg.appendConfig}
@@ -56,7 +56,7 @@ in
5656 description = "PID file path for sslh daemon.";
5757 };
5858
59− host = mkOption {
59+ listenAddress = mkOption {
6060 type = types.str;
6161 default = config.networking.hostName;
6262 description = "Listening hostname.";
nixos/modules/services/search/elasticsearch.nix+3−3
@@ -6,7 +6,7 @@ let
66 cfg = config.services.elasticsearch;
77
88 esConfig = ''
9− network.host: ${cfg.host}
9+ network.host: ${cfg.listenAddress}
1010 network.port: ${toString cfg.port}
1111 network.tcp.port: ${toString cfg.tcp_port}
1212 cluster.name: ${cfg.cluster_name}
@@ -43,7 +43,7 @@ in {
4343 type = types.package;
4444 };
4545
46− host = mkOption {
46+ listenAddress = mkOption {
4747 description = "Elasticsearch listen address.";
4848 default = "127.0.0.1";
4949 type = types.str;
@@ -142,7 +142,7 @@ in {
142142 ln -s ${esPlugins}/plugins ${cfg.dataDir}/plugins
143143 '';
144144 postStart = mkBefore ''
145− until ${pkgs.curl}/bin/curl -s -o /dev/null ${cfg.host}:${toString cfg.port}; do
145+ until ${pkgs.curl}/bin/curl -s -o /dev/null ${cfg.listenAddress}:${toString cfg.port}; do
146146 sleep 1
147147 done
148148 '';
nixos/modules/services/search/kibana.nix+2−2
@@ -8,7 +8,7 @@ let
88 cfgFile = pkgs.writeText "kibana.json" (builtins.toJSON (
99 (filterAttrsRecursive (n: v: v != null) ({
1010 server = {
11− host = cfg.host;
11+ host = cfg.listenAddress;
1212 port = cfg.port;
1313 ssl = {
1414 cert = cfg.cert;
@@ -44,7 +44,7 @@ in {
4444 options.services.kibana = {
4545 enable = mkEnableOption "enable kibana service";
4646
47− host = mkOption {
47+ listenAddress = mkOption {
4848 description = "Kibana listening host";
4949 default = "127.0.0.1";
5050 type = types.str;