mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2024-11-28 06:51:28 +00:00
nixos: remove enableSwagger and b2Bucket options
This commit is contained in:
parent
2bdb73d348
commit
08e04ee601
|
@ -14,12 +14,8 @@
|
|||
in
|
||||
{
|
||||
packages.${system}.default = selfprivacy-graphql-api;
|
||||
nixosModules.default = {
|
||||
imports = [
|
||||
(import ./nixos/module.nix self.packages.${system}.default)
|
||||
./nixos/config.nix
|
||||
];
|
||||
};
|
||||
nixosModules.default =
|
||||
import ./nixos/module.nix self.packages.${system}.default;
|
||||
devShells.${system}.default = pkgs.mkShell {
|
||||
packages =
|
||||
let
|
||||
|
|
|
@ -1,18 +0,0 @@
|
|||
{ config, ... }:
|
||||
{
|
||||
services.selfprivacy-api = {
|
||||
enable = true;
|
||||
enableSwagger = config.selfprivacy.api.enableSwagger;
|
||||
b2Bucket = config.selfprivacy.backup.bucket;
|
||||
};
|
||||
|
||||
users.users."selfprivacy-api" = {
|
||||
isNormalUser = false;
|
||||
isSystemUser = true;
|
||||
extraGroups = [ "opendkim" ];
|
||||
group = "selfprivacy-api";
|
||||
};
|
||||
users.groups."selfprivacy-api" = {
|
||||
members = [ "selfprivacy-api" ];
|
||||
};
|
||||
}
|
|
@ -12,29 +12,21 @@ in
|
|||
Enable SelfPrivacy API service
|
||||
'';
|
||||
};
|
||||
enableSwagger = lib.mkOption {
|
||||
default = false;
|
||||
type = lib.types.bool;
|
||||
description = ''
|
||||
Enable Swagger UI
|
||||
'';
|
||||
};
|
||||
b2Bucket = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
description = ''
|
||||
B2 bucket
|
||||
'';
|
||||
};
|
||||
};
|
||||
config = lib.mkIf cfg.enable {
|
||||
users.users."selfprivacy-api" = {
|
||||
isNormalUser = false;
|
||||
isSystemUser = true;
|
||||
extraGroups = [ "opendkim" ];
|
||||
group = "selfprivacy-api";
|
||||
};
|
||||
users.groups."selfprivacy-api".members = [ "selfprivacy-api" ];
|
||||
|
||||
systemd.services.selfprivacy-api = {
|
||||
description = "API Server used to control system from the mobile application";
|
||||
environment = config.nix.envVars // {
|
||||
HOME = "/root";
|
||||
PYTHONUNBUFFERED = "1";
|
||||
ENABLE_SWAGGER = (if cfg.enableSwagger then "1" else "0");
|
||||
B2_BUCKET = cfg.b2Bucket;
|
||||
} // config.networking.proxy.envVars;
|
||||
path = [
|
||||
"/var/"
|
||||
|
@ -66,8 +58,6 @@ in
|
|||
environment = config.nix.envVars // {
|
||||
HOME = "/root";
|
||||
PYTHONUNBUFFERED = "1";
|
||||
ENABLE_SWAGGER = (if cfg.enableSwagger then "1" else "0");
|
||||
B2_BUCKET = cfg.b2Bucket;
|
||||
PYTHONPATH =
|
||||
pkgs.python310Packages.makePythonPath [ selfprivacy-graphql-api ];
|
||||
} // config.networking.proxy.envVars;
|
||||
|
|
Loading…
Reference in a new issue