tinc module: add option enableLegacy

This commit is contained in:
lassulus 2017-05-16 23:19:08 +02:00
parent e135090439
commit 0c2dc4ff66

View File

@ -17,6 +17,7 @@ let
in { in {
enable = mkEnableOption "krebs.tinc.${netname}" // { default = true; }; enable = mkEnableOption "krebs.tinc.${netname}" // { default = true; };
enableLegacy = mkEnableOption "/etc/tinc/${netname}";
confDir = mkOption { confDir = mkOption {
type = types.package; type = types.package;
@ -195,6 +196,12 @@ let
} }
) config.krebs.tinc; ) config.krebs.tinc;
environment.etc = mapAttrs' (netname: cfg:
nameValuePair "tinc/${netname}" (mkIf cfg.enableLegacy {
source = cfg.confDir;
})
) config.krebs.tinc;
systemd.services = mapAttrs (netname: cfg: systemd.services = mapAttrs (netname: cfg:
let let
tinc = cfg.tincPackage; tinc = cfg.tincPackage;