Add Swagger to API package

This commit is contained in:
Inex Code
2021-11-16 17:08:58 +03:00
parent b4bc3a4ffc
commit 8b5865c332
5 changed files with 22 additions and 3 deletions

View File

@@ -25,6 +25,13 @@ in
SelfPrivacy API token
'';
};
enableSwagger = mkOption {
default = false;
type = types.bool;
description = ''
Enable Swagger UI
'';
};
};
config = lib.mkIf cfg.enable {
@@ -35,6 +42,7 @@ in
HOME = "/root";
PYTHONUNBUFFERED = "1";
AUTH_TOKEN = cfg.token;
ENABLE_SWAGGER = (if cfg.enableSwagger then "1" else "0");
} // config.networking.proxy.envVars;
path = [ "/var/" "/var/dkim/" pkgs.coreutils pkgs.gnutar pkgs.xz.bin pkgs.gzip pkgs.gitMinimal config.nix.package.out pkgs.nixos-rebuild pkgs.restic pkgs.mkpasswd ];
after = [ "network-online.target" ];