nur-packages

My NUR packages
git clone git://git.sikmir.ru/nur-packages
Log | Files | Refs | README | LICENSE

commit d8a88d749b7c16c8d145ae3bfa5ee9705ecf7001
parent 68bd3c852c54501e1626ebe1e959e2c237f7a909
Author: Nikolay Korotkiy <sikmir@disroot.org>
Date:   Wed, 15 Jun 2022 01:28:25 +0300

Add mbtileserver module

Diffstat:
Mmodules/default.nix | 1+
Amodules/services/mbtileserver.nix | 27+++++++++++++++++++++++++++
2 files changed, 28 insertions(+), 0 deletions(-)

diff --git a/modules/default.nix b/modules/default.nix @@ -1,4 +1,5 @@ { + mbtileserver = ./services/mbtileserver.nix; home-manager = { programs = { diff --git a/modules/services/mbtileserver.nix b/modules/services/mbtileserver.nix @@ -0,0 +1,27 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let + cfg = config.services.mbtileserver; +in +{ + options.services.mbtileserver = { + enable = mkEnableOption "mbtileserver"; + }; + + config = mkIf cfg.enable { + systemd.services.mbtileserver = { + description = "MBTiles server"; + after = [ "network.target" ]; + wantedBy = [ "multi-user.target" ]; + environment.TILE_DIR = "/srv/tilesets"; + serviceConfig = { + DynamicUser = true; + LogsDirectory = "mbtileserver"; + ExecStart = "${pkgs.mbtileserver}/bin/mbtileserver --enable-reload-signal --tiles-only"; + Restart = "always"; + }; + }; + }; +}