Feature: WIP backup module.

This commit is contained in:
boyreau 2026-08-12 17:45:17 +02:00
commit d134ad5c83

34
modules/backup.nix Normal file
View file

@ -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" ];
};
};
}