mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-nixos-config.git
synced 2024-11-25 12:31:27 +00:00
Provide backup env vars to api
This commit is contained in:
parent
a2704e2717
commit
775d64dcb0
|
@ -32,6 +32,24 @@ in
|
||||||
Enable Swagger UI
|
Enable Swagger UI
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
b2AccountId = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
description = ''
|
||||||
|
B2 account ID
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
b2AccountKey = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
description = ''
|
||||||
|
B2 account key
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
resticPassword = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
description = ''
|
||||||
|
Restic password
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
|
|
||||||
|
@ -43,6 +61,9 @@ in
|
||||||
PYTHONUNBUFFERED = "1";
|
PYTHONUNBUFFERED = "1";
|
||||||
AUTH_TOKEN = cfg.token;
|
AUTH_TOKEN = cfg.token;
|
||||||
ENABLE_SWAGGER = (if cfg.enableSwagger then "1" else "0");
|
ENABLE_SWAGGER = (if cfg.enableSwagger then "1" else "0");
|
||||||
|
B2_ACCOUNT_ID = cfg.b2AccountId;
|
||||||
|
B2_ACCOUNT_KEY = cfg.b2AccountKey;
|
||||||
|
RESTIC_PASSWORD = cfg.resticPassword;
|
||||||
} // config.networking.proxy.envVars;
|
} // 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 ];
|
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" ];
|
after = [ "network-online.target" ];
|
||||||
|
|
|
@ -4,6 +4,9 @@
|
||||||
enable = true;
|
enable = true;
|
||||||
token = config.services.userdata.api.token;
|
token = config.services.userdata.api.token;
|
||||||
enableSwagger = config.services.userdata.api.enableSwagger;
|
enableSwagger = config.services.userdata.api.enableSwagger;
|
||||||
|
b2AccountId = config.services.userdata.backblaze.accountId;
|
||||||
|
b2AccountKey = config.services.userdata.backblaze.accountKey;
|
||||||
|
resticPassword = config.services.userdata.resticPassword;
|
||||||
};
|
};
|
||||||
|
|
||||||
users.users."selfprivacy-api" = {
|
users.users."selfprivacy-api" = {
|
||||||
|
|
Loading…
Reference in a new issue