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