Merge remote-tracking branch 'cd/master'
This commit is contained in:
commit
524a009c1e
@ -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 {
|
iproutePackage = mkOption {
|
||||||
type = types.package;
|
type = types.package;
|
||||||
default = pkgs.iproute;
|
default = pkgs.iproute;
|
||||||
@ -130,18 +145,6 @@ let
|
|||||||
|
|
||||||
tinc = cfg.tincPackage;
|
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;
|
iproute = cfg.iproutePackage;
|
||||||
|
|
||||||
confDir = pkgs.runCommand "retiolum" {
|
confDir = pkgs.runCommand "retiolum" {
|
||||||
@ -153,7 +156,7 @@ let
|
|||||||
|
|
||||||
mkdir -p $out
|
mkdir -p $out
|
||||||
|
|
||||||
ln -s ${tinc-hosts} $out/hosts
|
ln -s ${cfg.hostsPackage} $out/hosts
|
||||||
|
|
||||||
cat > $out/tinc.conf <<EOF
|
cat > $out/tinc.conf <<EOF
|
||||||
Name = ${cfg.name}
|
Name = ${cfg.name}
|
||||||
|
Loading…
Reference in New Issue
Block a user