override borgbackup service in module

This commit is contained in:
cy 2024-12-30 23:14:25 -05:00
parent b5f231ac01
commit d428cd2377
2 changed files with 22 additions and 8 deletions

View file

@ -1,4 +1,11 @@
{ config, lib, pkgs, ... }: let
{
config,
lib,
pkgs,
inputs,
...
}:
let
cfg = config.my.backup;
hostname = config.networking.hostName;
defaultPaths = [
@ -22,7 +29,15 @@
"**/.docker"
"**/borg"
];
in {
in
{
imports = [
{
disabledModules = [ "services/backup/borgbackup.nix" ];
}
(inputs.nixpkgs-borg + "/nixos/modules/services/backup/borgbackup.nix")
];
options.my.backup = {
enable = lib.mkEnableOption "backup";
paths = lib.mkOption {
@ -94,9 +109,7 @@ in {
title="${hostname}: backup completed with exit code: $exitStatus"
msg=$(journalctl -o cat _SYSTEMD_INVOCATION_ID=$invocationId)
${pkgs.curl}/bin/curl -sL -u $(cat ${
config.sops.secrets."services/ntfy".path
}) \
${pkgs.curl}/bin/curl -sL -u $(cat ${config.sops.secrets."services/ntfy".path}) \
-H "Title: $title" \
-d "$msg" \
https://ntfy.cything.io/backups > /dev/null

View file

@ -1,4 +1,5 @@
{...}: {
{ ... }:
{
imports = [
./backup.nix
];