summaryrefslogtreecommitdiffstats
path: root/krebs/3modules
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2016-02-11 23:18:00 +0100
committermakefu <github@syntax-fehler.de>2016-02-11 23:18:00 +0100
commit524a009c1e6cab6b38f6306ea2622581412aea5e (patch)
treef4a6499d505ad38aa674e6a62289bc7a71b3bca7 /krebs/3modules
parent014cbb7598c5d45cfc4cc7e1ec81c92e000eabfb (diff)
parent6cbe21aac7680af7a6c6c2ea367ee0569d53bb21 (diff)
Merge remote-tracking branch 'cd/master'
Diffstat (limited to 'krebs/3modules')
-rw-r--r--krebs/3modules/retiolum.nix29
1 files changed, 16 insertions, 13 deletions
diff --git a/krebs/3modules/retiolum.nix b/krebs/3modules/retiolum.nix
index 2bf8aa5d..3ebb5e23 100644
--- a/krebs/3modules/retiolum.nix
+++ b/krebs/3modules/retiolum.nix
@@ -64,6 +64,21 @@ let
'';
};
+ hostsPackage = mkOption {
+ type = types.package;
+ default = pkgs.stdenv.mkDerivation {
+ name = "${cfg.netname}-tinc-hosts";
+ phases = [ "installPhase" ];
+ installPhase = ''
+ mkdir $out
+ ${concatStrings (mapAttrsToList (_: host: ''
+ echo ${shell.escape host.nets.${cfg.netname}.tinc.config} \
+ > $out/${shell.escape host.name}
+ '') cfg.hosts)}
+ '';
+ };
+ };
+
iproutePackage = mkOption {
type = types.package;
default = pkgs.iproute;
@@ -130,18 +145,6 @@ let
tinc = cfg.tincPackage;
- tinc-hosts = pkgs.stdenv.mkDerivation {
- name = "${cfg.netname}-tinc-hosts";
- phases = [ "installPhase" ];
- installPhase = ''
- mkdir $out
- ${concatStrings (mapAttrsToList (_: host: ''
- echo ${shell.escape host.nets.${cfg.netname}.tinc.config} \
- > $out/${shell.escape host.name}
- '') cfg.hosts)}
- '';
- };
-
iproute = cfg.iproutePackage;
confDir = pkgs.runCommand "retiolum" {
@@ -153,7 +156,7 @@ let
mkdir -p $out
- ln -s ${tinc-hosts} $out/hosts
+ ln -s ${cfg.hostsPackage} $out/hosts
cat > $out/tinc.conf <<EOF
Name = ${cfg.name}