{ lib, ... }: with lib; { config.outputKinds = [ ( { hasSystem, ... }: optionalAttrs (!hasSystem) { options = { templates = mkOption { type = with types; attrsOf (submodule { options = { path = mkOption { type = path; description = "Path to the template directory"; }; description = mkOption { type = str; default = ""; }; }; }); description = "Used by `nix flake init -t #`"; }; }; outputs = { config, ... }: { templates = config.templates; }; } ) ]; }