diff --git a/nix/sources.json b/nix/sources.json index 364812d..8ccab26 100644 --- a/nix/sources.json +++ b/nix/sources.json @@ -55,6 +55,18 @@ "url": "https://github.com/nmattia/niv/archive/5830a4dd348d77e39a0f3c4c762ff2663b602d4c.tar.gz", "url_template": "https://github.com///archive/.tar.gz" }, + "nixos2111": { + "branch": "nixos-21.11", + "description": "Nix Packages collection", + "homepage": "", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "63198c9ccefdbd337cef0d85db0ea2689f4ce418", + "sha256": "05gc6xyv8a2dppngm1q44j85j769lr90lg20s6jv62gfg344i50r", + "type": "tarball", + "url": "https://github.com/nixos/nixpkgs/archive/63198c9ccefdbd337cef0d85db0ea2689f4ce418.tar.gz", + "url_template": "https://github.com///archive/.tar.gz" + }, "nixpkgs": { "branch": "nixos-22.05", "builtin": false, diff --git a/profiles/gitea.nix b/profiles/gitea.nix index fbe56e5..faee3a4 100644 --- a/profiles/gitea.nix +++ b/profiles/gitea.nix @@ -64,6 +64,8 @@ ]; }; + services.postgresqlBackup.databases = ["gitea"]; + services.nginx = { enable = true; # Enable Nginx recommendedGzipSettings = true; diff --git a/profiles/hydra.nix b/profiles/hydra.nix index 7aa177a..246270c 100644 --- a/profiles/hydra.nix +++ b/profiles/hydra.nix @@ -39,6 +39,8 @@ ]; }; + services.postgresqlBackup.databases = ["hydra"]; + networking.firewall.allowedTCPPorts = [config.services.hydra.port]; #services.hydra-dev = { diff --git a/profiles/matrix.nix b/profiles/matrix.nix index a7b721e..2379762 100644 --- a/profiles/matrix.nix +++ b/profiles/matrix.nix @@ -145,6 +145,8 @@ }; }; + services.postgresqlBackup.databases = ["matrix-synapse"]; + security.acme = { acceptTerms = true; certs = { diff --git a/profiles/nextcloud.nix b/profiles/nextcloud.nix index 6bc18d7..0d4df57 100644 --- a/profiles/nextcloud.nix +++ b/profiles/nextcloud.nix @@ -45,6 +45,8 @@ ]; }; + services.postgresqlBackup.databases = ["nextcloud"]; + services.nginx = { enable = true; # Enable Nginx recommendedGzipSettings = true; diff --git a/profiles/server_common.nix b/profiles/server_common.nix index 4b11832..10a4e81 100644 --- a/profiles/server_common.nix +++ b/profiles/server_common.nix @@ -4,7 +4,10 @@ pkgs, lib, ... -}: { +}: let + sources = import ../nix/sources.nix; + nixpkgs2111 = (import sources.nixos2111 {}).pkgs; +in { imports = [ ../profiles/openssh.nix ../secrets/user-craige.nix @@ -16,6 +19,15 @@ withUtempter = true; }; + services.postgresql = { + package = nixpkgs2111.postgresql_9_6; + }; + + services.postgresqlBackup = { + enable = true; + compression = "zstd"; + }; + security.polkit.enable = false; # avoid CVE-2021-4034 (PwnKit) services.udisks2.enable = false; # disable udisks2 which enables polkit } diff --git a/profiles/tt-rss.nix b/profiles/tt-rss.nix index 249cdde..462b71d 100644 --- a/profiles/tt-rss.nix +++ b/profiles/tt-rss.nix @@ -43,6 +43,8 @@ ]; }; + services.postgresqlBackup.databases = ["tt_rss"]; + services.nginx = { enable = true; # Enable Nginx recommendedGzipSettings = true;