summaryrefslogtreecommitdiffstats
path: root/krebs/3modules/tinc.nix
diff options
context:
space:
mode:
authorlassulus <lass@lassul.us>2017-05-16 23:19:08 +0200
committerlassulus <lass@lassul.us>2017-05-16 23:20:37 +0200
commit0c2dc4ff66eded9f718a242bb342b366ee6c6978 (patch)
treefa3410b870459ab441f044173baecb225e534e7f /krebs/3modules/tinc.nix
parente1350904390ca40e9ab8186c0ff27d088431a430 (diff)
tinc module: add option enableLegacy
Diffstat (limited to 'krebs/3modules/tinc.nix')
-rw-r--r--krebs/3modules/tinc.nix7
1 files changed, 7 insertions, 0 deletions
diff --git a/krebs/3modules/tinc.nix b/krebs/3modules/tinc.nix
index 67d383bb1..8af15c13b 100644
--- a/krebs/3modules/tinc.nix
+++ b/krebs/3modules/tinc.nix
@@ -17,6 +17,7 @@ let
in {
enable = mkEnableOption "krebs.tinc.${netname}" // { default = true; };
+ enableLegacy = mkEnableOption "/etc/tinc/${netname}";
confDir = mkOption {
type = types.package;
@@ -195,6 +196,12 @@ let
}
) 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:
let
tinc = cfg.tincPackage;