mirror of
https://git.lgmrszd.xyz/Lgmrszd/nix-cfg.git
synced 2024-11-10 05:48:34 +01:00
32 lines
888 B
Nix
32 lines
888 B
Nix
|
{ pkgs, lib, config, ... }:
|
||
|
let
|
||
|
configScriptPost = pkgs.writeShellApplication {
|
||
|
text = ''
|
||
|
echo "Patching config.exs"
|
||
|
cd "$RUNTIME_DIRECTORY"
|
||
|
cat >> config.exs << EOF
|
||
|
|
||
|
# [===========================]
|
||
|
# [ configScriptPost patches: ]
|
||
|
# [===========================]
|
||
|
config :pleroma, configurable_from_database: true
|
||
|
EOF
|
||
|
echo "Done patching!"
|
||
|
'';
|
||
|
name = "akkoma-config-patch";
|
||
|
} + "/bin/akkoma-config-patch";
|
||
|
cfg = config.services.akkoma.patches;
|
||
|
in
|
||
|
with lib;
|
||
|
{
|
||
|
options.services.akkoma.patches = {
|
||
|
configurableFromDatabase = mkOption {
|
||
|
type = types.bool;
|
||
|
default = false;
|
||
|
};
|
||
|
};
|
||
|
config = mkIf cfg.configurableFromDatabase {
|
||
|
systemd.services.akkoma-config.serviceConfig.ExecStart = mkAfter [ configScriptPost ];
|
||
|
systemd.services.akkoma-config.serviceConfig.ExecReload = mkAfter [ configScriptPost ];
|
||
|
};
|
||
|
}
|