Skip to content

shelfmark ​

Unified web interface for searching and aggregating books and audiobook downloads

Example ​

nix
{config, ...}: {
  nps.stacks.shelfmark = {
    enable = true;
    downloadDirectory = "${config.nps.storageBaseDir}/grimmory/bookdrop";
    useProwlarr = true;
    useQbittorrent = true;

    extraEnv = {
      PROWLARR_API_KEY.fromFile = config.sops.secrets."prowlarr/api_key".path;
      QBITTORRENT_USERNAME = "admin";
      QBITTORRENT_PASSWORD.fromFile = config.sops.secrets."qbittorrent/password".path;
    };
  };
}

For a full list of environment variables, see the Shelfmark documentation.

Stack Options ​

nps.stacks.shelfmark.downloadDirectory ​

Final host directory where downloads will be placed. To automatically ingest books in other applications such as CWA or Booklore, set this to the respective app's import directory.

Type
plaintext
string
Default
nix
"${config.nps.storageBaseDir}/shelfmark/books"
Example
nix
"${config.nps.storageBaseDir}/grimmory/bookdrop"
Declaration

nps.stacks.shelfmark.enable ​

Whether to enable shelfmark.

Type
plaintext
boolean
Default
nix
false
Example
nix
true
Declaration

nps.stacks.shelfmark.extraEnv ​

Extra environment variables to set for the container. Variables can be either set directly or sourced from a file (e.g. for secrets).

See https://github.com/calibrain/shelfmark/blob/main/docs/environment-variables.md

Type
plaintext
attribute set of (null or boolean or signed integer or string or absolute path or (submodule))
Default
nix
{ }
Example
nix
{
  SOME_SECRET = {
    fromFile = "/run/secrets/secret_name";
  };
  SOME_VALUE = "some_value";
}
Declaration

nps.stacks.shelfmark.oidc.adminGroup ​

Users of this group will be assigned admin rights

Type
plaintext
string
Default
nix
"shelfmark_admin"
Declaration

nps.stacks.shelfmark.oidc.clientSecretFile ​

The file containing the client secret for the OIDC client that will be registered in Authelia.

For examples on how to generate a client secret, see

https://www.authelia.com/integration/openid-connect/frequently-asked-questions/#client-secret

Type
plaintext
absolute path
Example
nix
config.sops.secrets."immich/authelia/client_secret".path"
Declaration

nps.stacks.shelfmark.oidc.clientSecretHash ​

The client secret hash. For examples on how to generate a client secret, see https://www.authelia.com/integration/openid-connect/frequently-asked-questions/#client-secret

The value can be passed in multiple ways:

  1. As a literal string
  2. As an absolute path to a file containing the hash (toFile)
  3. As an absolute oath to a file containing the client_secret, in which case the hash will be automatically computed (toHash)
  4. As null

If left unset (null), the client secret will be read from the file specified in the clientSecretFile option and hashed automatically before being passed to the Authelia container.

Type
plaintext
null or string or (submodule)
Default
nix
null
Example
nix
# Literal String:
"$pbkdf2-sha512$310000$cbOAIWbfz3vCVXIPIp6d2A$J0klwULa6TvPRCU1HAfuKua/dMKTl8gbTYJz2N73ejGUu0LUGz/y3kwmJLuKuAYGg3WQOT0q9ZzVHHUvpKpgvQ"

# Client secret hash stored in a file
{ fromFile = config.sops.secrets."immich/client_secret_hash".path; }

# Client secret stored in a file: Hash will be computed dynamically
{ toHash = config.sops.secrets."immich/client_secret".path; }

# Null (default): Hash will be computed automatically based on the clientSecretFile option
# Equivalent to { toHash = cfg.oidc.clientSecretFile; }
null
Declaration

nps.stacks.shelfmark.oidc.enable ​

Whether to enable OIDC login with Authelia. This will register an OIDC client in Authelia and setup the necessary configuration.

For details, see:

Type
plaintext
boolean
Default
nix
false
Declaration

nps.stacks.shelfmark.oidc.userGroup ​

Users must be a part of this group to be able to log in.

Type
plaintext
string
Default
nix
"shelfmark_user"
Declaration

nps.stacks.shelfmark.useFlaresolverr ​

Whether to enable the Flaresolverr stack and connect it to the Shelfmark network. Shelfmark uses Flaresolverr to bypass Cloudflare protection.

Type
plaintext
boolean
Default
nix
true
Declaration

nps.stacks.shelfmark.useProwlarr ​

Whether to enable the Prowlarr stack and connect it to the Shelfmark network. Sets PROWLARR_ENABLED and PROWLARR_URL. You will likely also need to set PROWLARR_API_KEY via extraEnv (Settings > General > API Key).

Type
plaintext
boolean
Default
nix
false
Declaration

nps.stacks.shelfmark.useQbittorrent ​

Whether to enable the qBittorrent stack and connect it to the Shelfmark network. Sets PROWLARR_TORRENT_CLIENT, QBITTORRENT_URL, QBITTORRENT_CATEGORY and QBITTORRENT_CATEGORY_AUDIOBOOK. If authentication isn't bypassed in qBittorrent, you may need to set credentials via extraEnv (QBITTORRENT_USERNAME/QBITTORRENT_PASSWORD or QBITTORRENT_API_KEY).

Type
plaintext
boolean
Default
nix
false
Declaration

Container Aliases ​

nps.stacks.shelfmark.containers.shelfmark ​

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

Type
plaintext
submodule
Declaration