nixos: remove enableSwagger and b2Bucket options

This commit is contained in:
Alexander Tomokhov 2023-12-16 09:36:31 +04:00
parent 2bdb73d348
commit 08e04ee601
3 changed files with 9 additions and 41 deletions

View file

@ -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

View file

@ -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" ];
};
}

View file

@ -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;