-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
192 changed files
with
3,481 additions
and
2,765 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -895,6 +895,12 @@ | |
githubId = 160476; | ||
name = "Amanjeev Sethi"; | ||
}; | ||
amanse = { | ||
email = "[email protected]"; | ||
github = "amanse"; | ||
githubId = 13214574; | ||
name = "Aman Setia"; | ||
}; | ||
amar1729 = { | ||
email = "[email protected]"; | ||
github = "Amar1729"; | ||
|
@@ -11591,6 +11597,13 @@ | |
githubId = 1001112; | ||
name = "Marcin Janczyk"; | ||
}; | ||
mjm = { | ||
email = "[email protected]"; | ||
github = "mjm"; | ||
githubId = 1181; | ||
matrix = "@mjm:beeper.com"; | ||
name = "Matt Moriarity"; | ||
}; | ||
mjp = { | ||
email = "[email protected]"; | ||
github = "MikePlayle"; | ||
|
@@ -12091,6 +12104,11 @@ | |
githubId = 59313755; | ||
name = "Maxim Karasev"; | ||
}; | ||
mxmlnkn = { | ||
github = "mxmlnkn"; | ||
githubId = 6842824; | ||
name = "Maximilian Knespel"; | ||
}; | ||
myaats = { | ||
email = "[email protected]"; | ||
github = "Myaats"; | ||
|
@@ -15283,6 +15301,12 @@ | |
githubId = 171470; | ||
name = "Sam Hug"; | ||
}; | ||
SamirTalwar = { | ||
email = "[email protected]"; | ||
github = "SamirTalwar"; | ||
githubId = 47852; | ||
name = "Samir Talwar"; | ||
}; | ||
samlich = { | ||
email = "[email protected]"; | ||
github = "samlich"; | ||
|
@@ -18575,6 +18599,12 @@ | |
githubId = 7121530; | ||
name = "Wolf Honoré"; | ||
}; | ||
wietsedv = { | ||
email = "[email protected]"; | ||
github = "wietsedv"; | ||
githubId = 13139101; | ||
name = "Wietse de Vries"; | ||
}; | ||
wigust = { | ||
name = "Oleg Pykhalov"; | ||
email = "[email protected]"; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,8 +42,7 @@ let | |
]; | ||
|
||
defaultPackageNames = | ||
[ "nano" | ||
"perl" | ||
[ "perl" | ||
"rsync" | ||
"strace" | ||
]; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
{ 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 ]; | ||
} |
Oops, something went wrong.