feat: create backups module

We currently have backups via a shell script on the machine
vermilion.bravo. Unfortunately, we can't activate these backups without
setting up a user, and that wasn't done yet for teal.

This commit adds backups, and also enforces their activation by failing
to evaluate if a backups key has not been provided and backups have not
been explicitly disabled.

Change-Id: Ia37bd13cb8de6e20cc77e735630a59cb0c5d0fb4
Reviewed-on: https://git.clicks.codes/c/Infra/NixFiles/+/756
Tested-by: Skyler Grey <minion@clicks.codes>
Reviewed-by: Samuel Shuert <coded@clicks.codes>
diff --git a/modules/nixos/clicks/users/backups/default.nix b/modules/nixos/clicks/users/backups/default.nix
new file mode 100644
index 0000000..66fc8ce
--- /dev/null
+++ b/modules/nixos/clicks/users/backups/default.nix
@@ -0,0 +1,38 @@
+# SPDX-FileCopyrightText: 2024 Clicks Codes
+#
+# SPDX-License-Identifier: GPL-3.0-only
+
+{ lib, config, ... }: let
+  cfg = config.clicks.backups;
+in {
+  options = {
+    clicks.backups = {
+      key = lib.mkOption {
+        type = lib.types.str;
+        description = "The public key to use for backups";
+      };
+      enable = lib.mkOption {
+        type = lib.types.bool;
+        default = true;
+        description = "It is mandatory for any Clicks server to have the backups enabled, please only disable this if you are backing up in a different way";
+      };
+    };
+  };
+
+  config = lib.mkIf cfg.enable {
+    clicks.users.backups = ["backups"];
+
+    users.users.backups = {
+      isNormalUser = true;
+      group = "backups";
+
+      extraGroups = ["wheel"];
+
+      openssh.authorizedKeys.keys = [
+        cfg.key
+      ];
+    };
+
+    users.groups.backups = { };
+  };
+}