mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2024-11-17 08:02:36 +00:00
nixos: remove enableSwagger and b2Bucket options
This commit is contained in:
parent
2bdb73d348
commit
08e04ee601
|
@ -14,12 +14,8 @@
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
packages.${system}.default = selfprivacy-graphql-api;
|
packages.${system}.default = selfprivacy-graphql-api;
|
||||||
nixosModules.default = {
|
nixosModules.default =
|
||||||
imports = [
|
import ./nixos/module.nix self.packages.${system}.default;
|
||||||
(import ./nixos/module.nix self.packages.${system}.default)
|
|
||||||
./nixos/config.nix
|
|
||||||
];
|
|
||||||
};
|
|
||||||
devShells.${system}.default = pkgs.mkShell {
|
devShells.${system}.default = pkgs.mkShell {
|
||||||
packages =
|
packages =
|
||||||
let
|
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
|
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 {
|
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 = {
|
systemd.services.selfprivacy-api = {
|
||||||
description = "API Server used to control system from the mobile application";
|
description = "API Server used to control system from the mobile application";
|
||||||
environment = config.nix.envVars // {
|
environment = config.nix.envVars // {
|
||||||
HOME = "/root";
|
HOME = "/root";
|
||||||
PYTHONUNBUFFERED = "1";
|
PYTHONUNBUFFERED = "1";
|
||||||
ENABLE_SWAGGER = (if cfg.enableSwagger then "1" else "0");
|
|
||||||
B2_BUCKET = cfg.b2Bucket;
|
|
||||||
} // config.networking.proxy.envVars;
|
} // config.networking.proxy.envVars;
|
||||||
path = [
|
path = [
|
||||||
"/var/"
|
"/var/"
|
||||||
|
@ -66,8 +58,6 @@ in
|
||||||
environment = config.nix.envVars // {
|
environment = config.nix.envVars // {
|
||||||
HOME = "/root";
|
HOME = "/root";
|
||||||
PYTHONUNBUFFERED = "1";
|
PYTHONUNBUFFERED = "1";
|
||||||
ENABLE_SWAGGER = (if cfg.enableSwagger then "1" else "0");
|
|
||||||
B2_BUCKET = cfg.b2Bucket;
|
|
||||||
PYTHONPATH =
|
PYTHONPATH =
|
||||||
pkgs.python310Packages.makePythonPath [ selfprivacy-graphql-api ];
|
pkgs.python310Packages.makePythonPath [ selfprivacy-graphql-api ];
|
||||||
} // config.networking.proxy.envVars;
|
} // config.networking.proxy.envVars;
|
||||||
|
|
Loading…
Reference in a new issue