Fix warning in unit file
This commit is contained in:
parent
c90d8e481c
commit
b83c23b801
15
backup.nix
15
backup.nix
@ -1,4 +1,9 @@
|
|||||||
{ lib, config, pkgs, utils, ... }:
|
{
|
||||||
|
lib,
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
let
|
let
|
||||||
cfg = config.backup-helper;
|
cfg = config.backup-helper;
|
||||||
restic-wrapper = pkgs.writeShellApplication {
|
restic-wrapper = pkgs.writeShellApplication {
|
||||||
@ -58,11 +63,14 @@ in
|
|||||||
};
|
};
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
systemd.services."backup-helper" = {
|
systemd.services."backup-helper" = {
|
||||||
|
wants = [ "network-online.target" ];
|
||||||
after = [ "network-online.target" ];
|
after = [ "network-online.target" ];
|
||||||
environment = {
|
environment =
|
||||||
|
{
|
||||||
RESTIC_REPOSITORY = cfg.restic-repository;
|
RESTIC_REPOSITORY = cfg.restic-repository;
|
||||||
BACKUP_HELPER_DIRS = lib.strings.concatStringsSep "," cfg.backup-dirs;
|
BACKUP_HELPER_DIRS = lib.strings.concatStringsSep "," cfg.backup-dirs;
|
||||||
} // lib.attrsets.optionalAttrs (builtins.hasAttr "password-file" cfg) {
|
}
|
||||||
|
// lib.attrsets.optionalAttrs (builtins.hasAttr "password-file" cfg) {
|
||||||
RESTIC_PASSWORD_FILE = cfg.password-file;
|
RESTIC_PASSWORD_FILE = cfg.password-file;
|
||||||
};
|
};
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
@ -80,4 +88,3 @@ in
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user