Add attic-client module
This commit is contained in:
parent
bb727fd207
commit
0cd03bfeaf
|
@ -21,6 +21,7 @@
|
||||||
./programs/restic-management
|
./programs/restic-management
|
||||||
./programs/scripts
|
./programs/scripts
|
||||||
./programs/steam
|
./programs/steam
|
||||||
|
./services/attic-client
|
||||||
./services/attic-server
|
./services/attic-server
|
||||||
./services/common-x86
|
./services/common-x86
|
||||||
./services/data-share
|
./services/data-share
|
||||||
|
|
|
@ -0,0 +1,39 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
inputs,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
system = pkgs.system;
|
||||||
|
cfg = config.services.az-attic-client;
|
||||||
|
atticWatcher = pkgs.writeShellScript "attic-watcher" ''
|
||||||
|
${inputs.attic.packages.${system}.attic-client}/bin/attic watch-store prod
|
||||||
|
'';
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options = {
|
||||||
|
services.az-attic-client = {
|
||||||
|
enable = lib.mkEnableOption "Enable a service to watch the nix store and upload new paths to attic";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
environment.systemPackages = [ inputs.attic.packages.${system}.attic-client ];
|
||||||
|
# sytemd service
|
||||||
|
systemd.services.az-attic-client = {
|
||||||
|
description = "Watch the nix store and upload new paths to attic";
|
||||||
|
after = [ "network.target" ];
|
||||||
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
serviceConfig = {
|
||||||
|
Type = "simple";
|
||||||
|
ExecStart = "${atticWatcher}";
|
||||||
|
Restart = "always";
|
||||||
|
RestartSec = "5";
|
||||||
|
User = config.az-username;
|
||||||
|
Group = "users";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -81,6 +81,7 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
services = {
|
services = {
|
||||||
|
az-attic-client.enable = true;
|
||||||
az-logs-share.enable = true;
|
az-logs-share.enable = true;
|
||||||
az-restic-client-desktop.enable = true;
|
az-restic-client-desktop.enable = true;
|
||||||
az-tlp.enable = true;
|
az-tlp.enable = true;
|
||||||
|
|
Loading…
Reference in New Issue