summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2016-04-08 03:59:26 +0200
committertv <tv@krebsco.de>2016-04-08 03:59:26 +0200
commit7b7e8b11b56fe92ff9a62895d329fcc24c9d7489 (patch)
tree765129deaf5d77d921a7edaa290959f03034a601
parent46e818ebbc5446b4215ad9524089d9b2dc91cbd3 (diff)
retiolum netname: hostname -> enum
-rw-r--r--krebs/3modules/retiolum.nix10
1 files changed, 5 insertions, 5 deletions
diff --git a/krebs/3modules/retiolum.nix b/krebs/3modules/retiolum.nix
index fe4dbd50c..8217cbcfd 100644
--- a/krebs/3modules/retiolum.nix
+++ b/krebs/3modules/retiolum.nix
@@ -17,7 +17,7 @@ let
};
netname = mkOption {
- type = types.hostname;
+ type = types.enum (attrNames cfg.host.nets);
default = "retiolum";
description = ''
The tinc network name.
@@ -114,7 +114,7 @@ let
imp = {
environment.systemPackages = [ tinc iproute ];
- systemd.services.retiolum = {
+ systemd.services.${cfg.netname} = {
description = "Tinc daemon for Retiolum";
after = [ "network.target" ];
wantedBy = [ "multi-user.target" ];
@@ -125,12 +125,12 @@ let
Restart = "always";
# TODO we cannot chroot (-R) b/c we use symlinks to hosts
# and the private key.
- ExecStartPre = pkgs.writeScript "retiolum-init" ''
+ ExecStartPre = pkgs.writeScript "${cfg.netname}-prestart" ''
#! /bin/sh
install -o ${user.name} -m 0400 ${cfg.privateKeyFile} /tmp/retiolum-rsa_key.priv
'';
ExecStart = "${tinc}/sbin/tincd -c ${confDir} -d 0 -U ${user.name} -D --pidfile=/var/run/tinc.${SyslogIdentifier}.pid";
- SyslogIdentifier = "retiolum";
+ SyslogIdentifier = cfg.netname;
};
};
@@ -140,7 +140,7 @@ let
};
user = rec {
- name = "retiolum";
+ name = cfg.netname;
uid = genid name;
};