mirror of
https://git.lgmrszd.xyz/Lgmrszd/nix-cfg.git
synced 2024-12-03 15:58:05 +01:00
NixOS module to patch akkoma config, enabling configuration from database
This commit is contained in:
parent
4042bf6842
commit
b317cd7865
1 changed files with 32 additions and 0 deletions
32
modules/akkoma-patches.nix
Normal file
32
modules/akkoma-patches.nix
Normal file
|
@ -0,0 +1,32 @@
|
|||
{ 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 ];
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue