- This installation method is still in testing.
- Only in the nixos-unstable channel for now
Installation
Imperative installation:
nix-env -iA audiobookshelf
Declarative installation:
environment.systemPackages = with pkgs; [
audiobookshelf
];
Configuration
You can configure Audiobookshelf using the parameters to the executable.
It supports the same configuration options you would pass to the Docker container,
the options below are the defaults if the option is missing.
audiobookshelf --metadata "$(pwd)/metadata" \
--config "$(pwd)/config" \
--port 8000 \
--host 0.0.0.0
If you use a reverse proxy (you should!) listing on localhost only would be enough.
In this case set --host 127.0.0.1
instead.
Start Audiobookshelf
You can create a simple systemd service in your configuration.nix
to automatically start
audiobookshelf after a reboot.
{
users = {
groups.audiobookshelf.members = [ "audiobookshelf" ];
users.audiobookshelf.isSystemUser = true;
};
systemd.services.audiobookshelf = with pkgs; {
enable = true;
description = "Self-hosted audiobook server for managing and playing audiobooks";
serviceConfig = {
Type = "simple";
WorkingDirectory = "/usr/share/audiobookshelf";
ExecStart = "${audiobookshelf}/bin/audiobookshelf --host 127.0.0.1 --port 8000"
ExecReload = "${util-linux}/bin/kill -HUP $MAINPID";
Restart = "always";
User = "audiobookshelf";
Group = "audiobookshelf";
};
wantedBy = [ "multi-user.target" ];
requires = [ "network.target" ];
};
}
You can create a simple SystemD service to automatically start audiobookshelf after a reboot.
Write a file audiobookshelf.service
to /etc/systemd/system/
with the following contents:
To run Audiobookshelf and ensure it will be started automatically after a reboot, run:
systemctl start audiobookshelf.service
systemctl enable audiobookshelf.service
To check the current status of the service, run:
systemctl status audiobookshelf.service