diff --git a/flake.nix b/flake.nix index 63b682f6..08757593 100644 --- a/flake.nix +++ b/flake.nix @@ -967,9 +967,13 @@ c3d2 = { imports = [ sops-nix.nixosModule + ./modules/audio-server.nix + ./modules/autoupdate.nix + ./modules/backup.nix ./modules/c3d2.nix ./modules/nncp.nix - ./modules/autoupdate.nix + ./modules/logging.nix + ./modules/stats.nix ]; c3d2.hosts = hostRegistry.hosts; c3d2.users = import ./users.nix; diff --git a/modules/backup.nix b/modules/backup.nix new file mode 100644 index 00000000..f913c7d8 --- /dev/null +++ b/modules/backup.nix @@ -0,0 +1,12 @@ +{ config, ... }: + +{ + config.services.postgresqlBackup = { + enable = config.services.postgresql.enable; + backupAll = true; + compression = "zsdt"; + compressionLevel = 9; + pgdumpOptions = "--create --clean"; + startAt = "*-*-* 06:00:00"; + }; +} diff --git a/modules/c3d2.nix b/modules/c3d2.nix index fb7296d9..230f234d 100644 --- a/modules/c3d2.nix +++ b/modules/c3d2.nix @@ -37,12 +37,6 @@ let toHqPrivateAddress = toIpv6Address hqPrefix64; in { - imports = [ - ./stats.nix - ./audio-server.nix - ./logging.nix - ]; - options.c3d2 = with lib; { acmeEmail = mkOption { type = types.str;