···78787979- `services.prometheus.exporters` has a new exporter to monitor electrical power consumption based on PowercapRAPL sensor called [Scaphandre](https://github.com/hubblo-org/scaphandre), see [#239803](https://github.com/NixOS/nixpkgs/pull/239803) for more details.
80808181+- The module `services.calibre-server` has new options to configure the `host`, `port`, `auth.enable`, `auth.mode` and `auth.userDb` path, see [#216497](https://github.com/NixOS/nixpkgs/pull/216497/) for more details.
8282+8183## Nixpkgs internals {#sec-release-23.11-nixpkgs-internals}
82848385- The `qemu-vm.nix` module by default now identifies block devices via
+77-17
nixos/modules/services/misc/calibre-server.nix
···6677 cfg = config.services.calibre-server;
8899+ documentationLink = "https://manual.calibre-ebook.com";
1010+ generatedDocumentationLink = documentationLink + "/generated/en/calibre-server.html";
1111+1212+ execFlags = (concatStringsSep " "
1313+ (mapAttrsToList (k: v: "${k} ${toString v}") (filterAttrs (name: value: value != null) {
1414+ "--listen-on" = cfg.host;
1515+ "--port" = cfg.port;
1616+ "--auth-mode" = cfg.auth.mode;
1717+ "--userdb" = cfg.auth.userDb;
1818+ }) ++ [(optionalString (cfg.auth.enable == true) "--enable-auth")])
1919+ );
920in
10211122{
···1829 )
1930 ];
20312121- ###### interface
2222-2332 options = {
2433 services.calibre-server = {
25342635 enable = mkEnableOption (lib.mdDoc "calibre-server");
3636+ package = lib.mkPackageOptionMD pkgs "calibre" { };
27372838 libraries = mkOption {
3939+ type = types.listOf types.path;
4040+ default = [ "/var/lib/calibre-server" ];
2941 description = lib.mdDoc ''
4242+ Make sure each library path is initialized before service startup.
3043 The directories of the libraries to serve. They must be readable for the user under which the server runs.
4444+ See the [calibredb documentation](${documentationLink}/generated/en/calibredb.html#add) for details.
3145 '';
3232- type = types.listOf types.path;
3346 };
34473548 user = mkOption {
3636- description = lib.mdDoc "The user under which calibre-server runs.";
3749 type = types.str;
3850 default = "calibre-server";
5151+ description = lib.mdDoc "The user under which calibre-server runs.";
3952 };
40534154 group = mkOption {
4242- description = lib.mdDoc "The group under which calibre-server runs.";
4355 type = types.str;
4456 default = "calibre-server";
5757+ description = lib.mdDoc "The group under which calibre-server runs.";
4558 };
46594747- };
4848- };
6060+ host = mkOption {
6161+ type = types.str;
6262+ default = "0.0.0.0";
6363+ example = "::1";
6464+ description = lib.mdDoc ''
6565+ The interface on which to listen for connections.
6666+ See the [calibre-server documentation](${generatedDocumentationLink}#cmdoption-calibre-server-listen-on) for details.
6767+ '';
6868+ };
49697070+ port = mkOption {
7171+ default = 8080;
7272+ type = types.port;
7373+ description = lib.mdDoc ''
7474+ The port on which to listen for connections.
7575+ See the [calibre-server documentation](${generatedDocumentationLink}#cmdoption-calibre-server-port) for details.
7676+ '';
7777+ };
50785151- ###### implementation
7979+ auth = {
8080+ enable = mkOption {
8181+ type = types.bool;
8282+ default = false;
8383+ description = lib.mdDoc ''
8484+ Password based authentication to access the server.
8585+ See the [calibre-server documentation](${generatedDocumentationLink}#cmdoption-calibre-server-enable-auth) for details.
8686+ '';
8787+ };
8888+8989+ mode = mkOption {
9090+ type = types.enum [ "auto" "basic" "digest" ];
9191+ default = "auto";
9292+ description = lib.mdDoc ''
9393+ Choose the type of authentication used.
9494+ Set the HTTP authentication mode used by the server.
9595+ See the [calibre-server documentation](${generatedDocumentationLink}#cmdoption-calibre-server-auth-mode) for details.
9696+ '';
9797+ };
9898+9999+ userDb = mkOption {
100100+ default = null;
101101+ type = types.nullOr types.path;
102102+ description = lib.mdDoc ''
103103+ Choose users database file to use for authentication.
104104+ Make sure users database file is initialized before service startup.
105105+ See the [calibre-server documentation](${documentationLink}/server.html#managing-user-accounts-from-the-command-line-only) for details.
106106+ '';
107107+ };
108108+ };
109109+ };
110110+ };
5211153112 config = mkIf cfg.enable {
5411355114 systemd.services.calibre-server = {
5656- description = "Calibre Server";
5757- after = [ "network.target" ];
5858- wantedBy = [ "multi-user.target" ];
5959- serviceConfig = {
6060- User = cfg.user;
6161- Restart = "always";
6262- ExecStart = "${pkgs.calibre}/bin/calibre-server ${lib.concatStringsSep " " cfg.libraries}";
6363- };
115115+ description = "Calibre Server";
116116+ after = [ "network.target" ];
117117+ wantedBy = [ "multi-user.target" ];
118118+ serviceConfig = {
119119+ User = cfg.user;
120120+ Restart = "always";
121121+ ExecStart = "${cfg.package}/bin/calibre-server ${lib.concatStringsSep " " cfg.libraries} ${execFlags}";
122122+ };
641236565- };
124124+ };
6612567126 environment.systemPackages = [ pkgs.calibre ];
68127···8314284143 };
85144145145+ meta.maintainers = with lib.maintainers; [ gaelreyrol ];
86146}