tinc: use pkgs.write for default hostsPackage

This commit is contained in:
tv 2023-01-19 15:23:03 +01:00
parent ba010c3ef6
commit be9e03264d

View File

@ -125,17 +125,13 @@ with import <stockholm/lib>;
hostsPackage = mkOption { hostsPackage = mkOption {
type = types.package; type = types.package;
default = pkgs.stdenv.mkDerivation { default =
name = "${tinc.config.netname}-tinc-hosts"; pkgs.write "${tinc.config.netname}-tinc-hosts"
phases = [ "installPhase" ]; (mapAttrs'
installPhase = '' (_: host: (nameValuePair "/${host.name}" {
mkdir $out text = host.nets.${tinc.config.netname}.tinc.config;
${concatStrings (mapAttrsToList (_: host: '' }))
echo ${shell.escape host.nets."${tinc.config.netname}".tinc.config} \ tinc.config.hosts);
> $out/${shell.escape host.name}
'') tinc.config.hosts)}
'';
};
defaultText = "netname-tinc-hosts"; defaultText = "netname-tinc-hosts";
description = '' description = ''
Package of tinc host configuration files. By default, a package will Package of tinc host configuration files. By default, a package will