mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-21 16:21:34 +01:00
Enable actualbudget on alto
This commit is contained in:
parent
2194d76230
commit
e558859799
3 changed files with 89 additions and 2 deletions
33
modules/system/actualbudget/backups.nix
Normal file
33
modules/system/actualbudget/backups.nix
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
options.myConfig.actualbudget.backups.enable = lib.mkEnableOption "";
|
||||
|
||||
config = lib.mkIf config.myConfig.actualbudget.backups.enable {
|
||||
myConfig.resticBackup.actual = {
|
||||
enable = true;
|
||||
healthchecks.enable = true;
|
||||
|
||||
extraConfig = {
|
||||
backupPrepareCommand = "${lib.getExe' pkgs.systemd "systemctl"} stop actual.service";
|
||||
backupCleanupCommand = "${lib.getExe' pkgs.systemd "systemctl"} start actual.service";
|
||||
paths = [ "/var/lib/actual" ];
|
||||
};
|
||||
};
|
||||
|
||||
environment.systemPackages = [
|
||||
(pkgs.writeShellApplication {
|
||||
name = "actual-restore";
|
||||
text = ''
|
||||
sudo systemctl stop actual.service
|
||||
sudo restic-actual restore latest --target /
|
||||
sudo systemctl start actual.service
|
||||
'';
|
||||
})
|
||||
];
|
||||
};
|
||||
}
|
||||
44
modules/system/actualbudget/default.nix
Normal file
44
modules/system/actualbudget/default.nix
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
{
|
||||
config,
|
||||
inputs,
|
||||
pkgs-unstable,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
let
|
||||
cfg = config.myConfig.actualbudget;
|
||||
in
|
||||
{
|
||||
disabledModules = [ "services/web-apps/actual.nix" ];
|
||||
imports = [ "${inputs.nixpkgs-unstable}/nixos/modules/services/web-apps/actual.nix" ];
|
||||
|
||||
options.myConfig.actualbudget = {
|
||||
enable = lib.mkEnableOption "";
|
||||
subdomain = lib.mkOption {
|
||||
type = lib.types.nonEmptyStr;
|
||||
default = "";
|
||||
};
|
||||
port = lib.mkOption {
|
||||
type = lib.types.port;
|
||||
default = 8080;
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
users.groups.actual = { };
|
||||
users.users.actual = {
|
||||
isSystemUser = true;
|
||||
group = "actual";
|
||||
};
|
||||
|
||||
services.actual = {
|
||||
enable = true;
|
||||
package = pkgs-unstable.actual-server;
|
||||
|
||||
settings = {
|
||||
hostname = "localhost";
|
||||
inherit (cfg) port;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue