mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 13:41:26 +00:00
Merge pull request #10107 from ryantm/calibre-server
calibre-server service: init
This commit is contained in:
commit
581ae33e96
|
@ -234,6 +234,7 @@
|
|||
#lxd = 210; # unused
|
||||
kibana = 211;
|
||||
xtreemfs = 212;
|
||||
calibre-server = 213;
|
||||
|
||||
# When adding a uid, make sure it doesn't match an existing gid. And don't use uids above 399!
|
||||
|
||||
|
@ -446,6 +447,7 @@
|
|||
lxd = 210; # unused
|
||||
#kibana = 211;
|
||||
xtreemfs = 212;
|
||||
calibre-server = 213;
|
||||
|
||||
# When adding a gid, make sure it doesn't match an existing
|
||||
# uid. Users and groups with the same name should have equal
|
||||
|
|
|
@ -189,6 +189,7 @@
|
|||
./services/misc/apache-kafka.nix
|
||||
#./services/misc/autofs.nix
|
||||
./services/misc/canto-daemon.nix
|
||||
./services/misc/calibre-server.nix
|
||||
./services/misc/cpuminer-cryptonight.nix
|
||||
./services/misc/cgminer.nix
|
||||
./services/misc/confd.nix
|
||||
|
|
63
nixos/modules/services/misc/calibre-server.nix
Normal file
63
nixos/modules/services/misc/calibre-server.nix
Normal file
|
@ -0,0 +1,63 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
|
||||
cfg = config.services.calibre-server;
|
||||
|
||||
in
|
||||
|
||||
{
|
||||
|
||||
###### interface
|
||||
|
||||
options = {
|
||||
|
||||
services.calibre-server = {
|
||||
|
||||
enable = mkEnableOption "calibre-server";
|
||||
|
||||
libraryDir = mkOption {
|
||||
description = ''
|
||||
The directory where the Calibre library to serve is.
|
||||
'';
|
||||
type = types.path;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
|
||||
###### implementation
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
|
||||
systemd.services.calibre-server =
|
||||
{
|
||||
description = "Calibre Server";
|
||||
after = [ "network.target" ];
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
serviceConfig = {
|
||||
User = "calibre-server";
|
||||
Restart = "always";
|
||||
ExecStart = "${pkgs.calibre}/bin/calibre-server --with-library=${cfg.libraryDir}";
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
environment.systemPackages = [ pkgs.calibre ];
|
||||
|
||||
users.extraUsers.calibre-server = {
|
||||
uid = config.ids.uids.calibre-server;
|
||||
group = "calibre-server";
|
||||
};
|
||||
|
||||
users.extraGroups.calibre-server = {
|
||||
gid = config.ids.gids.calibre-server;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
}
|
Loading…
Reference in a new issue