tinc module: workaround nixpkgs's lib.types.types

Introduced by nixpkgs 152c63c9ff82276e225ac4a4fa71c791d33e443d
This commit is contained in:
tv 2017-10-03 18:40:44 +02:00 committed by lassulus
parent c37c047ee6
commit 902a65304d

View File

@ -1,7 +1,6 @@
{ config, pkgs, lib, ... }:
with import <stockholm/lib>; with import <stockholm/lib>;
{ config, pkgs, ... }:
let let
inherit (import <stockholm/lib>) types;
out = { out = {
options.krebs.tinc = api; options.krebs.tinc = api;
config = imp; config = imp;
@ -12,7 +11,7 @@ let
description = '' description = ''
define a tinc network define a tinc network
''; '';
type = with types; attrsOf (submodule (tinc: { type = types.attrsOf (types.submodule (tinc: {
options = let options = let
netname = tinc.config._module.args.name; netname = tinc.config._module.args.name;
in { in {
@ -117,7 +116,7 @@ let
phases = [ "installPhase" ]; phases = [ "installPhase" ];
installPhase = '' installPhase = ''
mkdir $out mkdir $out
${concatStrings (lib.mapAttrsToList (_: host: '' ${concatStrings (mapAttrsToList (_: host: ''
echo ${shell.escape host.nets."${tinc.config.netname}".tinc.config} \ echo ${shell.escape host.nets."${tinc.config.netname}".tinc.config} \
> $out/${shell.escape host.name} > $out/${shell.escape host.name}
'') tinc.config.hosts)} '') tinc.config.hosts)}