Status page for GenSoc
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

36 lines
1.1 KiB

{ lib, pkgs, config, ... }:
with lib;
let
cfg = config.services.gensoc-status;
statusPkg = (import "${pkgs.fetchgit {
url = "https://code.gensokyo.social/Gensokyo.social/status.git";
rev = "712189604768c3189d12c16c4e576205dd2eb293";
sha256 = "0nz499g1hcfzxlswk1crpwsrg3b1k1vhii6jfya5x1sqnw0h1hwz";
}}/default.nix");
in {
options.services.gensoc-status = {
enable = mkEnableOption "Gensokyo.social status";
port = {
type = types.int;
default = 8080;
description = "Governs port number that server will listen on";
};
settings = {
MASTODON_API_KEY = {
type = types.str;
description = "Mastodon API key";
};
};
};
config = let
configFile = pkgs.writeText "config.json" (builtins.toJSON cfg.settings);
in lib.mkIf cfg.enable {
# systemd unit for miracle-tv-server
systemd.services.gensoc-status = {
wantedBy = [ "multi-user.target" ];
serviceConfig.ExecStart = "CONFIG_FILE=${configFile} PORT=${builtins.toString cfg.port} ${statusPkg}/bin/gensoc-status";
};
};
}