Implement support for pushing manifests to cache
This is very conveninent in combination with nix-csi
This commit is contained in:
parent
635bd0cfbb
commit
8bddef6e01
1 changed files with 15 additions and 1 deletions
16
kluctl.nix
16
kluctl.nix
|
|
@ -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 \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue