Skip to content

nix-snapshotter 0.2.0

Compare
Choose a tag to compare
@elpdt852 elpdt852 released this 18 Feb 07:05
· 14 commits to main since this release

Welcome to the v0.2.0 release of nix-snapshotter!

Highlights

  • Provides NixOS & Home Manager modules for rootless Kubernetes (k3s) + nix-snapshotter
  • Separate nix run .#vm and nix run .#vm-rootless
  • Separate preload-container service into independent modules
  • Pin k3s to v1.27.9+k3s1 with patches to enable embedded nix-snapshotter

New options (NixOS & Home Manager)

  • Services preload-containerd & preload-containerd.rootless:

    config.services.preload-containerd = {
      enable = true;
      targets = [{
        archives = [ pkgs.nix-snapshotter.buildImage { /* ... */ } ];
        namespace = "k8s.io";
        address = "/run/k3s/containerd/containerd.sock";
      }];
    };
  • New options for k3s & new service k3s.rootless:

    config.services.k3s = {
      enable = true;
      # Sets the snapshotter for embedded containerd.
      snapshotter = "nix";
      # Sets KUBECONFIG env var to point to k3s.
      setKubeConfig = true;
      # Sets CONTAINERD_* env vars to point to k3s embedded containerd.
      setEmbeddedContainerd = true;
    }
  • New options for containerd & containerd.rootless:

    config.virtualisation.containerd = {
      enable = true;
      # Enable integration with nix-snapshotter.
      nixSnapshotterIntegration = true;
      # Set the CONTAINERD_* env vars, but also set automatically by
      # `nixSnapshotterIntegration` or by `services.k3s.setEmbeddedContainerd`.
      setAddress = "/run/containerd/containerd.sock";
      setNamespace = "default";
      setSnapshotter = "nix";
    }
  • New option only for NixOS module containerd:

    config.virtualisation.containerd = {
      enable = true;
      # Enable integration with k3s. This is mutually exclusive with setting
      # `services.k3s.snapshotter` and `services.k3s.setEmbeddedContainerd`.
      k3sIntegration = true;
    };

Migration guide v0.1.x -> v0.2.0

  • Removed options.services.nix-snapshotter.setContainerdSnapshotter

    # v0.1.x
    services.nix-snapshotter = {
      enable = true;
      setContainerdSnapshotter = true;
    };
    
    # v0.2.0 (same for rootless)
    virtualisation.containerd = {
      enable = true;
      nixSnapshotterIntegration = true;
    };
    services.nix-snapshotter = {
      enable = true;
    };
  • Removed options.services.nix-snapshotter.preloadContainerdImages

    # v0.1.x
    services.nix-snapshotter = {
      enable = true;
      preloadContainerdImages = [ pkgs.nix-snapshotter.buildImage { /* ... */ } ];
    };
    
    # v0.2.0 (same for rootless)
    virtualisation.containerd = {
      enable = true;
      nixSnapshotterIntegration = true;
    }
    services.nix-snapshotter = {
      enable = true;
    };
    services.preload-containerd = {
      targets = [{
        archives = [ pkgs.nix-snapshotter.buildImage { /* ... */ } ];
      }];
    };

Contributors

  • Edgar Lee

Dependency Changes

  • None