l 3 pyload: init

This commit is contained in:
lassulus 2017-05-23 20:36:23 +02:00
parent d1321d6411
commit ad1e4cb239
2 changed files with 56 additions and 0 deletions

View File

@ -6,6 +6,7 @@ _:
./hosts.nix ./hosts.nix
./mysql-backup.nix ./mysql-backup.nix
./news.nix ./news.nix
./pyload.nix
./umts.nix ./umts.nix
./usershadow.nix ./usershadow.nix
./xresources.nix ./xresources.nix

55
lass/3modules/pyload.nix Normal file
View File

@ -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