]> Untitled Git - MarigoldOS/.git/commitdiff
Fix up charm module and profile.
authorcw <beetr00ts@pm.me>
Sun, 30 Apr 2023 21:45:05 +0000 (16:45 -0500)
committercw <beetr00ts@pm.me>
Sun, 30 Apr 2023 21:45:05 +0000 (16:45 -0500)
modules/charm.nix
profiles/charm.nix [new file with mode: 0644]

index 4557bbdc2f3c46f7768f162811842a9a673c0479..b418367023e99cdba7d30785a207fe1c1c1d30f0 100644 (file)
@@ -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 (file)
index 0000000..d38a1a0
--- /dev/null
@@ -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}" ];
+  };
+}