makefu: init taskserver, keep an eye on https://github.com/NixOS/nixpkgs/pull/14476

This commit is contained in:
makefu 2016-04-10 23:24:15 +02:00
parent 45bb05d291
commit 6f4bc4b34c
4 changed files with 66 additions and 1 deletions

View File

@ -41,6 +41,8 @@ in {
];
};
makefu.taskserver.enable = true;
krebs.nginx.servers.cgit = {
server-names = [ "cgit.euer.krebsco.de" ];
listen = [ "${external-ip}:80" "${internal-ip}:80" ];
@ -86,6 +88,8 @@ in {
21032
# tinc-retiolum
21031
# taskserver
53589
];
allowedUDPPorts = [
# tinc

View File

@ -4,6 +4,7 @@ _:
imports = [
./snapraid.nix
./umts.nix
./taskserver.nix
];
}

View File

@ -0,0 +1,60 @@
{ config, lib, pkgs, ... }:
with config.krebs.lib;
let
cfg = config.makefu.taskserver;
out = {
options.makefu.taskserver = api;
config = lib.mkIf cfg.enable imp;
};
api = {
enable = mkEnableOption "taskserver";
workingDir = mkOption {
type = types.str;
default = "/var/lib/taskserver";
};
package = mkOption {
type = types.package;
default = pkgs.taskserver;
};
};
imp = {
environment.systemPackages = [ cfg.package ];
systemd.services.taskserver = {
description = "taskd server";
after = [ "network.target" ];
wantedBy = [ "multi-user.target" ];
restartIfChanged = true;
unitConfig = {
Documentation = "http://taskwarrior.org/docs/#taskd" ;
# https://taskwarrior.org/docs/taskserver/configure.html
ConditionPathExists = "${cfg.workingDir}/config";
};
serviceConfig = {
Type = "simple";
ExecStart = "${cfg.package}/bin/taskd server --data ${cfg.workingDir}";
WorkingDirectory = cfg.workingDir;
PrivateTmp = true;
InaccessibleDirectories = "/home /boot /opt /mnt /media";
User = "taskd";
};
};
users.users.taskd = {
uid = genid "taskd";
home = cfg.workingDir;
createHome = true;
};
users.groups.taskd.gid = genid "taskd";
};
in
out

View File

@ -9,8 +9,8 @@ in
alsa-hdspconf = callPackage ./alsa-tools { alsaToolTarget="hdspconf";};
alsa-hdsploader = callPackage ./alsa-tools { alsaToolTarget="hdsploader";};
awesomecfg = callPackage ./awesomecfg {};
nodemcu-uploader = callPackage ./nodemcu-uploader {};
mycube-flask = callPackage ./mycube-flask {};
nodemcu-uploader = callPackage ./nodemcu-uploader {};
tw-upload-plugin = callPackage ./tw-upload-plugin {};
taskserver = callPackage ./taskserver {};
};