1{2 lib,3 fleetLib,4 config,5 ...6}:7let8 inherit (lib.options) mkOption mkEnableOption literalExpression;9 inherit (lib.types)10 enum11 str12 bool13 submodule14 ;15 inherit (fleetLib.options) mkHostsOption;1617 _file = ./cache.nix;1819 cacheOptions = {20 enable = mkEnableOption "fleet binary cache";21 kind = mkOption {22 description = ''23 Kind of the binary cache to use.24 '';25 type = enum [ "attic" ];26 default = "attic";27 };28 name = mkOption {29 description = ''30 Name of the binary cache.31 '';32 type = str;33 };34 pin = mkOption {35 description = ''36 Whether to pin pushed paths in the attic cache, preventing them from37 being garbage collected.3839 Requires compatible fork of attic server+client: https://github.com/zhaofengli/attic/pull/227#issuecomment-475915479640 '';41 type = bool;42 default = false;43 };44 };45in46{47 options = {48 cache = cacheOptions;49 hosts = mkHostsOption {50 inherit _file;51 options.cache = mkOption {52 description = ''53 Binary cache configuration for this host.54 '';55 type = submodule { options = cacheOptions; };56 default = config.cache;57 defaultText = literalExpression "fleetConfiguration.cache";58 };59 };60 };61}