diff options
author | tv <tv@krebsco.de> | 2023-09-12 12:56:39 +0200 |
---|---|---|
committer | tv <tv@krebsco.de> | 2023-09-13 16:23:38 +0200 |
commit | fbd485cd86c7e9984819357398f912a2d5510845 (patch) | |
tree | e1a9e2eedacfa25018d6b0eef3f4628a4d503ebc /tv/3modules/charybdis/default.nix | |
parent | 5370e0485788224126861e076110ac705013d2de (diff) |
tv: emigrate
Diffstat (limited to 'tv/3modules/charybdis/default.nix')
-rw-r--r-- | tv/3modules/charybdis/default.nix | 81 |
1 files changed, 0 insertions, 81 deletions
diff --git a/tv/3modules/charybdis/default.nix b/tv/3modules/charybdis/default.nix deleted file mode 100644 index 1fdcea572..000000000 --- a/tv/3modules/charybdis/default.nix +++ /dev/null @@ -1,81 +0,0 @@ -with import ./lib; -{ config, pkgs, ... }@args: let - cfg = config.tv.charybdis; -in { - options.tv.charybdis = { - enable = mkEnableOption "tv.charybdis"; - motd = mkOption { - type = types.str; - default = "/join #retiolum"; - }; - port = mkOption { - type = types.int; - default = 6667; - }; - ssl_cert = mkOption { - type = types.path; - }; - ssl_dh_params = mkOption { - type = types.absolute-pathname; - default = "${config.krebs.secret.directory}/charybdis.dh.pem"; - }; - ssl_private_key = mkOption { - type = types.absolute-pathname; - default = "${config.krebs.secret.directory}/charybdis.key.pem"; - }; - sslport = mkOption { - type = types.int; - default = 6697; - }; - user = mkOption { - type = types.user; - default = { - name = "charybdis"; - home = "/var/lib/charybdis"; - }; - }; - }; - config = lib.mkIf cfg.enable { - - environment.etc."charybdis-ircd.motd".text = cfg.motd; - - krebs.systemd.services.charybdis = {}; - - systemd.services.charybdis = { - wantedBy = [ "multi-user.target" ]; - after = [ "network-online.target" ]; - environment = { - BANDB_DBPATH = "${cfg.user.home}/ban.db"; - }; - serviceConfig = { - SyslogIdentifier = "charybdis"; - User = cfg.user.name; - PrivateTmp = true; - Restart = "always"; - ExecStartPre = [ - "${pkgs.coreutils}/bin/ln -s /etc/charybdis-ircd.motd /tmp/ircd.motd" - "${pkgs.coreutils}/bin/ln -s \${CREDENTIALS_DIRECTORY} /tmp/credentials" - ]; - ExecStart = toString [ - "${pkgs.charybdis}/bin/charybdis" - "-configfile ${import ./config.nix args}" - "-foreground" - "-logfile /dev/stderr" - ]; - LoadCredential = [ - "ssl_dh_params:${cfg.ssl_dh_params}" - "ssl_private_key:${cfg.ssl_private_key}" - ]; - }; - }; - - users.users.${cfg.user.name} = { - inherit (cfg.user) home name uid; - createHome = true; - group = cfg.user.name; - isSystemUser = true; - }; - - users.groups.${cfg.user.name} = {}; - }; -} |