Unverified Commit e2ed640e authored by github-actions[bot]'s avatar github-actions[bot] Committed by GitHub
Browse files

Merge staging-next into staging

parents 4e284638 6b41a98c
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -895,6 +895,12 @@
    githubId = 160476;
    name = "Amanjeev Sethi";
  };
  amanse = {
    email = "amansetiarjp@gmail.com";
    github = "amanse";
    githubId = 13214574;
    name = "Aman Setia";
  };
  amar1729 = {
    email = "amar.paul16@gmail.com";
    github = "Amar1729";
@@ -18593,6 +18599,12 @@
    githubId = 7121530;
    name = "Wolf Honoré";
  };
  wietsedv = {
    email = "wietsedv@proton.me";
    github = "wietsedv";
    githubId = 13139101;
    name = "Wietse de Vries";
  };
  wigust = {
    name = "Oleg Pykhalov";
    email = "go.wigust@gmail.com";
+2 −0
Original line number Diff line number Diff line
@@ -91,6 +91,8 @@

- [tuxedo-rs](https://github.com/AaronErhardt/tuxedo-rs), Rust utilities for interacting with hardware from TUXEDO Computers.

- [audiobookshelf](https://github.com/advplyr/audiobookshelf/), a self-hosted audiobook and podcast server. Available as [services.audiobookshelf](#opt-services.audiobookshelf.enable).

## Backward Incompatibilities {#sec-release-23.11-incompatibilities}

- The `boot.loader.raspberryPi` options have been marked deprecated, with intent for removal for NixOS 24.11. They had a limited use-case, and do not work like people expect. They required either very old installs ([before mid-2019](https://github.com/NixOS/nixpkgs/pull/62462)) or customized builds out of scope of the standard and generic AArch64 support. That option set never supported the Raspberry Pi 4 family of devices.
+1 −0
Original line number Diff line number Diff line
@@ -1211,6 +1211,7 @@
  ./services/web-apps/atlassian/confluence.nix
  ./services/web-apps/atlassian/crowd.nix
  ./services/web-apps/atlassian/jira.nix
  ./services/web-apps/audiobookshelf.nix
  ./services/web-apps/bookstack.nix
  ./services/web-apps/calibre-web.nix
  ./services/web-apps/coder.nix
+90 −0
Original line number Diff line number Diff line
{ config, lib, pkgs, ... }:

with lib;

let
  cfg = config.services.audiobookshelf;
in
{
  options = {
    services.audiobookshelf = {
      enable = mkEnableOption "Audiobookshelf, self-hosted audiobook and podcast server.";

      package = mkPackageOption pkgs "audiobookshelf" { };

      dataDir = mkOption {
        description = "Path to Audiobookshelf config and metadata inside of /var/lib.";
        default = "audiobookshelf";
        type = types.str;
      };

      host = mkOption {
        description = "The host Audiobookshelf binds to.";
        default = "127.0.0.1";
        example = "0.0.0.0";
        type = types.str;
      };

      port = mkOption {
        description = "The TCP port Audiobookshelf will listen on.";
        default = 8000;
        type = types.port;
      };

      user = mkOption {
        description = "User account under which Audiobookshelf runs.";
        default = "audiobookshelf";
        type = types.str;
      };

      group = mkOption {
        description = "Group under which Audiobookshelf runs.";
        default = "audiobookshelf";
        type = types.str;
      };

      openFirewall = mkOption {
        description = "Open ports in the firewall for the Audiobookshelf web interface.";
        default = false;
        type = types.bool;
      };
    };
  };

  config = mkIf cfg.enable {
    systemd.services.audiobookshelf = {
      description = "Audiobookshelf is a self-hosted audiobook and podcast server";

      after = [ "network.target" ];
      wantedBy = [ "multi-user.target" ];

      serviceConfig = {
        Type = "simple";
        User = cfg.user;
        Group = cfg.group;
        StateDirectory = cfg.dataDir;
        WorkingDirectory = "/var/lib/${cfg.dataDir}";
        ExecStart = "${cfg.package}/bin/audiobookshelf --host ${cfg.host} --port ${toString cfg.port}";
        Restart = "on-failure";
      };
    };

    users.users = mkIf (cfg.user == "audiobookshelf") {
      audiobookshelf = {
        isSystemUser = true;
        group = cfg.group;
        home = "/var/lib/${cfg.dataDir}";
      };
    };

    users.groups = mkIf (cfg.group == "audiobookshelf") {
      audiobookshelf = { };
    };

    networking.firewall = mkIf cfg.openFirewall {
      allowedTCPPorts = [ cfg.port ];
    };
  };

  meta.maintainers = with maintainers; [ wietsedv ];
}
+18 −11
Original line number Diff line number Diff line
@@ -517,7 +517,10 @@ let
        (assertValueOneOf "Unmanaged" boolValues)
        (assertInt "Group")
        (assertRange "Group" 0 2147483647)
        (assertValueOneOf "RequiredForOnline" (boolValues ++ [
        (assertValueOneOf "RequiredForOnline" (boolValues ++ (
          let
            # https://freedesktop.org/software/systemd/man/networkctl.html#missing
            operationalStates = [
              "missing"
              "off"
              "no-carrier"
@@ -527,7 +530,11 @@ let
              "degraded"
              "enslaved"
              "routable"
        ]))
            ];
            operationalStateRanges = concatLists (imap0 (i: min: map (max: "${min}:${max}") (drop i operationalStates)) operationalStates);
          in
          operationalStates ++ operationalStateRanges
        )))
        (assertValueOneOf "RequiredFamilyForOnline" [
          "ipv4"
          "ipv6"
Loading