Implement support for pushing manifests to cache

This is very conveninent in combination with nix-csi
This commit is contained in:
Carl Andersson 2025-10-23 15:50:33 +02:00
commit 8bddef6e01

View file

@ -14,9 +14,20 @@ in
package = lib.mkPackageOption pkgs "kluctl" { };
discriminator = lib.mkOption {
type = lib.types.str;
description = "kluctl deployment label discriminator, AKA K8s label conformant project name";
description = ''
kluctl deployment label discriminator. RFC1123 compliant string
This is used to prune resources that are no longer generated so make
sure to change this between projects
'';
default = "easykubenix";
};
pushManifest = {
enable = lib.mkEnableOption "pushing manifest to bianry cache";
to = lib.mkOption {
type = lib.types.str;
description = "nix store url";
};
};
project = lib.mkOption {
type = settingsFormat.type;
description = "Anything to be rendered into .kluctl.yaml";
@ -148,6 +159,9 @@ in
pkgs.writeScriptBin "kubenixDeploy" # fish
''
#! ${lib.getExe pkgs.fishMinimal}
${lib.optionalString cfg.pushManifest.enable ''
nix copy --to ${cfg.pushManifest.to} ${config.internal.manifestJSONFile}
''}
set command ${lib.getExe cfg.package} deploy \
--no-update-check \
--target local \