nixpkgs/nixos/modules/services/web-apps/pict-rs.nix
pennae 0a6e6cf7e6 nixos/manual: render module chapters with nixos-render-docs
this converts meta.doc into an md pointer, not an xml pointer. since we
no longer need xml for manual chapters we can also remove support for
manual chapters from md-to-db.sh

since pandoc converts smart quotes to docbook quote elements and our
nixos-render-docs does not we lose this distinction in the rendered
output. that's probably not that bad, our stylesheet didn't make use of
this anyway (and pre-23.05 versions of the chapters didn't use quote
elements either).

also updates the nixpkgs manual to clarify that option docs support all
extensions (although it doesn't support headings at all, so heading
anchors don't work by extension).
2023-01-27 20:07:34 +01:00

49 lines
1.2 KiB
Nix

{ lib, pkgs, config, ... }:
with lib;
let
cfg = config.services.pict-rs;
in
{
meta.maintainers = with maintainers; [ happysalada ];
meta.doc = ./pict-rs.md;
options.services.pict-rs = {
enable = mkEnableOption (lib.mdDoc "pict-rs server");
dataDir = mkOption {
type = types.path;
default = "/var/lib/pict-rs";
description = lib.mdDoc ''
The directory where to store the uploaded images.
'';
};
address = mkOption {
type = types.str;
default = "127.0.0.1";
description = lib.mdDoc ''
The IPv4 address to deploy the service to.
'';
};
port = mkOption {
type = types.port;
default = 8080;
description = lib.mdDoc ''
The port which to bind the service to.
'';
};
};
config = lib.mkIf cfg.enable {
systemd.services.pict-rs = {
environment = {
PICTRS_PATH = cfg.dataDir;
PICTRS_ADDR = "${cfg.address}:${toString cfg.port}";
};
wantedBy = [ "multi-user.target" ];
serviceConfig = {
DynamicUser = true;
StateDirectory = "pict-rs";
ExecStart = "${pkgs.pict-rs}/bin/pict-rs";
};
};
};
}