moved restic to features
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
{ inputs, ... }: {
|
{ self, inputs, ... }: {
|
||||||
flake.modules.nixos.restic-server = { config, pkgs, lib, ... }: {
|
flake.modules.nixos.restic-server = { config, pkgs, lib, ... }: {
|
||||||
services.restic.server = {
|
services.restic.server = {
|
||||||
enable = true;
|
enable = true;
|
||||||
@@ -47,20 +47,20 @@
|
|||||||
config = let
|
config = let
|
||||||
resticRepository = "rest:https://soteria.john-stream.com/${cfg.repoName}";
|
resticRepository = "rest:https://soteria.john-stream.com/${cfg.repoName}";
|
||||||
caCert = "${config.mtls.certDir}/root_ca.crt";
|
caCert = "${config.mtls.certDir}/root_ca.crt";
|
||||||
mtlsClientCert = "${config.mtls.certDir}/${config.mtls.bundleFilename}";
|
mtlsBundle = "${config.mtls.certDir}/${config.mtls.bundleFilename}";
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
home.sessionVariables = {
|
home.sessionVariables = {
|
||||||
RESTIC_REPOSITORY = resticRepository;
|
RESTIC_REPOSITORY = resticRepository;
|
||||||
RESTIC_PASSWORD_FILE = cfg.passwordFile;
|
RESTIC_PASSWORD_FILE = cfg.passwordFile;
|
||||||
RESTIC_CACERT = caCert;
|
RESTIC_CACERT = caCert;
|
||||||
RESTIC_TLS_CLIENT_CERT = mtlsClientCert;
|
RESTIC_TLS_CLIENT_CERT = mtlsBundle;
|
||||||
};
|
};
|
||||||
|
|
||||||
# This is necessary because the restic service in home manager doesn't otherwise expose these options.
|
# This is necessary because the restic service in home manager doesn't otherwise expose these options.
|
||||||
systemd.user.services."restic-backups-${cfg.repoName}".Service.Environment = [
|
systemd.user.services."restic-backups-${cfg.repoName}".Service.Environment = [
|
||||||
"RESTIC_CACERT=${caCert}"
|
"RESTIC_CACERT=${caCert}"
|
||||||
"RESTIC_TLS_CLIENT_CERT=${mtlsClientCert}"
|
"RESTIC_TLS_CLIENT_CERT=${mtlsBundle}"
|
||||||
];
|
];
|
||||||
|
|
||||||
services.restic = {
|
services.restic = {
|
||||||
Reference in New Issue
Block a user