Feature: WIP backup module.
This commit is contained in:
parent
5824942904
commit
d134ad5c83
1 changed files with 34 additions and 0 deletions
34
modules/backup.nix
Normal file
34
modules/backup.nix
Normal 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" ];
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue