diff options
| author | LLLL Colonq <llll@colonq> | 2024-01-12 15:01:08 -0500 |
|---|---|---|
| committer | LLLL Colonq <llll@colonq> | 2024-01-12 15:01:08 -0500 |
| commit | f79782c5b45c2be3e42bcecc036bf38972b3cabc (patch) | |
| tree | 2d9240e565ed89ed3896ad86d6b1dfd0c56d8a38 /flake.nix | |
| parent | 094d3e0e1370f2f8b3619ba6cea8b33ac83dceed (diff) | |
Add frontend service
Diffstat (limited to 'flake.nix')
| -rw-r--r-- | flake.nix | 35 |
1 files changed, 35 insertions, 0 deletions
@@ -179,6 +179,40 @@ }; }; }; + figFrontendModule = { config, lib, ... }: + let + cfg = config.colonq.services.fig-frontend; + in { + options.colonq.services.fig-frontend = { + enable = lib.mkEnableOption "Enable the fig web frontend"; + configFile = lib.mkOption { + type = lib.types.path; + description = "Path to config file"; + default = pkgs.writeText "fig-frontend.toml" '' + port = 8000 + asset_path = "./fig-frontend-assets" + client_id = "" + auth_token = "" + ''; + }; + }; + config = lib.mkIf cfg.enable { + systemd.services."colonq.fig-frontend" = { + wantedBy = ["multi-user.target"]; + serviceConfig = { + Restart = "on-failure"; + ExecStart = "${haskellPackages.fig-frontend}/bin/fig-frontend --config ${cfg.configFile}"; + DynamicUser = "yes"; + RuntimeDirectory = "colonq.fig-frontend"; + RuntimeDirectoryMode = "0755"; + StateDirectory = "colonq.fig-frontend"; + StateDirectoryMode = "0700"; + CacheDirectory = "colonq.fig-frontend"; + CacheDirectoryMode = "0750"; + }; + }; + }; + }; in { devShells.x86_64-linux.default = haskellPackages.shellFor { packages = hspkgs: with hspkgs; [ @@ -213,6 +247,7 @@ figMonitorDiscord = figMonitorDiscordModule; figMonitorIRC = figMonitorIRCModule; figBridgeIRCDiscord = figBridgeIRCDiscordModule; + figFrontend = figFrontendModule; }; }; } |
