-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodule.nix
57 lines (47 loc) · 1.47 KB
/
module.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
{ config, lib, pkgs, ... }:
with lib;
let
knotenwanderung = with pkgs.python3Packages; buildPythonPackage rec {
pname = "knotenwanderung";
version = "unstable";
#src = pkgs.fetchFromGitHub {
# owner = "hackspace-marburg";
# repo = "ffmr-knotenwanderung";
# rev = "v0.1.0";
# sha256 = "0yywfpk9qzr2pbi9g1ld34gggmngg1ir1vyw6n26zpmf4vv8250p";
#};
src = lib.cleanSource ./.;
propagatedBuildInputs = [ bjoern bottle cachetools influxdb ];
};
cfg = config.services.knotenwanderung;
configFile = pkgs.writeText "knotenwanderung.ini" (generators.toINI {} cfg.config);
in {
options.services.knotenwanderung = {
enable = mkEnableOption ''
knotenwanderung, web service to check whether FFMR nodes have been renamed
'';
config = mkOption {
type = types.attrs;
description = "A set to mimic knotenwanderung's configuration INI file.";
example = {
influxdb = {
host = "influx.example.com"; port = 1312; database = "ff";
};
bottle = {
host = "localhost"; port = 8080;
};
};
};
};
config = {
systemd.services.knotenwanderung = mkIf cfg.enable {
description = "Web service to check whether FFMR nodes have been renamed";
after = [ "network.target" ];
wantedBy = [ "multi-user.target" ];
serviceConfig = {
ExecStart = "${knotenwanderung}/bin/knotenwanderung ${configFile}";
DynamicUser = true;
};
};
};
}