nix: format with alejandra

This commit is contained in:
Primrose 2025-02-08 12:05:12 +01:00
parent d5cad148da
commit 95eb4b71e0
Signed by: primrose
GPG key ID: 4E887A4CA9714ADA
118 changed files with 1291 additions and 1703 deletions

View file

@ -3,19 +3,12 @@
config,
lib,
...
}:
let
}: let
cfg = config.services.typst-bot;
t = lib.types;
in
{
in {
options = {
services.typst-bot = {
enable = lib.mkEnableOption "typst-bot";
dataDir = lib.mkOption {
@ -28,18 +21,15 @@ in
description = "Path to an environment file, you can set the token there";
type = t.path;
};
};
};
config = lib.mkIf cfg.enable {
users.users."typst-bot" = {
group = "typst-bot";
isSystemUser = true;
};
users.groups."typst-bot" = { };
users.groups."typst-bot" = {};
systemd.tmpfiles.rules = [
"d ${cfg.dataDir}/cache 700 typst-bot typst-bot - -"
@ -48,15 +38,15 @@ in
systemd.services."typst-bot" = {
description = "A discord bot to render Typst code";
after = [ "network.target" ];
wantedBy = [ "multi-user.target" ];
after = ["network.target"];
wantedBy = ["multi-user.target"];
preStart = ''
touch ${cfg.dataDir}/sqlite/db.sqlite
'';
# Don't pollute the global path
path = [ pkgs.myPkgs.typst-bot ];
path = [pkgs.myPkgs.typst-bot];
script = "typst-bot";
serviceConfig = {
@ -71,9 +61,6 @@ in
cfg.environmentFile
];
};
};
};
}