From: cw Date: Sun, 30 Apr 2023 21:45:05 +0000 (-0500) Subject: Fix up charm module and profile. X-Git-Url: https://git.kernelpanic.cafe/?p=MarigoldOS%2F.git;a=commitdiff_plain;h=83750770c24445bcc9464ff863a71db6d1c8b5df Fix up charm module and profile. --- diff --git a/modules/charm.nix b/modules/charm.nix index 4557bbd..b418367 100644 --- a/modules/charm.nix +++ b/modules/charm.nix @@ -16,7 +16,12 @@ in { Restart = "always"; Type = "simple"; RestartSec = 1; - Environment = "CHARM_SERVER_DATA_DIR=/var/lib/charm"; + Environment = { + # TODO: Expand module a bit + # https://github.com/charmbracelet/charm#server-settings + CHARM_SERVER_DATA_DIR = "/var/lib/charm"; + # CHARM_SERVER_USER_MAX_STORAGE = ""; + }; StateDirectory = "charm"; WorkingDirectory = "/var/lib/charm"; }; diff --git a/profiles/charm.nix b/profiles/charm.nix new file mode 100644 index 0000000..d38a1a0 --- /dev/null +++ b/profiles/charm.nix @@ -0,0 +1,15 @@ +{ pkgs, config, ... }: +let + fqdn = "charm.${config.networking.hostName}.${config.networking.domain}"; +in { + services.charm.enable = true; + environment.systemPackages = [ + pkgs.charm + ]; + environment.variables = { + CHARM_HOST = "${config.networking.fqdn}"; + }; + networking.hosts = { + "127.0.0.1" = [ "${fqdn}" ]; + }; +}