9 cfg = config.services.lambdabot;
11 rc = builtins.toFile "script.rc" cfg.script;
21 services.lambdabot = {
23 enable = lib.mkOption {
24 type = lib.types.bool;
26 description = "Enable the Lambdabot IRC bot";
29 package = lib.mkPackageOption pkgs "lambdabot" { };
31 script = lib.mkOption {
34 description = "Lambdabot script";
43 config = lib.mkIf cfg.enable {
45 systemd.services.lambdabot = {
46 description = "Lambdabot daemon";
47 after = [ "network.target" ];
48 wantedBy = [ "multi-user.target" ];
49 # Workaround for https://github.com/lambdabot/lambdabot/issues/117
53 mkfifo /run/lambdabot/offline
57 cat /run/lambdabot/offline
59 ) | ${cfg.package}/bin/lambdabot
63 RuntimeDirectory = [ "lambdabot" ];
67 users.users.lambdabot = {
69 description = "Lambdabot daemon user";
70 home = "/var/lib/lambdabot";
72 uid = config.ids.uids.lambdabot;
75 users.groups.lambdabot.gid = config.ids.gids.lambdabot;