Problems using lib.formats elixirConf


Im trying to set the akkoma option configurable_from_database.

The akkoma module uses elixirConf to generate a config file from an attribute set, however Im having troubles with this option.

I need the line config :pleroma configurable_from_database: true in the generated file, as well as the other :pleroma blocks that it generates normally.

However, adding ":pleroma".configurable_from_database = true; to the set is instead generating the line config :pleroma configurable_from_database, true which doesnt work.

I cant use the line ":pleroma" = mkRaw "configurable_from_database: true"; as that doesnt allow me to set the other needed “:pleroma” blocks at the same time.

How should I go about adding this option?

Thank you

I’ve encountered the same issue. Right now it doesn’t seem possible to add this to config directly.

Looking through Elixir configuration settings format added in Add Elixir configuration settings format by minijackson · Pull Request #119049 · NixOS/nixpkgs · GitHub, and specifically from comments on there, it does seem like two levels of nesting were intentional.

According to minijackson it shouldn’t affect the resulting config, but it clearly does…

@minijackson can you provide your feedback on how to workaround this issue?

Alright, given original post was published 4 months ago, I doubt this would be any help to the poster, but for those who may find this while searching for solutions for this problem: this worked for me (add this as nixos module to your system config):

{ pkgs, lib, ... }:
  configScriptPost = pkgs.writeShellApplication {
    text = ''
    echo Running configScriptPost
    echo "# configScriptPost patches:" >> config.exs
    echo "config :pleroma, configurable_from_database: true" >> config.exs
    echo Done patching the config!
    name = "configScriptPost";
  } + "/bin/configScriptPost";
{ = lib.mkMerge [[ configScriptPost ]]; = lib.mkMerge [[ configScriptPost ]];

It’s just an additional script that appends data to the generated config file. Proceed with caution since it doesn’t do any Elixir syntax checks.