mirror of https://gitlab.crans.org/nounous/nixos
43 lines
822 B
Nix
43 lines
822 B
Nix
{ config, lib, ... }:
|
|
|
|
let
|
|
cfg = config.crans.services.resticServer;
|
|
|
|
inherit (lib)
|
|
mkEnableOption
|
|
mkIf
|
|
mkOption
|
|
types
|
|
;
|
|
in
|
|
|
|
{
|
|
options.crans.services.resticServer = {
|
|
enable = mkEnableOption "Serveur de backups restic.";
|
|
|
|
dataDir = mkOption {
|
|
type = types.path;
|
|
default = "/backups";
|
|
example = "/var/backups";
|
|
description = "Dossier dans lequel les backups seront effectuées.";
|
|
};
|
|
|
|
port = mkOption {
|
|
type = types.int;
|
|
default = 8080;
|
|
example = 4242;
|
|
description = "Port sur lequel le serveur restic écoute.";
|
|
};
|
|
};
|
|
|
|
config = mkIf cfg.enable {
|
|
services.restic.server = {
|
|
enable = true;
|
|
|
|
dataDir = cfg.dataDir;
|
|
listenAddress = "localhost:${toString cfg.port}";
|
|
privateRepos = true;
|
|
};
|
|
};
|
|
}
|