nixos/modules/services/passworts/default.nix
2025-02-26 20:27:58 +01:00

40 lines
840 B
Nix

# a password-generator using the marokov model
{ config, lib, ... }:
let
cfg = config.my.services.passworts;
inherit (config.networking) domain;
in
{
options.my.services.passworts = with lib; {
enable = mkEnableOption "Passwords Server";
port = mkOption {
type = types.port;
default = 5010;
example = 8080;
description = "Internal port for webui";
};
};
config = lib.mkIf cfg.enable {
services.passworts = {
enable = true;
inherit (cfg) port;
};
my.services.webserver.virtualHosts = [
{
subdomain = "passworts";
inherit (cfg) port;
}
];
webapps.apps.passworts = {
dashboard = {
name = "Passworts";
category = "other";
icon = "lock";
url = "https://passworts.${domain}";
};
};
};
}