From fa08ca88dee73ac0a0b888e114ab1df3ecf4c0fa Mon Sep 17 00:00:00 2001 From: lassulus Date: Fri, 19 May 2017 00:27:25 +0200 Subject: l 3 hosts: filter unmanaged hosts --- lass/3modules/hosts.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lass/3modules') diff --git a/lass/3modules/hosts.nix b/lass/3modules/hosts.nix index 125819bb..7e3af10b 100644 --- a/lass/3modules/hosts.nix +++ b/lass/3modules/hosts.nix @@ -6,7 +6,7 @@ with import ; 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; }; } -- cgit v1.2.3 From ad1e4cb239bfbb39be977c3fdf2f5f172bb5a4f5 Mon Sep 17 00:00:00 2001 From: lassulus Date: Tue, 23 May 2017 20:36:23 +0200 Subject: l 3 pyload: init --- lass/3modules/default.nix | 1 + lass/3modules/pyload.nix | 55 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 lass/3modules/pyload.nix (limited to 'lass/3modules') diff --git a/lass/3modules/default.nix b/lass/3modules/default.nix index 73692446..fd353e00 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/pyload.nix b/lass/3modules/pyload.nix new file mode 100644 index 00000000..6f29ffb1 --- /dev/null +++ b/lass/3modules/pyload.nix @@ -0,0 +1,55 @@ +{ config, lib, pkgs, ... }: + +with import ; + +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 -- cgit v1.2.3