aboutsummaryrefslogtreecommitdiff
path: root/services/lazylibrarian/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'services/lazylibrarian/default.nix')
-rw-r--r--services/lazylibrarian/default.nix32
1 files changed, 32 insertions, 0 deletions
diff --git a/services/lazylibrarian/default.nix b/services/lazylibrarian/default.nix
new file mode 100644
index 0000000..4514713
--- /dev/null
+++ b/services/lazylibrarian/default.nix
@@ -0,0 +1,32 @@
+{ config, pkgs, lib, ... }:
+with lib;
+let
+ lazylibrarian = pkgs.callPackage ./package.nix {};
+ cfg = config.services.lazylibrarian;
+in
+{
+ options.services.lazylibrarian = {
+ enable = mkEnableOption "lazy librarian";
+ # port = mkOption { type = types.int; default = 53; };
+ # hosts = mkOption { type = types.attrsOf types.str; default = {}; };
+ };
+
+ environment.systemPackages = [lazylibrarian];
+
+ config.systemd.services.lazylibrarian = mkIf cfg.enable {
+ description = "Lazylibrarian";
+ after = [ "network.service" ];
+ wantedBy = [ "multi-user.target" ];
+
+ serviceConfig = {
+ ExecStart = "${lazylibrarian}/bin/lazylibrarian";
+ Restart = "on-failure";
+ RestartSec = 3;
+ TimeoutSec = "5min";
+ IgnoreSIGPIPE = "no";
+ KillMode = "process";
+ GuessMainPID = "no";
+ RemainAfterExit = "yes";
+ };
+ };
+}