Skip to content

sablier ​

Stop unused services and start them on demand

NOTE

When Sablier is enabled, it will configure Traefik to use the file provider instead of the default docker provider. This is required because Quadlet removes containers when they are stopped, so Traefik can no longer discover them through the docker provider.

Example ​

nix
{
  nps.stacks.sablier = {
    enable = true;
    settings = {
      sessions.default-duration = "10m";
    };
  };
}

Stack Options ​

nps.stacks.sablier.defaultStrategy ​

The default strategy that the sablier middlewares will use.

For details see

Type
plaintext
one of "dynamic", "blocking"
Default
nix
"dynamic"
Declaration

nps.stacks.sablier.enable ​

Whether to enable sablier.

Type
plaintext
boolean
Default
nix
false
Example
nix
true
Declaration

nps.stacks.sablier.settings ​

Configuration settings for Sablier.

For details see https://sablierapp.dev/tutorials/configuration/#configuration-file.

Type
plaintext
YAML 1.1 value
Default
nix
null
Declaration

Container Extension ​

Sablier adds the sablier container option to the existing services.podman.containers.<name> options. Enabling it for a container opts it into on-demand scaling and applies the matching Sablier middleware in Traefik.

By default a container gets assigned to a group named after its stack (config.stack). Containers in the same group are started together. You can set a custom group to group containers from different stacks.

Example:

nix
{
  nps.stacks.sablier.enable = true;

  nps.stacks.streaming.containers.jellyfin.sablier = {
    enable = true;
    # Optional: group containers across stacks, defaults to the container's stack name
    # group = "media";
  };
}

Additional Sablier settings (e.g. idleReplicas) are forwarded as X-Sablier labels on the systemd unit. For details see https://sablierapp.dev/reference/labels/

Options for the generated Traefik middleware can be set through the middleware option. Since all containers of a group share one middleware, their settings are merged.

nix
{
  nps.stacks.streaming.containers.jellyfin.sablier = {
    enable = true;
    middleware = {
      sessionDuration = "45m";
      failOpen = true;
      ignoreUserAgent = ["curl" "(?i)uptimerobot"];
      dynamic.displayName = "Media Server";
    };
  };
}

For all available options see https://plugins.traefik.io/plugins/69104ac3b7d4dd76110a1a09/sablier

services.podman.containers.<name>.sablier ​

Sablier labels for the container. Must use the systemd style label names. The labels will be provided in the [X-Sablier] section of the unit file for the container.

Type
plaintext
open submodule of attribute set of string
Default
nix
{ }
Declaration

services.podman.containers.<name>.sablier.enable ​

Whether to enable Sablier integration.

Type
plaintext
boolean
Default
nix
false
Example
nix
true
Declaration

services.podman.containers.<name>.sablier.group ​

Group the container belongs to.

For details see https://sablierapp.dev/concepts/groups/

Type
plaintext
string
Default
nix
containerCfg.stack
Declaration

services.podman.containers.<name>.sablier.middleware ​

Options for the Traefik Sablier middleware of this container's group.

All containers of a group share one middleware. Their settings are merged: attribute sets recursively, lists as a union, other values with the last one winning.

For details see https://plugins.traefik.io/plugins/69104ac3b7d4dd76110a1a09/sablier

Type
plaintext
attribute set of (YAML 1.1 value)
Default
nix
{ }
Declaration

Container Aliases ​

nps.stacks.sablier.containers.sablier ​

Alias of {option}services.podman.containers.sablier.

Type
plaintext
submodule
Declaration