mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-nixos-config.git
synced 2024-11-22 11:41:26 +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
|
||||
'';
|
||||
};
|
||||
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 {
|
||||
|
||||
|
@ -43,6 +61,9 @@ in
|
|||
PYTHONUNBUFFERED = "1";
|
||||
AUTH_TOKEN = cfg.token;
|
||||
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;
|
||||
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" ];
|
||||
|
|
|
@ -4,6 +4,9 @@
|
|||
enable = true;
|
||||
token = config.services.userdata.api.token;
|
||||
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" = {
|
||||
|
|
Loading…
Reference in a new issue