summaryrefslogtreecommitdiffstats
path: root/lass/3modules
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2017-06-01 10:08:56 +0200
committermakefu <github@syntax-fehler.de>2017-06-01 10:08:56 +0200
commit772f84305d90380e0d221cf49ae3f1597d0d0510 (patch)
tree8d2241648396dc34fa96c8c68e12f832fbc7c308 /lass/3modules
parent90822f64e0bf247c5cca2f035077553cac5ceb79 (diff)
parent21d92086fe00c7369fde3951f92e9f73f4c05ee9 (diff)
Merge remote-tracking branch 'lass/master'
Diffstat (limited to 'lass/3modules')
-rw-r--r--lass/3modules/default.nix1
-rw-r--r--lass/3modules/hosts.nix2
-rw-r--r--lass/3modules/pyload.nix55
3 files changed, 57 insertions, 1 deletions
diff --git a/lass/3modules/default.nix b/lass/3modules/default.nix
index 73692446a..fd353e008 100644
--- a/lass/3modules/default.nix
+++ b/lass/3modules/default.nix
@@ -6,6 +6,7 @@ _:
./hosts.nix
./mysql-backup.nix
./news.nix
+ ./pyload.nix
./umts.nix
./usershadow.nix
./xresources.nix
diff --git a/lass/3modules/hosts.nix b/lass/3modules/hosts.nix
index 125819bb0..7e3af10be 100644
--- a/lass/3modules/hosts.nix
+++ b/lass/3modules/hosts.nix
@@ -6,7 +6,7 @@ with import <stockholm/lib>;
options.lass.hosts = mkOption {
type = types.attrsOf types.host;
default =
- filterAttrs (_: host: host.owner.name == "lass")
+ filterAttrs (_: host: host.owner.name == "lass" && host.managed)
config.krebs.hosts;
};
}
diff --git a/lass/3modules/pyload.nix b/lass/3modules/pyload.nix
new file mode 100644
index 000000000..6f29ffb17
--- /dev/null
+++ b/lass/3modules/pyload.nix
@@ -0,0 +1,55 @@
+{ config, lib, pkgs, ... }:
+
+with import <stockholm/lib>;
+
+let
+ cfg = config.lass.pyload;
+
+ out = {
+ options.lass.pyload = api;
+ config = lib.mkIf cfg.enable imp;
+ };
+
+ api = {
+ enable = mkEnableOption "pyload";
+ user = mkOption {
+ type = types.str;
+ default = "download";
+ };
+ };
+
+ imp = {
+
+ krebs.per-user.${cfg.user}.packages = [
+ pkgs.pyload
+ pkgs.spidermonkey
+ pkgs.tesseract
+ ];
+
+ krebs.iptables.tables.filter.INPUT.rules = [
+ { predicate = "-p tcp --dport 9099"; target = "ACCEPT"; }
+ ];
+ systemd.services.pyload = {
+ description = "pyload";
+ after = [ "network.target" ];
+ wantedBy = [ "multi-user.target" ];
+
+ path = with pkgs; [
+ pyload
+ spidermonkey
+ tesseract
+ dnsmasq
+ ];
+
+ restartIfChanged = true;
+
+ serviceConfig = {
+ Restart = "always";
+ ExecStart = "${pkgs.pyload}/bin/pyLoadCore";
+ User = cfg.user;
+ };
+ };
+
+ };
+
+in out