summaryrefslogtreecommitdiffstats
path: root/krebs/3modules/retiolum.nix
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2016-02-06 15:43:24 +0100
committertv <tv@krebsco.de>2016-02-06 15:43:24 +0100
commitdf89fb7e9121d395357885e00a24a616eb1fef57 (patch)
tree8d556e74a0700888bd267a57e975e78c6476aed7 /krebs/3modules/retiolum.nix
parent23c7c10f5a5ed83dca001d7382e5b89981277f8c (diff)
krebs.retiolum: don't generate extraHosts
Diffstat (limited to 'krebs/3modules/retiolum.nix')
-rw-r--r--krebs/3modules/retiolum.nix54
1 files changed, 2 insertions, 52 deletions
diff --git a/krebs/3modules/retiolum.nix b/krebs/3modules/retiolum.nix
index 08ac96461..2bf8aa5db 100644
--- a/krebs/3modules/retiolum.nix
+++ b/krebs/3modules/retiolum.nix
@@ -29,22 +29,13 @@ let
'';
};
- generateEtcHosts = mkOption {
- type = types.str;
- default = "both";
- description = ''
- If set to <literal>short</literal>, <literal>long</literal>, or <literal>both</literal>,
- then generate entries in <filename>/etc/hosts</filename> from subnets.
- '';
- };
-
netname = mkOption {
type = types.str;
default = "retiolum";
description = ''
The tinc network name.
- It is used to generate long host entries,
- and name the TUN device.
+ It is used to name the TUN device and to generate the default value for
+ <literal>config.krebs.retiolum.hosts</literal>.
'';
};
@@ -107,8 +98,6 @@ let
imp = {
environment.systemPackages = [ tinc iproute ];
- networking.extraHosts = retiolumExtraHosts;
-
systemd.services.retiolum = {
description = "Tinc daemon for Retiolum";
after = [ "network.target" ];
@@ -155,45 +144,6 @@ let
iproute = cfg.iproutePackage;
- retiolumExtraHosts = import (pkgs.runCommand "retiolum-etc-hosts"
- { }
- ''
- generate() {
- (cd ${tinc-hosts}
- printf \'\'
- for i in `ls`; do
- names=$(hostnames $i)
- for j in `sed -En 's|^ *Aliases *= *(.+)|\1|p' $i`; do
- names="$names $(hostnames $j)"
- done
- sed -En '
- s|^ *Subnet *= *([^ /]*)(/[0-9]*)? *$|\1 '"$names"'|p
- ' $i
- done | sort
- printf \'\'
- )
- }
-
- case ${cfg.generateEtcHosts} in
- short)
- hostnames() { echo "$1"; }
- generate
- ;;
- long)
- hostnames() { echo "$1.${cfg.netname}"; }
- generate
- ;;
- both)
- hostnames() { echo "$1.${cfg.netname} $1"; }
- generate
- ;;
- *)
- echo '""'
- ;;
- esac > $out
- '');
-
-
confDir = pkgs.runCommand "retiolum" {
# TODO text
executable = true;