32 lines
682 B
Nix
Executable File
32 lines
682 B
Nix
Executable File
{
|
|
config,
|
|
lib,
|
|
namespace,
|
|
...
|
|
}:
|
|
with lib;
|
|
let
|
|
name = "restic-server";
|
|
cfg = config.${namespace}.services.${name};
|
|
|
|
resticConfig = lib.${namespace}.mkModule {
|
|
inherit config name;
|
|
serviceName = "restic-rest-server";
|
|
description = "restic REST server";
|
|
options = { };
|
|
moduleConfig = {
|
|
services.restic.server = {
|
|
enable = true;
|
|
dataDir = "${cfg.dataDir}/backup/restic";
|
|
prometheus = true;
|
|
listenAddress = "${cfg.listenAddress}:${toString cfg.port}";
|
|
htpasswd-file = "${cfg.dataDir}/backup/restic/.htpasswd";
|
|
extraFlags = [ "--no-auth" ];
|
|
};
|
|
};
|
|
};
|
|
in
|
|
{
|
|
imports = [ resticConfig ];
|
|
}
|