Skip to content

feat. request: system module #3

Description

@stealingudc

Title.

While a system module does indeed exist, I assume it's being wrapped in flake.nix to avoid the infinite recursion of pulling from kubix.result.
A workaround, that, albeit a bit ugly, works well for my projects:

# kubix.nix
{
  config,
  pkgs,
  lib,
  kubix,
  ...
}: let
  builtManifests = kubix.lib.buildManifests pkgs.system {inherit (config) manifests;};
in {
  imports = [
    # <path/to/some-manifest-declaration.nix>
  ];
  options.manifests = lib.mkOption {
    type = lib.types.attrs;
    default = {};
  };
  # ..do whatever with ${builtManifests}
}
# some-manifest-declaration.nix
{
  manifests.myManifest = {
    # declare your k8s manifest here
  };
}

The usefulness of being able to rebuild (and subsequently reapply) manifests at nixos-rebuild switch-time is... dubious at best, since k8s itself is so incredibly runtime-dependent, but it may be worth it in certain situations.

Really hope to see this implemented!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions