1 { config, pkgs, lib, ... }:
3 cfg = config.services.charm;
5 options.services.charm = {
6 enable = lib.mkEnableOption "Charm cloud server";
8 config = lib.mkIf cfg.enable {
9 systemd.services.charm = {
10 wantedBy = [ "multi-user.target" ];
11 after = [ "network.target" ];
12 description = "The Cloud";
15 ExecStart = ''${pkgs.charm}/bin/charm serve'';
20 # TODO: Expand module a bit
21 # https://github.com/charmbracelet/charm#server-settings
22 CHARM_SERVER_DATA_DIR = "/var/lib/charm";
23 # CHARM_SERVER_USER_MAX_STORAGE = "";
25 StateDirectory = "charm";
26 WorkingDirectory = "/var/lib/charm";