{ config, pkgs, lib, ... }: with builtins // lib; let cfg = config.build.koboroot; in { options.build = { koboroot = { unpacked-payload = mkOption { type = types.path; internal = true; readOnly = true; default = config.koboroot.finalPackage; }; payload = mkOption { type = types.path; internal = true; readOnly = true; default = pkgs.runCommandLocal "koboroot-payload" {} '' mkdir $out tar czvf $out/KoboRoot.tgz --directory="${cfg.unpacked-payload}" . --mode=u+w ''; }; deploy = mkOption { internal = true; readOnly = true; type = types.package; default = pkgs.kobo-deploy cfg.payload; }; }; }; }