Files
nix-config/modules/nixos/services/restic-server/default.nix
mjallen18 70002a19e2 hmm
2026-04-07 18:39:42 -05:00

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