1{
2 lib,
3 stdenv,
4 autoconf,
5 automake,
6 libtool,
7 bison,
8 fetchFromGitHub,
9 flex,
10 lksctp-tools,
11 openssl,
12 pkg-config,
13 sqlite,
14 util-linux,
15 unstableGitUpdater,
16 nixosTests,
17}:
18
19stdenv.mkDerivation {
20 pname = "solanum";
21 version = "0-unstable-2025-07-20";
22
23 src = fetchFromGitHub {
24 owner = "solanum-ircd";
25 repo = "solanum";
26 rev = "7feda92636c9d5b5e7decceee1273dd18b6cc31b";
27 hash = "sha256-cfDwdE2CA69dSg59Sn1TKk3OWxvoTIm/KCiKfgzokVU=";
28 };
29
30 patches = [
31 ./dont-create-logdir.patch
32 ];
33
34 postPatch = ''
35 substituteInPlace include/defaults.h --replace 'ETCPATH "' '"/etc/solanum'
36 '';
37
38 preConfigure = ''
39 ./autogen.sh
40 '';
41
42 configureFlags = [
43 "--enable-epoll"
44 "--enable-ipv6"
45 "--enable-openssl=${openssl.dev}"
46 "--with-program-prefix=solanum-"
47 "--localstatedir=/var/lib"
48 "--with-rundir=/run"
49 "--with-logdir=/var/log"
50 ]
51 ++ lib.optionals (stdenv.hostPlatform.isLinux) [
52 "--enable-sctp=${lksctp-tools.out}/lib"
53 ];
54
55 nativeBuildInputs = [
56 autoconf
57 automake
58 libtool
59 bison
60 flex
61 pkg-config
62 util-linux
63 ];
64
65 buildInputs = [
66 openssl
67 sqlite
68 ];
69
70 doCheck = !stdenv.hostPlatform.isDarwin;
71
72 enableParallelBuilding = true;
73 # Missing install depends:
74 # ...-binutils-2.40/bin/ld: cannot find ./.libs/libircd.so: No such file or directory
75 # collect2: error: ld returned 1 exit status
76 # make[4]: *** [Makefile:634: solanum] Error 1
77 enableParallelInstalling = false;
78
79 passthru = {
80 tests = { inherit (nixosTests) solanum; };
81 updateScript = unstableGitUpdater { };
82 };
83
84 meta = with lib; {
85 description = "IRCd for unified networks";
86 homepage = "https://github.com/solanum-ircd/solanum";
87 license = licenses.gpl2Plus;
88 maintainers = with maintainers; [ hexa ];
89 platforms = platforms.unix;
90 };
91}