From 0ddc8a303bec3df0e0a6c8f4e47d49134dedd72a Mon Sep 17 00:00:00 2001 From: Linus Heckemann Date: Wed, 25 Oct 2017 10:08:37 +0100 Subject: nixos manual: suggest nixos-help as well Part of improving #30760: users on a serial console can't switch ttys, so providing another method to access the manual is useful. --- nixos/doc/manual/installation/installing.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'nixos') diff --git a/nixos/doc/manual/installation/installing.xml b/nixos/doc/manual/installation/installing.xml index 8c37643c08f5..94d8e9d2e1a3 100644 --- a/nixos/doc/manual/installation/installing.xml +++ b/nixos/doc/manual/installation/installing.xml @@ -16,7 +16,8 @@ hardware. The NixOS manual is available on virtual console 8 - (press Alt+F8 to access). + (press Alt+F8 to access) or by running nixos-help. + You get logged in as root (with empty password). -- cgit 1.4.1 From b2c5075e8ad442a8a2b42979ea9351e35dc647fe Mon Sep 17 00:00:00 2001 From: Linus Heckemann Date: Wed, 25 Oct 2017 10:13:33 +0100 Subject: nixos-manual service: show nixos-help option Part of improving accessibility (#30760). Makes the manual easier to access e.g. on serial consoles. --- nixos/modules/services/misc/nixos-manual.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'nixos') diff --git a/nixos/modules/services/misc/nixos-manual.nix b/nixos/modules/services/misc/nixos-manual.nix index 515864ec2e2d..41cadb4a6de0 100644 --- a/nixos/modules/services/misc/nixos-manual.nix +++ b/nixos/modules/services/misc/nixos-manual.nix @@ -135,8 +135,9 @@ in }; }; - services.mingetty.helpLine = mkIf cfg.showManual - "\nPress for the NixOS manual."; + services.mingetty.helpLine = "\nRun `nixos-help` " + + lib.optionalString cfg.showManual "or press " + + "for the NixOS manual."; }; -- cgit 1.4.1 From 4a180dac60e066f52268b69820bafa89dc4ba0d3 Mon Sep 17 00:00:00 2001 From: Jonas Schwabe Date: Sat, 28 Oct 2017 15:35:57 +0200 Subject: gdm: fix restart of display-manager after nixos-rebuild - fix restart of display-manager due to a conflict with getty@tty1 - fixes #21439 --- nixos/modules/services/x11/display-managers/gdm.nix | 1 - 1 file changed, 1 deletion(-) (limited to 'nixos') diff --git a/nixos/modules/services/x11/display-managers/gdm.nix b/nixos/modules/services/x11/display-managers/gdm.nix index 83c5c95dae7e..45a67ac040b8 100644 --- a/nixos/modules/services/x11/display-managers/gdm.nix +++ b/nixos/modules/services/x11/display-managers/gdm.nix @@ -125,7 +125,6 @@ in "getty@tty1.service" ]; - systemd.services.display-manager.conflicts = [ "getty@tty1.service" ]; systemd.services.display-manager.serviceConfig = { # Restart = "always"; - already defined in xserver.nix KillMode = "mixed"; -- cgit 1.4.1 From 8a77a30bc18761de935bcb58fe1074a048741725 Mon Sep 17 00:00:00 2001 From: Samuel Leathers Date: Sun, 29 Oct 2017 00:20:52 +0200 Subject: install documentation: document boot.loader.grub.useOSProber --- nixos/doc/manual/installation/installing.xml | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'nixos') diff --git a/nixos/doc/manual/installation/installing.xml b/nixos/doc/manual/installation/installing.xml index 94d8e9d2e1a3..b0674307a563 100644 --- a/nixos/doc/manual/installation/installing.xml +++ b/nixos/doc/manual/installation/installing.xml @@ -140,6 +140,11 @@ the GRUB boot loader is to be installed. Without it, NixOS cannot boot. + If there are other operating systems running on the machine before + installing NixOS, the + option can be set to + true to automatically add them to the grub menu. + Another critical option is , specifying the file systems that need to be mounted by NixOS. However, you typically don’t need to set it yourself, because -- cgit 1.4.1 From 95dc36235ce21ab8563f1ba61a5d80e6c2ea9e3b Mon Sep 17 00:00:00 2001 From: Christopher Singley Date: Sun, 29 Oct 2017 19:29:25 -0500 Subject: PlexPy service --- nixos/modules/module-list.nix | 1 + nixos/modules/services/misc/plexpy.nix | 81 ++++++++++++++++++++++++++++++++++ 2 files changed, 82 insertions(+) create mode 100644 nixos/modules/services/misc/plexpy.nix (limited to 'nixos') diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index 6f00a97dd3ff..44bcec5aec26 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -328,6 +328,7 @@ ./services/misc/parsoid.nix ./services/misc/phd.nix ./services/misc/plex.nix + ./services/misc/plexpy.nix ./services/misc/pykms.nix ./services/misc/radarr.nix ./services/misc/redmine.nix diff --git a/nixos/modules/services/misc/plexpy.nix b/nixos/modules/services/misc/plexpy.nix new file mode 100644 index 000000000000..df9f12581247 --- /dev/null +++ b/nixos/modules/services/misc/plexpy.nix @@ -0,0 +1,81 @@ +{ config, pkgs, lib, ... }: + +with lib; + +let + cfg = config.services.plexpy; +in +{ + options = { + services.plexpy = { + enable = mkEnableOption "PlexPy Plex Monitor"; + + dataDir = mkOption { + type = types.str; + default = "/var/lib/plexpy"; + description = "The directory where PlexPy stores its data files."; + }; + + configFile = mkOption { + type = types.str; + default = "/var/lib/plexpy/config.ini"; + description = "The location of PlexPy's config file."; + }; + + port = mkOption { + type = types.int; + default = 8181; + description = "TCP port where PlexPy listens."; + }; + + user = mkOption { + type = types.str; + default = "plexpy"; + description = "User account under which PlexPy runs."; + }; + + group = mkOption { + type = types.str; + default = "nogroup"; + description = "Group under which PlexPy runs."; + }; + + package = mkOption { + type = types.package; + default = pkgs.plexpy; + defaultText = "pkgs.plexpy"; + description = '' + The PlexPy package to use. + ''; + }; + }; + }; + + config = mkIf cfg.enable { + systemd.services.plexpy = { + description = "PlexPy Plex Monitor"; + after = [ "network.target" ]; + wantedBy = [ "multi-user.target" ]; + preStart = '' + test -d "${cfg.dataDir}" || { + echo "Creating initial PlexPy data directory in \"${cfg.dataDir}\"." + mkdir -p "${cfg.dataDir}" + chown ${cfg.user}:${cfg.group} "${cfg.dataDir}" + } + ''; + serviceConfig = { + Type = "simple"; + User = cfg.user; + Group = cfg.group; + PermissionsStartOnly = "true"; + GuessMainPID = "false"; + ExecStart = "${cfg.package}/bin/plexpy --datadir ${cfg.dataDir} --config ${cfg.configFile} --port ${toString cfg.port} --pidfile ${cfg.dataDir}/plexpy.pid --nolaunch"; + Restart = "on-failure"; + }; + }; + + users.extraUsers = mkIf (cfg.user == "plexpy") { + plexpy = { group = cfg.group; uid = config.ids.uids.plexpy; }; + }; + }; +} -- cgit 1.4.1 From 29e80bde404b5ed126fdc2f32e794556506a9cc9 Mon Sep 17 00:00:00 2001 From: Márton Boros Date: Mon, 23 Oct 2017 23:27:24 +0200 Subject: nixos/gitlab: fix hard-coded database name --- nixos/modules/services/misc/gitlab.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'nixos') diff --git a/nixos/modules/services/misc/gitlab.nix b/nixos/modules/services/misc/gitlab.nix index 740cbc141b53..0dde9ff3c5a5 100644 --- a/nixos/modules/services/misc/gitlab.nix +++ b/nixos/modules/services/misc/gitlab.nix @@ -619,7 +619,7 @@ in { fi # enable required pg_trgm extension for gitlab - ${pkgs.sudo}/bin/sudo -u ${pgSuperUser} psql gitlab -c "CREATE EXTENSION IF NOT EXISTS pg_trgm" + ${pkgs.sudo}/bin/sudo -u ${pgSuperUser} psql ${cfg.databaseName} -c "CREATE EXTENSION IF NOT EXISTS pg_trgm" # Always do the db migrations just to be sure the database is up-to-date ${gitlab-rake}/bin/gitlab-rake db:migrate RAILS_ENV=production -- cgit 1.4.1 From 00c03e90038a4935da17fa0d5f5ca9d08fc19676 Mon Sep 17 00:00:00 2001 From: Márton Boros Date: Mon, 23 Oct 2017 23:48:26 +0200 Subject: nixos/gitlab: fix preStart script --- nixos/modules/services/misc/gitlab.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'nixos') diff --git a/nixos/modules/services/misc/gitlab.nix b/nixos/modules/services/misc/gitlab.nix index 0dde9ff3c5a5..e0fae335d03b 100644 --- a/nixos/modules/services/misc/gitlab.nix +++ b/nixos/modules/services/misc/gitlab.nix @@ -634,7 +634,7 @@ in { # The gitlab:shell:create_hooks task seems broken for fixing links # so we instead delete all the hooks and create them anew - rm ${cfg.statePath}/repositories/**/*.git/hooks + rm -f ${cfg.statePath}/repositories/**/*.git/hooks ${gitlab-rake}/bin/gitlab-rake gitlab:shell:create_hooks RAILS_ENV=production # Change permissions in the last step because some of the -- cgit 1.4.1 From c556c72a2efda33c6ef00ff376bd5596f6eca817 Mon Sep 17 00:00:00 2001 From: Márton Boros Date: Tue, 24 Oct 2017 00:07:51 +0200 Subject: nixos/gitlab: fix secret generation This line previously produced an error and an empty secret file. --- nixos/modules/services/misc/gitlab.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'nixos') diff --git a/nixos/modules/services/misc/gitlab.nix b/nixos/modules/services/misc/gitlab.nix index e0fae335d03b..7b2b40e59232 100644 --- a/nixos/modules/services/misc/gitlab.nix +++ b/nixos/modules/services/misc/gitlab.nix @@ -572,7 +572,7 @@ in { rm -rf ${cfg.statePath}/config ${cfg.statePath}/shell/hooks mkdir -p ${cfg.statePath}/config - tr -dc A-Za-z0-9 < /dev/urandom | head -c 32 > ${cfg.statePath}/config/gitlab_shell_secret + ${pkgs.openssl}/bin/openssl rand -hex 32 > ${cfg.statePath}/config/gitlab_shell_secret # The uploads directory is hardcoded somewhere deep in rails. It is # symlinked in the gitlab package to /run/gitlab/uploads to make it -- cgit 1.4.1 From 0581038e8e757f05dc1f75df52e7d0c79acea3fc Mon Sep 17 00:00:00 2001 From: Chris Martin Date: Mon, 30 Oct 2017 13:49:05 -0400 Subject: nixos/acme: remove doc note about restarting nginx Discussion from #30945 indicates that it is no longer true that you have to restart nginx. --- nixos/modules/security/acme.xml | 3 --- 1 file changed, 3 deletions(-) (limited to 'nixos') diff --git a/nixos/modules/security/acme.xml b/nixos/modules/security/acme.xml index 823806f4641b..6130ed82ed38 100644 --- a/nixos/modules/security/acme.xml +++ b/nixos/modules/security/acme.xml @@ -89,8 +89,5 @@ services.nginx = { }; } - -At the moment you still have to restart Nginx after the ACME -certs arrive. -- cgit 1.4.1 From 07e0c0e0a2f237639600f2a0d62f6eac748b1e6e Mon Sep 17 00:00:00 2001 From: Bas van Dijk Date: Mon, 30 Oct 2017 17:35:14 +0100 Subject: network-interfaces-scripted: fix NixOS/nixops#640 Reverse the PartOf dependency between network-setup and network-addresses-* This was joint work of: @nh2, @domenkozar, @fpletz, @aszlig and @basvandijk at the NixCon 2017 hackathon. --- nixos/modules/tasks/network-interfaces-scripted.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'nixos') diff --git a/nixos/modules/tasks/network-interfaces-scripted.nix b/nixos/modules/tasks/network-interfaces-scripted.nix index e92c9bc27def..1f424f84c6e0 100644 --- a/nixos/modules/tasks/network-interfaces-scripted.nix +++ b/nixos/modules/tasks/network-interfaces-scripted.nix @@ -93,6 +93,7 @@ let after = [ "network-pre.target" "systemd-udevd.service" "systemd-sysctl.service" ]; before = [ "network.target" "shutdown.target" ]; wants = [ "network.target" ]; + partOf = map (i: "network-addresses-${i.name}.service") interfaces; conflicts = [ "shutdown.target" ]; wantedBy = [ "multi-user.target" ] ++ optional hasDefaultGatewaySet "network-online.target"; @@ -171,8 +172,6 @@ let "network-link-${i.name}.service" "network.target" ]; - # propagate stop and reload from network-setup - partOf = [ "network-setup.service" ]; # order before network-setup because the routes that are configured # there may need ip addresses configured before = [ "network-setup.service" ]; -- cgit 1.4.1 From 440178d729efbc279a70c93495b6212db029f180 Mon Sep 17 00:00:00 2001 From: lassulus Date: Mon, 30 Oct 2017 21:43:10 +0100 Subject: gdm: don't start getty@tty1 if enabled --- nixos/modules/services/x11/display-managers/gdm.nix | 2 ++ 1 file changed, 2 insertions(+) (limited to 'nixos') diff --git a/nixos/modules/services/x11/display-managers/gdm.nix b/nixos/modules/services/x11/display-managers/gdm.nix index 45a67ac040b8..e83f26516f5f 100644 --- a/nixos/modules/services/x11/display-managers/gdm.nix +++ b/nixos/modules/services/x11/display-managers/gdm.nix @@ -125,6 +125,8 @@ in "getty@tty1.service" ]; + systemd.services."getty@tty1".enable = false; + systemd.services.display-manager.conflicts = [ "getty@tty1.service" ]; systemd.services.display-manager.serviceConfig = { # Restart = "always"; - already defined in xserver.nix KillMode = "mixed"; -- cgit 1.4.1 From f2621d4ba86d7f78911c7a2e28d8883b57d1c65a Mon Sep 17 00:00:00 2001 From: Yegor Timoshenko Date: Mon, 30 Oct 2017 21:58:37 +0000 Subject: nixos-generate-config: enforce umask 0022, fixes #30954 --- nixos/modules/installer/tools/nixos-generate-config.pl | 1 + 1 file changed, 1 insertion(+) (limited to 'nixos') diff --git a/nixos/modules/installer/tools/nixos-generate-config.pl b/nixos/modules/installer/tools/nixos-generate-config.pl index c0df2977856e..7c737e84de0a 100644 --- a/nixos/modules/installer/tools/nixos-generate-config.pl +++ b/nixos/modules/installer/tools/nixos-generate-config.pl @@ -8,6 +8,7 @@ use File::Basename; use File::Slurp; use File::stat; +umask(0022); sub uniq { my %seen; -- cgit 1.4.1 From 04b2460eb65c64705df0de0ce33dde6ba524a216 Mon Sep 17 00:00:00 2001 From: Bas van Dijk Date: Tue, 31 Oct 2017 15:49:59 +0100 Subject: graphite: fix the graphiteApi service --- nixos/modules/services/monitoring/graphite.nix | 4 ++-- nixos/tests/graphite.nix | 16 +++++++++++----- 2 files changed, 13 insertions(+), 7 deletions(-) (limited to 'nixos') diff --git a/nixos/modules/services/monitoring/graphite.nix b/nixos/modules/services/monitoring/graphite.nix index 01b4aca91731..645dfeab0193 100644 --- a/nixos/modules/services/monitoring/graphite.nix +++ b/nixos/modules/services/monitoring/graphite.nix @@ -22,8 +22,8 @@ let ); graphiteApiConfig = pkgs.writeText "graphite-api.yaml" '' - time_zone: ${config.time.timeZone} search_index: ${dataDir}/index + ${optionalString (!isNull config.time.timeZone) ''time_zone: ${config.time.timeZone}''} ${optionalString (cfg.api.finders != []) ''finders:''} ${concatMapStringsSep "\n" (f: " - " + f.moduleName) cfg.api.finders} ${optionalString (cfg.api.functions != []) ''functions:''} @@ -536,7 +536,7 @@ in { environment = { PYTHONPATH = let aenv = pkgs.python.buildEnv.override { - extraLibs = [ cfg.api.package pkgs.cairo ] ++ cfg.api.finders; + extraLibs = [ cfg.api.package pkgs.cairo pkgs.pythonPackages.cffi ] ++ cfg.api.finders; }; in "${aenv}/${pkgs.python.sitePackages}"; GRAPHITE_API_CONFIG = graphiteApiConfig; diff --git a/nixos/tests/graphite.nix b/nixos/tests/graphite.nix index 4fd7de192d55..a22ef224580a 100644 --- a/nixos/tests/graphite.nix +++ b/nixos/tests/graphite.nix @@ -4,22 +4,28 @@ import ./make-test.nix ({ pkgs, ...} : nodes = { one = { config, pkgs, ... }: { + time.timeZone = "UTC"; services.graphite = { - web = { + web.enable = true; + api = { enable = true; + port = 8082; }; - carbon = { - enableCache = true; - }; + carbon.enableCache = true; + seyren.enable = true; + pager.enable = true; }; }; - }; + }; testScript = '' startAll; $one->waitForUnit("default.target"); $one->requireActiveUnit("graphiteWeb.service"); + $one->requireActiveUnit("graphiteApi.service"); + $one->requireActiveUnit("graphitePager.service"); $one->requireActiveUnit("carbonCache.service"); + $one->requireActiveUnit("seyren.service"); $one->succeed("echo \"foo 1 `date +%s`\" | nc -q0 localhost 2003"); $one->waitUntilSucceeds("curl 'http://localhost:8080/metrics/find/?query=foo&format=treejson' --silent | grep foo") ''; -- cgit 1.4.1 From 527781ebc4137d9e6cda6dd21ab0dd776f8582d5 Mon Sep 17 00:00:00 2001 From: Bas van Dijk Date: Tue, 31 Oct 2017 17:31:02 +0100 Subject: apache-httpd: fix nix evaluation error This only sets the timezone when it's not null to prevent: error: cannot coerce null to a string, at nixpkgs/nixos/modules/services/web-servers/apache-httpd/default.nix:676:7 --- nixos/modules/services/web-servers/apache-httpd/default.nix | 1 + 1 file changed, 1 insertion(+) (limited to 'nixos') diff --git a/nixos/modules/services/web-servers/apache-httpd/default.nix b/nixos/modules/services/web-servers/apache-httpd/default.nix index 1c3c7835d961..f9f2511f45dc 100644 --- a/nixos/modules/services/web-servers/apache-httpd/default.nix +++ b/nixos/modules/services/web-servers/apache-httpd/default.nix @@ -676,6 +676,7 @@ in '' ; Needed for PHP's mail() function. sendmail_path = sendmail -t -i + '' + optionalString (!isNull config.time.timeZone) '' ; Apparently PHP doesn't use $TZ. date.timezone = "${config.time.timeZone}" -- cgit 1.4.1 From 3165c56db9df4d2399e900a8d6eaffcd092359f7 Mon Sep 17 00:00:00 2001 From: Piotr Bogdan Date: Tue, 31 Oct 2017 17:37:11 +0000 Subject: apache-httpd/wordpress: disable built-in WordPress autoupdater --- nixos/modules/services/web-servers/apache-httpd/wordpress.nix | 1 + 1 file changed, 1 insertion(+) (limited to 'nixos') diff --git a/nixos/modules/services/web-servers/apache-httpd/wordpress.nix b/nixos/modules/services/web-servers/apache-httpd/wordpress.nix index c6f4bcd0f666..1c654667dfc7 100644 --- a/nixos/modules/services/web-servers/apache-httpd/wordpress.nix +++ b/nixos/modules/services/web-servers/apache-httpd/wordpress.nix @@ -13,6 +13,7 @@ let define('DB_HOST', '${config.dbHost}'); define('DB_CHARSET', 'utf8'); $table_prefix = '${config.tablePrefix}'; + define('AUTOMATIC_UPDATER_DISABLED', true); ${config.extraConfig} if ( !defined('ABSPATH') ) define('ABSPATH', dirname(__FILE__) . '/'); -- cgit 1.4.1 From e0318379ae3b5cb5fa75629b1b5392dbd270cfe8 Mon Sep 17 00:00:00 2001 From: mingchuan Date: Wed, 1 Nov 2017 02:53:24 +0800 Subject: nixos/ssh: fix example --- nixos/modules/programs/ssh.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'nixos') diff --git a/nixos/modules/programs/ssh.nix b/nixos/modules/programs/ssh.nix index e0fbba897fa4..0935bf0cae71 100644 --- a/nixos/modules/programs/ssh.nix +++ b/nixos/modules/programs/ssh.nix @@ -148,11 +148,11 @@ in [ { hostNames = [ "myhost" "myhost.mydomain.com" "10.10.1.4" ]; - publicKeyFile = "./pubkeys/myhost_ssh_host_dsa_key.pub"; + publicKeyFile = ./pubkeys/myhost_ssh_host_dsa_key.pub; } { hostNames = [ "myhost2" ]; - publicKeyFile = "./pubkeys/myhost2_ssh_host_dsa_key.pub"; + publicKeyFile = ./pubkeys/myhost2_ssh_host_dsa_key.pub; } ] ''; -- cgit 1.4.1 From ea8714ecb16fc5e000c8e4638a937063c430780c Mon Sep 17 00:00:00 2001 From: rnhmjoj Date: Tue, 31 Oct 2017 22:03:38 +0100 Subject: nixos/dnschain: use nodePackages.dnschain --- nixos/modules/services/networking/dnschain.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'nixos') diff --git a/nixos/modules/services/networking/dnschain.nix b/nixos/modules/services/networking/dnschain.nix index ab7bbb15ad4f..ee1cd3600039 100644 --- a/nixos/modules/services/networking/dnschain.nix +++ b/nixos/modules/services/networking/dnschain.nix @@ -158,7 +158,7 @@ in serviceConfig = { User = "dnschain"; Restart = "on-failure"; - ExecStart = "${pkgs.dnschain}/bin/dnschain"; + ExecStart = "${pkgs.nodePackages.dnschain}/bin/dnschain"; }; preStart = '' -- cgit 1.4.1 From 398705ba863b65b27e90436ead111536665caae3 Mon Sep 17 00:00:00 2001 From: Danylo Hlynskyi Date: Wed, 1 Nov 2017 10:25:26 +0200 Subject: containers: autoStart doc typo --- nixos/modules/virtualisation/containers.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'nixos') diff --git a/nixos/modules/virtualisation/containers.nix b/nixos/modules/virtualisation/containers.nix index 82dfc1c9f1ce..8618a9c93dd8 100644 --- a/nixos/modules/virtualisation/containers.nix +++ b/nixos/modules/virtualisation/containers.nix @@ -537,7 +537,7 @@ in type = types.bool; default = false; description = '' - Wether the container is automatically started at boot-time. + Whether the container is automatically started at boot-time. ''; }; -- cgit 1.4.1 From 2ddcdcce2652016ac58826fa600d19db111178e5 Mon Sep 17 00:00:00 2001 From: Sarah Brofeldt Date: Wed, 1 Nov 2017 19:06:27 +0100 Subject: nixos/postfix: support alternate smtp ports when relaying (#30685) * postfix: support alternate smtp ports when relaying * fix missing ; after merge --- nixos/modules/services/mail/postfix.nix | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) (limited to 'nixos') diff --git a/nixos/modules/services/mail/postfix.nix b/nixos/modules/services/mail/postfix.nix index 1fef9ac6ec90..867c0ea6761c 100644 --- a/nixos/modules/services/mail/postfix.nix +++ b/nixos/modules/services/mail/postfix.nix @@ -60,11 +60,11 @@ let manpage_directory = "${pkgs.postfix}/share/man"; html_directory = "${pkgs.postfix}/share/postfix/doc/html"; shlib_directory = false; - relayhost = if cfg.lookupMX || cfg.relayHost == "" - then cfg.relayHost - else - "[${cfg.relayHost}]" - + optionalString (cfg.relayPort != null) ":${toString cfg.relayPort}"; + relayhost = if cfg.relayHost == "" then "" else + if cfg.lookupMX + then "${cfg.relayHost}:${toString cfg.relayPort}" + else "[${cfg.relayHost}]:${toString cfg.relayPort}"; + mail_spool_directory = "/var/spool/mail/"; setgid_group = setgidGroup; } @@ -461,13 +461,10 @@ in }; relayPort = mkOption { - type = types.nullOr types.int; - default = null; - example = 587; + type = types.int; + default = 25; description = " - Specify an optional port for outbound mail relay. (Note: - only used if an explicit is - defined.) + SMTP port for relay mail relay. "; }; -- cgit 1.4.1