summaryrefslogtreecommitdiffstats
path: root/lass/3modules/news.nix
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2023-09-11 14:55:04 +0200
committertv <tv@krebsco.de>2023-09-11 14:55:04 +0200
commit8fc162ee3d9525a2b45346a1ca8f34ccb5ef971b (patch)
treeaa37724dd0452860d4b9b033332587c8832629e3 /lass/3modules/news.nix
parent90b1515dcd5b67a85cd92901fb211764b1fa5f83 (diff)
parent083229d0211096daec08673f743ccc45b1d8a0ac (diff)
Merge remote-tracking branch 'orange/master'
Diffstat (limited to 'lass/3modules/news.nix')
-rw-r--r--lass/3modules/news.nix76
1 files changed, 0 insertions, 76 deletions
diff --git a/lass/3modules/news.nix b/lass/3modules/news.nix
deleted file mode 100644
index b6061736c..000000000
--- a/lass/3modules/news.nix
+++ /dev/null
@@ -1,76 +0,0 @@
-{ config, lib, pkgs, ... }:
-
-with import <stockholm/lib>;
-
-let
- cfg = config.lass.news;
-
- out = {
- options.lass.news = api;
- config = lib.mkIf cfg.enable imp;
- };
-
- api = {
- enable = mkEnableOption "news";
- feeds = mkOption {
- type = types.listOf (types.submodule { options = {
- nick = mkOption {
- type = types.str;
- };
- feedurl = mkOption {
- type = types.str;
- };
- interval = mkOption {
- type = types.int;
- default = 1000;
- };
- channels = mkOption {
- type = types.listOf types.str;
- };
- };});
- };
- user = mkOption {
- type = types.user;
- default = {
- name = "news";
- home = "/var/lib/news";
- };
- };
- ircServer = mkOption {
- type = types.str;
- default = "localhost";
- description = "to which server the bot should connect";
- };
- };
-
- imp = {
-
- users.users.${cfg.user.name} = {
- inherit (cfg.user) home name uid;
- createHome = true;
- };
-
- systemd.services = listToAttrs (map (feed:
- nameValuePair "news-${feed.nick}" {
- wantedBy = [ "multi-user.target" ];
- after = [ "network.target" ];
- serviceConfig = {
- SyslogIdentifier = "news-${feed.nick}";
- User = cfg.user.name;
- PrivateTmp = true;
- Restart = "always";
- ExecStart = pkgs.writeDash "news-${feed.nick}" ''
- ${pkgs.haskellPackages.news}/bin/news '${feed.feedurl}' '${toString feed.interval}' \
- | ${pkgs.goify}/bin/goify \
- | while :; do
- ${pkgs.haskellPackages.kirk}/bin/ircout --nick '${feed.nick}' --host '${cfg.ircServer}' \
- \${concatStringsSep " \\" feed.channels}
- done
- '';
- };
- }
- ) cfg.feeds);
-
- };
-
-in out
[cgit] Unable to lock slot /tmp/cgit/5b300000.lock: No such file or directory (2)