1{
2 config,
3 lib,
4 pkgs,
5 ...
6}:
7
8let
9 cfg = config.programs.ausweisapp;
10in
11{
12 options.programs.ausweisapp = {
13 enable = lib.mkEnableOption "AusweisApp";
14
15 openFirewall = lib.mkOption {
16 description = ''
17 Whether to open the required firewall ports for the Smartphone as Card Reader (SaC) functionality of AusweisApp.
18 '';
19 default = false;
20 type = lib.types.bool;
21 };
22 };
23
24 config = lib.mkIf cfg.enable {
25 environment.systemPackages = with pkgs; [ ausweisapp ];
26 networking.firewall.allowedUDPPorts = lib.optionals cfg.openFirewall [ 24727 ];
27 };
28}