programs/arqbackup: init module
This commit is contained in:
parent
33220d4791
commit
7347f72507
2 changed files with 42 additions and 0 deletions
|
|
@ -103,6 +103,7 @@
|
|||
./services/jankyborders
|
||||
./programs/_1password.nix
|
||||
./programs/_1password-gui.nix
|
||||
./programs/arqbackup.nix
|
||||
./programs/bash
|
||||
./programs/direnv.nix
|
||||
./programs/fish.nix
|
||||
|
|
|
|||
41
modules/programs/arqbackup.nix
Normal file
41
modules/programs/arqbackup.nix
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
cfg = config.programs.arqbackup;
|
||||
in
|
||||
{
|
||||
options = {
|
||||
programs.arqbackup = {
|
||||
enable = lib.mkEnableOption "Arq backup";
|
||||
|
||||
# If `arq` is not available then we set `default` to `null` to prevent
|
||||
# eval from breaking while `arq` hasn't been merged yet. Only if a user
|
||||
# enables the module will they be required to set this option.
|
||||
package = lib.mkPackageOption pkgs "arq" (lib.optionalAttrs (!pkgs ? arq) { default = null; });
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
environment.systemPackages = [ cfg.package ];
|
||||
|
||||
launchd.daemons.arqagent = {
|
||||
command = "${cfg.package}/Applications/Arq.app/Contents/Resources/ArqAgent.app/Contents/MacOS/ArqAgent";
|
||||
serviceConfig.Label = "com.haystacksoftware.arqagent";
|
||||
serviceConfig.RunAtLoad = true;
|
||||
serviceConfig.KeepAlive = true;
|
||||
};
|
||||
|
||||
launchd.user.agents.ArqMonitor = {
|
||||
command = "${cfg.package}/Applications/Arq.app/Contents/Resources/ArqMonitor.app/Contents/MacOS/ArqMonitor";
|
||||
serviceConfig.Label = "com.haystacksoftware.ArqMonitor";
|
||||
serviceConfig.RunAtLoad = true;
|
||||
serviceConfig.KeepAlive = true;
|
||||
managedBy = "programs.arqbackup.enable";
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue