From 0bde01ddff0842122d17f886d7690c1dc9fc500a Mon Sep 17 00:00:00 2001 From: lassulus Date: Thu, 31 Aug 2017 19:01:53 +0200 Subject: ci: replace users by hosts --- krebs/3modules/ci.nix | 50 +++++++++----------------------------------------- 1 file changed, 9 insertions(+), 41 deletions(-) (limited to 'krebs/3modules/ci.nix') diff --git a/krebs/3modules/ci.nix b/krebs/3modules/ci.nix index b55827e3..dab87792 100644 --- a/krebs/3modules/ci.nix +++ b/krebs/3modules/ci.nix @@ -17,30 +17,12 @@ in default = 10; description = "how long to wait until we test changes (in minutes)"; }; - users = mkOption { - type = with types; attrsOf (submodule { - options = { - all = mkOption { - type = bool; - default = false; - }; - hosts = mkOption { - type = listOf str; - default = []; - }; - }; - }); - example = { - lass.all = true; - krebs = { - all = true; - hosts = [ - "test-all-krebs-modules" - "test-arch" - ]; - }; - }; - default = {}; + hosts = mkOption { + type = types.listOf types.host; + default = []; + description = '' + List of hosts that should be build + ''; }; }; @@ -132,23 +114,9 @@ in timeout=90001 ) - ${let - user-hosts = mapAttrs (user: a: let - managed-hosts = attrNames (filterAttrs (_: h: (h.owner.name == user) && h.managed) config.krebs.hosts); - defined-hosts = a.hosts; - in - defined-hosts ++ (optionals a.all managed-hosts) - ) cfg.users; - - in - concatStringsSep "\n" ( - (mapAttrsToList (user: hosts: - concatMapStringsSep "\n" (host: - "build_host(\"${user}\", \"${host}\")" - ) hosts - ) user-hosts) - ) - } + ${concatMapStringsSep "\n" (host: + "build_host(\"${host.owner.name}\", \"${host.name}\")" + ) cfg.hosts} bu.append( util.BuilderConfig( -- cgit v1.2.3