verwaltungstracker/module.nix
2026-03-24 16:32:25 +01:00

64 lines
1.6 KiB
Nix

{
config,
lib,
pkgs,
options,
...
}:
let
cfg = config.services.verwaltungstracker;
verwaltungstracker = pkgs.froide-govplan.overridePythonAttrs (oldAttrs: {
src = pkgs.fetchFromGitea {
domain = "git.project-insanity.org";
owner = "onny";
repo = "verwaltungstracker";
rev = "fa82bf579a4a17460f6489843f2d8e2cf8b4f7c8";
hash = "sha256-5vE8pLSAezULKb+B8OF4C/8r4C8b1aFNvbkRZ7+ZCXM=";
};
dependencies = oldAttrs.dependencies ++ [ oldAttrs.passthru.python.pkgs.mastodon-py ];
passthru = oldAttrs.passthru // {
pythonPath = "${pkgs.python3.pkgs.makePythonPath [pkgs.python3.pkgs.mastodon-py]}:${oldAttrs.passthru.pythonPath}";
};
});
in
{
options = {
services.verwaltungstracker = {
enable = lib.mkEnableOption "Verwaltungstracker web app";
credentials = lib.mkOption {
type = lib.types.attrsOf lib.types.str;
default = { };
example = {
MASTODON_API_KEY = "/run/secrets/mastodon_api_key";
};
description = ''
Credentials to pass to the Verwaltungstracker service.
Maps environment variable names to file paths containing the secret values.
These are loaded via systemd's LoadCredential mechanism.
The Python app will automatically read the value from the file.
'';
};
} // options.services.froide-govplan.settings;
};
config = lib.mkIf cfg.enable {
services.froide-govplan = {
enable = true;
package = verwaltungstracker;
settings = cfg.settings;
};
};
meta = {
maintainers = with lib.maintainers; [ onny ];
};
}