From d134ad5c83fe57d96954f369b5e9e64a35b9eb07 Mon Sep 17 00:00:00 2001 From: boyreau Date: Wed, 12 Aug 2026 17:45:17 +0200 Subject: [PATCH] Feature: WIP backup module. --- modules/backup.nix | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 modules/backup.nix diff --git a/modules/backup.nix b/modules/backup.nix new file mode 100644 index 0000000..98d3429 --- /dev/null +++ b/modules/backup.nix @@ -0,0 +1,34 @@ +{ lib, config, ... }: +let + cfg = config.services.backup; +in +{ + options.services.backup = { + enable = lib.mkEnableOption "Whether to enable backups or not."; + + source = lib.mkOption { + type = lib.types.path; + default = null; + description = "The path to save."; + }; + + dest = lib.mkOption { + type = lib.types.either lib.types.path lib.types.str; + default = null; + description = "A destination for the backup."; + }; + + encryption = { + key = lib.mkOption { + type = lib.types.path; + description = "A key to encrypt backups."; + }; + }; + }; + + config = lib.mkIf cfg.enable { + systemd.services.backup = { + wantedBy = [ "multi-user.target" ]; + }; + }; +}