mirror of
https://github.com/nmasur/dotfiles
synced 2024-12-25 06:34:52 +00:00
setup calibre server
This commit is contained in:
parent
034ff33e70
commit
db0645075f
@ -21,5 +21,6 @@ nixpkgs.lib.nixosSystem {
|
||||
../../modules/nixos
|
||||
../../modules/hardware/server.nix
|
||||
../../modules/services/sshd.nix
|
||||
../../modules/services/calibre.nix
|
||||
];
|
||||
}
|
||||
|
41
modules/services/calibre.nix
Normal file
41
modules/services/calibre.nix
Normal file
@ -0,0 +1,41 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
|
||||
let
|
||||
|
||||
libraryPath = "${config.homePath}/media/books";
|
||||
|
||||
in {
|
||||
|
||||
options = { };
|
||||
|
||||
config = {
|
||||
services.calibre-server = {
|
||||
enable = true;
|
||||
libraries = [ libraryPath ];
|
||||
};
|
||||
|
||||
services.calibre-web = {
|
||||
enable = true;
|
||||
openFirewall = true;
|
||||
options = {
|
||||
reverseProxyAuth.enable = false;
|
||||
enableBookConversion = true;
|
||||
};
|
||||
};
|
||||
|
||||
home-manager.users.${config.user}.home.activation = {
|
||||
|
||||
# Always create library directory if it doesn't exist
|
||||
calibreLibrary =
|
||||
config.home-manager.users.${config.user}.lib.dag.entryAfter
|
||||
[ "writeBoundary" ] ''
|
||||
if [ ! -d "${libraryPath}" ]; then
|
||||
$DRY_RUN_CMD mkdir --parents $VERBOSE_ARG ${libraryPath}
|
||||
fi
|
||||
'';
|
||||
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user