summaryrefslogtreecommitdiffstats
path: root/makefu/2configs/deployment/feed.euer.krebsco.de/default.nix
diff options
context:
space:
mode:
authorlassulus <lassulus@lassul.us>2020-04-22 00:33:14 +0200
committerlassulus <lassulus@lassul.us>2020-04-22 00:33:14 +0200
commit0bfff7d9813a3cb0e16a178f6145c62652eec662 (patch)
tree8420628c70b033884db57740418c709b2630e51d /makefu/2configs/deployment/feed.euer.krebsco.de/default.nix
parentc49867b40327f83a18b956404875637ca379c1ba (diff)
parentfacef9b812de753d50ae1509ae7afcd522504aec (diff)
Merge remote-tracking branch 'gum/20.03' into 20.03
Diffstat (limited to 'makefu/2configs/deployment/feed.euer.krebsco.de/default.nix')
-rw-r--r--makefu/2configs/deployment/feed.euer.krebsco.de/default.nix52
1 files changed, 52 insertions, 0 deletions
diff --git a/makefu/2configs/deployment/feed.euer.krebsco.de/default.nix b/makefu/2configs/deployment/feed.euer.krebsco.de/default.nix
new file mode 100644
index 000000000..de072092b
--- /dev/null
+++ b/makefu/2configs/deployment/feed.euer.krebsco.de/default.nix
@@ -0,0 +1,52 @@
+{ config, lib, pkgs, ... }:
+let
+ filter-file = ./filter.yml;
+ pkg = with pkgs.python3Packages;buildPythonPackage rec {
+ version = "d16ce227dc68c9f60f6dd06e6835bab7cdfdf61b";
+ pname = "ebk-notify";
+ propagatedBuildInputs = [
+ docopt
+ pyyaml
+ requests
+ beautifulsoup4
+ dateutil
+ feedgen
+ ];
+ src = pkgs.fetchgit {
+ url = "http://cgit.euer.krebsco.de/ebk-notify";
+ rev = version;
+ sha256 = "15dlhp17alm01fw7mzdyh2z9zwz8psrs489lxs3hgg1p5wa0kzsp";
+ };
+ };
+ domain = "feed.euer.krebsco.de";
+ path = "/var/www/feed.euer.krebsco.de";
+in
+{
+ systemd.tmpfiles.rules = [
+ "d ${path} nginx nogroup - -"
+ ];
+ krebs.secret.files.ebknotify = {
+ path = "/etc/ebk-notify.yml";
+ owner.name = "nginx";
+ source-path = "${<secrets/ebk-notify.yml>}";
+ };
+ systemd.services.ebk-notify = {
+ startAt = "*:0/10";
+ serviceConfig = {
+ User = "nginx"; # TODO better permission setting
+ # PrivateTmp = true;
+ ExecStart = "${pkg}/bin/ebk-notify --atom --outdir ${path} --config /etc/ebk-notify.yml --cache /tmp/ebk-cache.json --filter ${filter-file} --wait 30";
+ };
+ };
+ systemd.timers.ebk-notify.timerConfig.RandomizedDelaySec = "120";
+ services.nginx = {
+ virtualHosts."${domain}" = {
+ forceSSL = true;
+ enableACME = true;
+ locations."/" = {
+ root = path;
+ index = "root.atom";
+ };
+ };
+ };
+}