Add initial draft of twenty-crm

Not sure if any of it works, this is a checkpoint to debug other things.
This commit is contained in:
Eli Ribble 2025-10-22 03:32:56 +00:00
parent 8f0113946c
commit 9683488ef9
2 changed files with 59 additions and 0 deletions

View file

@ -25,6 +25,7 @@
./synapse.nix
./timecardbot.nix
./tmux.nix
./twenty-crm.nix
./vikunja.nix
];
}

View file

@ -0,0 +1,58 @@
{ pkgs, lib, config, ... }:
with lib;
let
tag = "v1.8.2";
port = "10090";
in {
options.myModules.twenty-crm.enable = mkEnableOption "custom twenty-crm configuration";
config = mkIf config.myModules.twenty-crm.enable {
services.caddy.virtualHosts."crm.gleipnir.technology".extraConfig = ''
reverse_proxy http://localhost:${port}
'';
services.postgresql = {
ensureDatabases = [ "twenty_crm" ];
ensureUsers = [{
ensureClauses.login = true;
ensureDBOwnership = true;
name = "twenty_crm";
}];
};
sops.secrets.twenty-crm-env = {
format = "dotenv";
group = "twenty-crm";
mode = "0440";
owner = "twenty-crm";
restartUnits = ["podman-twenty-crm.service"];
sopsFile = ../../secrets/twenty-crm.env;
};
users.groups.twenty-crm = {};
users.users.twenty-crm = {
group = "twenty-crm";
isSystemUser = true;
};
virtualisation.oci-containers.containers.twenty-crm-webserver = {
environmentFiles = [
"/var/run/secrets/twenty-crm-env"
];
image = "docker.io/twentycrm/twenty:${tag}";
ports = [ "127.0.0.1:3000:${port}" ];
volumes = [
"/run/postgresql/.s.PGSQL.5432:/run/postgresql/.s.PGSQL.5432"
"twenty-crm-data:/app/packages/twenty-server/.local-storage"
];
};
virtualisation.oci-containers.containers.twenty-crm-worker = {
entrypoint = "yarn worker:prod";
environmentFiles = [
"/var/run/secrets/twenty-crm-env"
];
image = "docker.io/twentycrm/twenty:${tag}";
ports = [ "127.0.0.1:3000:${port}" ];
volumes = [
"/run/postgresql/.s.PGSQL.5432:/run/postgresql/.s.PGSQL.5432"
"twenty-crm-data:/app/packages/twenty-server/.local-storage"
];
};
};
}