From 0a8684caddccb10f7f8e1470d8d7b5b952c837d7 Mon Sep 17 00:00:00 2001 From: lassulus Date: Mon, 24 May 2021 15:49:57 +0200 Subject: [PATCH 1/3] solanum: remove obsolete BANDB settings/patches (cherry picked from commit 8eb5701aaf0eb7ad842a67f09e2f80826ac1ce80) --- nixos/modules/services/networking/solanum.nix | 3 --- pkgs/servers/irc/solanum/bandb.patch | 12 ------------ pkgs/servers/irc/solanum/default.nix | 1 - 3 files changed, 16 deletions(-) delete mode 100644 pkgs/servers/irc/solanum/bandb.patch diff --git a/nixos/modules/services/networking/solanum.nix b/nixos/modules/services/networking/solanum.nix index 989621b204c..b6496fb8b35 100644 --- a/nixos/modules/services/networking/solanum.nix +++ b/nixos/modules/services/networking/solanum.nix @@ -82,9 +82,6 @@ in description = "Solanum IRC daemon"; after = [ "network.target" ]; wantedBy = [ "multi-user.target" ]; - environment = { - BANDB_DBPATH = "/var/lib/solanum/ban.db"; - }; serviceConfig = { ExecStart = "${solanum}/bin/solanum -foreground -logfile /dev/stdout -configfile ${configFile} -pidfile /run/solanum/ircd.pid"; DynamicUser = true; diff --git a/pkgs/servers/irc/solanum/bandb.patch b/pkgs/servers/irc/solanum/bandb.patch deleted file mode 100644 index 7d204398b99..00000000000 --- a/pkgs/servers/irc/solanum/bandb.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/ircd/bandbi.c b/ircd/bandbi.c -index 29a3bfa2..16a40f17 100644 ---- a/ircd/bandbi.c -+++ b/ircd/bandbi.c -@@ -83,7 +83,6 @@ start_bandb(void) - const char *suffix = ""; - #endif - -- rb_setenv("BANDB_DBPATH", ircd_paths[IRCD_PATH_BANDB], 1); - if(bandb_path == NULL) - { - snprintf(fullpath, sizeof(fullpath), "%s%cbandb%s", ircd_paths[IRCD_PATH_LIBEXEC], RB_PATH_SEPARATOR, suffix); diff --git a/pkgs/servers/irc/solanum/default.nix b/pkgs/servers/irc/solanum/default.nix index 2fa85072854..b6678271c31 100644 --- a/pkgs/servers/irc/solanum/default.nix +++ b/pkgs/servers/irc/solanum/default.nix @@ -23,7 +23,6 @@ stdenv.mkDerivation rec { patches = [ ./dont-create-logdir.patch - ./bandb.patch # https://github.com/solanum-ircd/solanum/issues/156 ]; postPatch = '' From 6ee61426da640dfb9813c3791cd245dc0bc4b6de Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Mon, 31 May 2021 03:21:51 +0200 Subject: [PATCH 2/3] nixos/solanum: implement reload and allow config changes Reload only works with a static configuration path as there is no way to pass the dynamically generated config path to a running solanum instance, therefore we symlink the configuration to /etc/solanum/ircd.conf. But that will prevent reloads of the ircd, because the systemd unit wouldn't change when the configuration changes. That is why we add the actual location of the config file to restartTriggers and enable reloadIfChanged, so changes will not restart, but reload on changes. (cherry picked from commit 60c62214f5a3c7db6aa30d8a8e02c863b6abcf0a) --- nixos/modules/services/networking/solanum.nix | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/nixos/modules/services/networking/solanum.nix b/nixos/modules/services/networking/solanum.nix index b6496fb8b35..dc066a24549 100644 --- a/nixos/modules/services/networking/solanum.nix +++ b/nixos/modules/services/networking/solanum.nix @@ -2,7 +2,7 @@ let inherit (lib) mkEnableOption mkIf mkOption types; - inherit (pkgs) solanum; + inherit (pkgs) solanum util-linux; cfg = config.services.solanum; configFile = pkgs.writeText "solanum.conf" cfg.config; @@ -78,12 +78,20 @@ in config = mkIf cfg.enable (lib.mkMerge [ { + + environment.etc."solanum/ircd.conf".source = configFile; + systemd.services.solanum = { description = "Solanum IRC daemon"; after = [ "network.target" ]; wantedBy = [ "multi-user.target" ]; + reloadIfChanged = true; + restartTriggers = [ + configFile + ]; serviceConfig = { - ExecStart = "${solanum}/bin/solanum -foreground -logfile /dev/stdout -configfile ${configFile} -pidfile /run/solanum/ircd.pid"; + ExecStart = "${solanum}/bin/solanum -foreground -logfile /dev/stdout -configfile /etc/solanum/ircd.conf -pidfile /run/solanum/ircd.pid"; + ExecReload = "${util-linux}/bin/kill -HUP $MAINPID"; DynamicUser = true; User = "solanum"; StateDirectory = "solanum"; From b36d51733c81bd14db59b2ba1a042e4241f3d3da Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Wed, 2 Jun 2021 02:41:53 +0200 Subject: [PATCH 3/3] solanum: clarify license to be gpl2 or later (cherry picked from commit 2441e82399ad349bac570cbbe72cfe1b3158cc59) --- pkgs/servers/irc/solanum/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/servers/irc/solanum/default.nix b/pkgs/servers/irc/solanum/default.nix index b6678271c31..d5e70799cf5 100644 --- a/pkgs/servers/irc/solanum/default.nix +++ b/pkgs/servers/irc/solanum/default.nix @@ -61,7 +61,7 @@ stdenv.mkDerivation rec { meta = with lib; { description = "An IRCd for unified networks"; homepage = "https://github.com/solanum-ircd/solanum"; - license = licenses.gpl2Only; + license = licenses.gpl2Plus; maintainers = with maintainers; [ hexa ]; platforms = platforms.unix; };