From d5260c5544b9dfbe35392d7b4e03ee57d7205628 Mon Sep 17 00:00:00 2001 From: ckie Date: Sun, 26 Nov 2023 05:32:22 +0200 Subject: nixos/transmission: correct typo on systemd StateDirectory systemd would previously create a nonoperational "/var/lib/transmission/watch-dir" directory due to a typo in the StateDirectory array ("watch-dir" -> "watchdir") I have corrected this by using the pre-declared constants for these folder names. --- nixos/modules/services/torrent/transmission.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'nixos') diff --git a/nixos/modules/services/torrent/transmission.nix b/nixos/modules/services/torrent/transmission.nix index b98cb5283a1a..4a3200c1325c 100644 --- a/nixos/modules/services/torrent/transmission.nix +++ b/nixos/modules/services/torrent/transmission.nix @@ -333,10 +333,10 @@ in cfg.settings.watch-dir; StateDirectory = [ "transmission" - "transmission/.config/transmission-daemon" - "transmission/.incomplete" - "transmission/Downloads" - "transmission/watch-dir" + "transmission/${settingsDir}" + "transmission/${incompleteDir}" + "transmission/${downloadsDir}" + "transmission/${watchDir}" ]; StateDirectoryMode = mkDefault 750; # The following options are only for optimizing: -- cgit 1.4.1 From ed67e22139a4e01338ce8b56ca2a3d4711d0199e Mon Sep 17 00:00:00 2001 From: Jacob Greenleaf Date: Wed, 6 Dec 2023 08:08:29 -0800 Subject: nixos/teamspeak3: SSH and HTTP ip+port options ServerQuery actually listens on three separate addresses each corresponding to its own protocol (raw/telnet, ssh, and http). By only setting `query_addr` we only update what IP we listen on for the raw protocol, not ssh and http protocols which end up listening on the default wildcard address. This change simply makes it so that setting `queryIP` sets the IP for all three protocols by setting each corresponding option (`query_ip`, `query_ssh_ip` and `query_http_ip`). --- nixos/modules/services/networking/teamspeak3.nix | 42 +++++++++++++++++++----- 1 file changed, 33 insertions(+), 9 deletions(-) (limited to 'nixos') diff --git a/nixos/modules/services/networking/teamspeak3.nix b/nixos/modules/services/networking/teamspeak3.nix index f09ef1a959ed..ff41539a6d9b 100644 --- a/nixos/modules/services/networking/teamspeak3.nix +++ b/nixos/modules/services/networking/teamspeak3.nix @@ -50,7 +50,7 @@ in }; defaultVoicePort = mkOption { - type = types.int; + type = types.port; default = 9987; description = lib.mdDoc '' Default UDP port for clients to connect to virtual servers - used for first virtual server, subsequent ones will open on incrementing port numbers by default. @@ -67,7 +67,7 @@ in }; fileTransferPort = mkOption { - type = types.int; + type = types.port; default = 30033; description = lib.mdDoc '' TCP port opened for file transfers. @@ -84,10 +84,26 @@ in }; queryPort = mkOption { - type = types.int; + type = types.port; default = 10011; description = lib.mdDoc '' - TCP port opened for ServerQuery connections. + TCP port opened for ServerQuery connections using the raw telnet protocol. + ''; + }; + + querySshPort = mkOption { + type = types.port; + default = 10022; + description = lib.mdDoc '' + TCP port opened for ServerQuery connections using the SSH protocol. + ''; + }; + + queryHttpPort = mkOption { + type = types.port; + default = 10080; + description = lib.mdDoc '' + TCP port opened for ServerQuery connections using the HTTP protocol. ''; }; @@ -128,7 +144,9 @@ in ]; networking.firewall = mkIf cfg.openFirewall { - allowedTCPPorts = [ cfg.fileTransferPort ] ++ optionals (cfg.openFirewallServerQuery) [ cfg.queryPort (cfg.queryPort + 11) ]; + allowedTCPPorts = [ cfg.fileTransferPort ] ++ (map (port: + mkIf cfg.openFirewallServerQuery port + ) [cfg.queryPort cfg.querySshPort cfg.queryHttpPort]); # subsequent vServers will use the incremented voice port, let's just open the next 10 allowedUDPPortRanges = [ { from = cfg.defaultVoicePort; to = cfg.defaultVoicePort + 10; } ]; }; @@ -141,13 +159,19 @@ in serviceConfig = { ExecStart = '' ${ts3}/bin/ts3server \ - dbsqlpath=${ts3}/lib/teamspeak/sql/ logpath=${cfg.logPath} \ - ${optionalString (cfg.voiceIP != null) "voice_ip=${cfg.voiceIP}"} \ + dbsqlpath=${ts3}/lib/teamspeak/sql/ \ + logpath=${cfg.logPath} \ + license_accepted=1 \ default_voice_port=${toString cfg.defaultVoicePort} \ - ${optionalString (cfg.fileTransferIP != null) "filetransfer_ip=${cfg.fileTransferIP}"} \ filetransfer_port=${toString cfg.fileTransferPort} \ + query_port=${toString cfg.queryPort} \ + query_ssh_port=${toString cfg.querySshPort} \ + query_http_port=${toString cfg.queryHttpPort} \ + ${optionalString (cfg.voiceIP != null) "voice_ip=${cfg.voiceIP}"} \ + ${optionalString (cfg.fileTransferIP != null) "filetransfer_ip=${cfg.fileTransferIP}"} \ ${optionalString (cfg.queryIP != null) "query_ip=${cfg.queryIP}"} \ - query_port=${toString cfg.queryPort} license_accepted=1 + ${optionalString (cfg.queryIP != null) "query_ssh_ip=${cfg.queryIP}"} \ + ${optionalString (cfg.queryIP != null) "query_http_ip=${cfg.queryIP}"} \ ''; WorkingDirectory = cfg.dataDir; User = user; -- cgit 1.4.1 From 85fcb9b4ef555af76ab54f88e27d9f4c28aec512 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Fri, 8 Dec 2023 17:56:54 +0800 Subject: nixos/guix: fix user activation script --- nixos/modules/services/misc/guix/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'nixos') diff --git a/nixos/modules/services/misc/guix/default.nix b/nixos/modules/services/misc/guix/default.nix index 00e84dc74554..7b468e7067cc 100644 --- a/nixos/modules/services/misc/guix/default.nix +++ b/nixos/modules/services/misc/guix/default.nix @@ -265,7 +265,7 @@ in linkProfileToPath = acc: profile: location: let guixProfile = "${cfg.stateDir}/guix/profiles/per-user/\${USER}/${profile}"; in acc + '' - [ -d "${guixProfile}" ] && ln -sf "${guixProfile}" "${location}" + [ -d "${guixProfile}" ] && [ -L "${location}" ] || ln -sf "${guixProfile}" "${location}" ''; activationScript = lib.foldlAttrs linkProfileToPath "" guixUserProfiles; -- cgit 1.4.1 From 57e3ca7057c30dc37345fb5ea215f0a1eb4b4527 Mon Sep 17 00:00:00 2001 From: chayleaf Date: Fri, 8 Dec 2023 17:35:11 +0700 Subject: nixos/maubot: fix eval with default config --- nixos/modules/services/matrix/maubot.nix | 2 +- pkgs/tools/networking/maubot/wrapper.nix | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'nixos') diff --git a/nixos/modules/services/matrix/maubot.nix b/nixos/modules/services/matrix/maubot.nix index 7d392c22983b..bc96ca03b1fc 100644 --- a/nixos/modules/services/matrix/maubot.nix +++ b/nixos/modules/services/matrix/maubot.nix @@ -42,7 +42,7 @@ let database = lib.last (lib.splitString "/" noSchema); }; - postgresDBs = [ + postgresDBs = builtins.filter isPostgresql [ cfg.settings.database cfg.settings.crypto_database cfg.settings.plugin_databases.postgres diff --git a/pkgs/tools/networking/maubot/wrapper.nix b/pkgs/tools/networking/maubot/wrapper.nix index baa0c29052e9..6f4c577110be 100644 --- a/pkgs/tools/networking/maubot/wrapper.nix +++ b/pkgs/tools/networking/maubot/wrapper.nix @@ -39,7 +39,7 @@ let wrapper = { pythonPackages ? (_: [ ]), plugins ? (_: [ ]), baseConfig ? null if builtins.isNull (baseConfig.server.override_resource_path or null) then "${unwrapped}/${python3.sitePackages}/maubot/management/frontend/build" else baseConfig.server.override_resource_path; - })})} $out/${python3.sitePackages}/maubot/example-config.yaml + })} $out/${python3.sitePackages}/maubot/example-config.yaml rm -rf $out/bin ''} mkdir -p $out/bin -- cgit 1.4.1 From d173469d3b24c0b68473d2d8d6182b8d41f7d30e Mon Sep 17 00:00:00 2001 From: sinanmohd Date: Fri, 8 Dec 2023 18:00:29 +0530 Subject: nixos/iwd: fix broken dhcp dns configuration --- nixos/modules/services/networking/iwd.nix | 2 ++ 1 file changed, 2 insertions(+) (limited to 'nixos') diff --git a/nixos/modules/services/networking/iwd.nix b/nixos/modules/services/networking/iwd.nix index 993a603c1ed5..3b1136816990 100644 --- a/nixos/modules/services/networking/iwd.nix +++ b/nixos/modules/services/networking/iwd.nix @@ -71,8 +71,10 @@ in }; systemd.services.iwd = { + path = [ config.networking.resolvconf.package ]; wantedBy = [ "multi-user.target" ]; restartTriggers = [ configFile ]; + serviceConfig.ReadWritePaths = "-/etc/resolv.conf"; }; }; -- cgit 1.4.1