Add ERPNext
ERPNext is many things that Clicks wants. In particular, we're interested
in task tracking and ticketing. Thanks to Frappix by blaggacao, it's not
even too challenging to install on nix anymore!
We'll be using the domain frappe.clicks.codes (rather than
erpnext.clicks.codes) because we would like to be able to install more
frappe apps on the same site without it seeming weird. We will, however,
make the domain redirect to give a nicer way to remember this.
Change-Id: I418d172c5de2b6d6918e1c5f55c7f1d6e1faa2ec
Reviewed-on: https://git.clicks.codes/c/Infra/NixFiles/+/535
Reviewed-by: Samuel Shuert <coded@clicks.codes>
Tested-by: Skyler Grey <minion@clicks.codes>
diff --git a/modules/common/frappe.nix b/modules/common/frappe.nix
new file mode 100644
index 0000000..8479aff
--- /dev/null
+++ b/modules/common/frappe.nix
@@ -0,0 +1,40 @@
+{ pkgs, config, ... }: {
+ services.frappe = {
+ enable = true;
+ project = "frappe";
+
+ package = pkgs.frappix.frappe;
+
+ apps = [
+ pkgs.frappix.erpnext
+ ];
+
+ sites."frappe.clicks.codes" = {
+ domains = [
+ "frappe.clicks.codes"
+ ];
+
+ apps = [
+ "frappe"
+ "erpnext"
+ ];
+ };
+
+ adminPassword = config.sops.secrets."modules/common/frappe.nix:adminPassword".path;
+
+ gunicorn_workers = 9;
+ };
+
+ services.nginx.virtualHosts."frappe.clicks.codes" = {
+ enableACME = true;
+ };
+
+ sops.secrets."modules/common/frappe.nix:adminPassword" = {
+ mode = "0400";
+ owner = config.users.users.root.name;
+ group = config.users.users.root.group;
+ sopsFile = ../../secrets/frappe.json;
+ format = "json";
+ key = "adminPassword";
+ };
+}