Skip to content

Instantly share code, notes, and snippets.

@maxsei
Last active January 25, 2026 02:06
Show Gist options
  • Select an option

  • Save maxsei/b742916bc989928313ee043b7d8587e2 to your computer and use it in GitHub Desktop.

Select an option

Save maxsei/b742916bc989928313ee043b7d8587e2 to your computer and use it in GitHub Desktop.
klib = nixidy.inputs.nix-kube-generators.lib { inherit pkgs; };
find-crds =
chart:
let
crd-filepath-file =
pkgs.runCommand "find-crds"
{
nativeBuildInputs = with pkgs; [
ripgrep
yq
];
}
''
touch $out
rg -g '**/*.yaml' -g '**/*.yml' 'kind: CustomResourceDefinition' -l ${chart} | while read file; do
realpath --relative-to=${chart} $file >> $out
done
'';
crd-filepath-file-contents = builtins.readFile crd-filepath-file;
crd-filepaths = pkgs.lib.splitString "\n" crd-filepath-file-contents;
in
builtins.filter (s: s != "") crd-filepaths;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment