summaryrefslogtreecommitdiffstats
path: root/krebs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2021-05-20 11:08:58 +0200
committertv <tv@krebsco.de>2021-05-20 11:08:58 +0200
commit5460255668f43ad1486c6ce0261aebe06d64857a (patch)
tree75e4f4b71c5636bb405b9ddbb30fdbeeffb4eced /krebs
parenta5d9c02a937f577c0dc25b8e46142f9c9b1db534 (diff)
parentda975042c505a2fa693677cbd10d8245c17b3570 (diff)
Merge remote-tracking branch 'prism/master'
Diffstat (limited to 'krebs')
-rw-r--r--krebs/2configs/ircd.nix4
-rw-r--r--krebs/3modules/default.nix2
-rw-r--r--krebs/3modules/solanum.nix (renamed from krebs/3modules/charybdis.nix)46
-rw-r--r--krebs/5pkgs/simple/solanum/bandb.patch12
-rw-r--r--krebs/5pkgs/simple/solanum/default.nix63
-rw-r--r--krebs/5pkgs/simple/solanum/dont-create-logdir.patch14
-rw-r--r--krebs/nixpkgs-unstable.json8
-rw-r--r--krebs/nixpkgs.json8
8 files changed, 122 insertions, 35 deletions
diff --git a/krebs/2configs/ircd.nix b/krebs/2configs/ircd.nix
index 3ef2e7d2b..d4ac9e42a 100644
--- a/krebs/2configs/ircd.nix
+++ b/krebs/2configs/ircd.nix
@@ -5,9 +5,9 @@
6667 6669
];
- systemd.services.charybdis.serviceConfig.LimitNOFILE = 16384;
+ systemd.services.solanum.serviceConfig.LimitNOFILE = 16384;
- krebs.charybdis = {
+ krebs.solanum = {
enable = true;
motd = ''
hello
diff --git a/krebs/3modules/default.nix b/krebs/3modules/default.nix
index 85d27459b..e75afad1d 100644
--- a/krebs/3modules/default.nix
+++ b/krebs/3modules/default.nix
@@ -17,7 +17,6 @@ let
./buildbot/slave.nix
./build.nix
./cachecache.nix
- ./charybdis.nix
./ci.nix
./current.nix
./dns.nix
@@ -52,6 +51,7 @@ let
./secret.nix
./setuid.nix
./shadow.nix
+ ./solanum.nix
./sync-containers.nix
./tinc.nix
./tinc_graphs.nix
diff --git a/krebs/3modules/charybdis.nix b/krebs/3modules/solanum.nix
index 038d79dd0..00aefce85 100644
--- a/krebs/3modules/charybdis.nix
+++ b/krebs/3modules/solanum.nix
@@ -2,10 +2,10 @@
let
inherit (lib) mkEnableOption mkIf mkOption singleton types;
- inherit (pkgs) coreutils charybdis;
- cfg = config.krebs.charybdis;
+ inherit (pkgs) coreutils solanum;
+ cfg = config.krebs.solanum;
- configFile = pkgs.writeText "charybdis.conf" ''
+ configFile = pkgs.writeText "solanum.conf" ''
${cfg.config}
'';
in
@@ -16,22 +16,22 @@ in
options = {
- krebs.charybdis = {
+ krebs.solanum = {
- enable = mkEnableOption "Charybdis IRC daemon";
+ enable = mkEnableOption "Solanum IRC daemon";
config = mkOption {
type = types.str;
description = ''
- Charybdis IRC daemon configuration file.
+ Solanum IRC daemon configuration file.
'';
};
statedir = mkOption {
- type = types.str;
- default = "/var/lib/charybdis";
+ type = types.path;
+ default = "/var/lib/solanum";
description = ''
- Location of the state directory of charybdis.
+ Location of the state directory of solanum.
'';
};
@@ -39,7 +39,7 @@ in
type = types.str;
default = "ircd";
description = ''
- Charybdis IRC daemon user.
+ Solanum IRC daemon user.
'';
};
@@ -47,7 +47,7 @@ in
type = types.str;
default = "ircd";
description = ''
- Charybdis IRC daemon group.
+ Solanum IRC daemon group.
'';
};
@@ -55,9 +55,9 @@ in
type = types.nullOr types.lines;
default = null;
description = ''
- Charybdis MOTD text.
+ Solanum MOTD text.
- Charybdis will read its MOTD from /etc/charybdis/ircd.motd .
+ Solanum will read its MOTD from /etc/solanum/ircd.motd .
If set, the value of this option will be written to this path.
'';
};
@@ -72,38 +72,36 @@ in
config = mkIf cfg.enable (lib.mkMerge [
{
users.users.${cfg.user} = {
- description = "Charybdis IRC daemon user";
+ description = "Solanum IRC daemon user";
uid = config.ids.uids.ircd;
group = cfg.group;
};
users.groups.${cfg.group} = {
- name = cfg.group;
gid = config.ids.gids.ircd;
};
- systemd.services.charybdis = {
- description = "Charybdis IRC daemon";
+ systemd.tmpfiles.rules = [
+ "d ${cfg.statedir} - ${cfg.user} ${cfg.group} - -"
+ ];
+
+ systemd.services.solanum = {
+ description = "Solanum IRC daemon";
wantedBy = [ "multi-user.target" ];
environment = {
BANDB_DBPATH = "${cfg.statedir}/ban.db";
};
serviceConfig = {
- ExecStart = "${charybdis}/bin/charybdis -foreground -logfile /dev/stdout -configfile ${configFile}";
+ ExecStart = "${solanum}/bin/solanum -foreground -logfile /dev/stdout -configfile ${configFile} -pidfile ${cfg.statedir}/ircd.pid";
Group = cfg.group;
User = cfg.user;
- PermissionsStartOnly = true; # preStart needs to run with root permissions
};
- preStart = ''
- ${coreutils}/bin/mkdir -p ${cfg.statedir}
- ${coreutils}/bin/chown ${cfg.user}:${cfg.group} ${cfg.statedir}
- '';
};
}
(mkIf (cfg.motd != null) {
- environment.etc."charybdis/ircd.motd".text = cfg.motd;
+ environment.etc."solanum/ircd.motd".text = cfg.motd;
})
]);
}
diff --git a/krebs/5pkgs/simple/solanum/bandb.patch b/krebs/5pkgs/simple/solanum/bandb.patch
new file mode 100644
index 000000000..7d204398b
--- /dev/null
+++ b/krebs/5pkgs/simple/solanum/bandb.patch
@@ -0,0 +1,12 @@
+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/krebs/5pkgs/simple/solanum/default.nix b/krebs/5pkgs/simple/solanum/default.nix
new file mode 100644
index 000000000..279cccbcc
--- /dev/null
+++ b/krebs/5pkgs/simple/solanum/default.nix
@@ -0,0 +1,63 @@
+{ lib, stdenv
+, fetchFromGitHub
+, autoreconfHook
+, pkg-config
+, bison
+, flex
+, openssl
+, sqlite
+, lksctp-tools
+}:
+
+stdenv.mkDerivation rec {
+ pname = "solanum";
+ version = "unstable-2021-04-27";
+
+ src = fetchFromGitHub {
+ owner = "solanum-ircd";
+ repo = pname;
+ rev = "3ff5a12e75662e9a642f2a4364797bd361eb0925";
+ sha256 = "14ywmfdv8cncbyg08y2qdis00kwg8lvhkcgj185is67smh0qf88f";
+ };
+
+ patches = [
+ ./dont-create-logdir.patch
+ ./bandb.patch # https://github.com/solanum-ircd/solanum/issues/156
+ ];
+
+ configureFlags = [
+ "--enable-epoll"
+ "--enable-ipv6"
+ "--enable-openssl=${openssl.dev}"
+ "--with-program-prefix=solanum-"
+ "--localstatedir=/var/lib"
+ "--with-rundir=/run"
+ "--with-logdir=/var/log"
+ ] ++ lib.optionals (stdenv.isLinux) [
+ "--enable-sctp=${lksctp-tools.out}/lib"
+ ];
+
+ nativeBuildInputs = [
+ autoreconfHook
+ bison
+ flex
+ pkg-config
+ ];
+
+ buildInputs = [
+ openssl
+ sqlite
+ ];
+
+ doCheck = !stdenv.isDarwin;
+
+ enableParallelBuilding = true;
+
+ meta = with lib; {
+ description = "An IRCd for unified networks";
+ homepage = "https://github.com/solanum-ircd/solanum";
+ license = licenses.gpl2Only;
+ maintainers = with maintainers; [ hexa ];
+ platforms = platforms.unix;
+ };
+}
diff --git a/krebs/5pkgs/simple/solanum/dont-create-logdir.patch b/krebs/5pkgs/simple/solanum/dont-create-logdir.patch
new file mode 100644
index 000000000..e348dd7b8
--- /dev/null
+++ b/krebs/5pkgs/simple/solanum/dont-create-logdir.patch
@@ -0,0 +1,14 @@
+diff --git a/Makefile.am b/Makefile.am
+index 19e7b396..21093521 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -35,9 +35,6 @@ include/serno.h:
+ echo '#define DATECODE 0UL' >>include/serno.h; \
+ fi
+
+-install-data-hook:
+- test -d ${DESTDIR}${logdir} || mkdir -p ${DESTDIR}${logdir}
+-
+ install-exec-hook:
+ rm -f ${DESTDIR}${libdir}/*.la
+ rm -f ${DESTDIR}${moduledir}/*.la
diff --git a/krebs/nixpkgs-unstable.json b/krebs/nixpkgs-unstable.json
index 83ae57a6f..fe46ec022 100644
--- a/krebs/nixpkgs-unstable.json
+++ b/krebs/nixpkgs-unstable.json
@@ -1,9 +1,9 @@
{
"url": "https://github.com/NixOS/nixpkgs",
- "rev": "39e6bf76474ce742eb027a88c4da6331f0a1526f",
- "date": "2021-05-04T23:07:42+02:00",
- "path": "/nix/store/9zbih9x2pfi782vv73v0vjxscmzyf4da-nixpkgs",
- "sha256": "1pxigbywdq4yf7smas6zq4vhakbkvm1vhj443qjikh77fc8hy17b",
+ "rev": "7a1fbc38a4b538450ac0d42aec8a3e513b4d723e",
+ "date": "2021-05-16T12:16:31+02:00",
+ "path": "/nix/store/iq2sy65gmwad2prm8lcdh6k5f7ywxci5-nixpkgs",
+ "sha256": "0jg8dilsw0gr4jfshkk3wd50gddd11hvd836fxkw43m6m47885p7",
"fetchSubmodules": false,
"deepClone": false,
"leaveDotGit": false
diff --git a/krebs/nixpkgs.json b/krebs/nixpkgs.json
index 1d1dee220..06b865cc8 100644
--- a/krebs/nixpkgs.json
+++ b/krebs/nixpkgs.json
@@ -1,9 +1,9 @@
{
"url": "https://github.com/NixOS/nixpkgs",
- "rev": "d90df566caff6ef84f7bfccc2a2c95496f221d62",
- "date": "2021-05-04T18:59:22-04:00",
- "path": "/nix/store/3jr3hwykb05r9m5g3phpx6f7k2956ny3-nixpkgs",
- "sha256": "0f1im9c83kyc465k5lsqyhb5saki3dgh5bb1gyyh7gmqlhyvqcax",
+ "rev": "33824cdf8e4fec30c5b9ddc91b18991c3c375227",
+ "date": "2021-05-18T19:08:44-04:00",
+ "path": "/nix/store/s3f1q2a5hn60jdnz8h66z7yahrmzifin-nixpkgs",
+ "sha256": "1sad0x998k3iid2vp57kv4skvf90yh4gbs61dv3p45c2qi3sql46",
"fetchSubmodules": false,
"deepClone": false,
"leaveDotGit": false