feat(wrapperModules.iamb): init#551
Conversation
So, basically, when we have many files we want to make into a directory, the Placeholders are weird values. They point at the associated output in whatever derivation they END UP in. So, outside of that derivation, you can't really use them. You don't need most of that for this module. using Since we are only generating 1 file, that is probably enough, but passing the thing out via passthru is still nice. {
config,
lib,
wlib,
pkgs,
...
}:
{
imports = [ wlib.modules.default ];
options = {
settings = lib.mkOption {
type = wlib.types.structuredValueWith {
nullable = false;
typeName = "TOML";
};
default = { };
description = ''
Configuration of iamb.
See {manpage}`iamb(5)` or <https://iamb.chat/configure.html>
Note: profiles is required for first startup.
'';
example.profiles.myuser.user_id = "@user2:example.com";
};
};
config.package = lib.mkDefault pkgs.iamb;
config.flags."--config-directory" = dirOf (dirOf config.constructFiles.config.path);
config.passthru.generatedConfig = dirOf (dirOf config.constructFiles.config.outPath);
config.constructFiles.config = {
relPath = "${config.binName}-config/iamb/config.toml";
content = builtins.toJSON config.settings;
builder = ''${pkgs.remarshal}/bin/json2toml "$1" "$2"'';
};
config.meta.maintainers = [ wlib.maintainers.aliaslion ];
}Maybe something like that? |
|
OK, thank you, I think I understand it now. Also didn't know about |
Adds wrapper module for iamb, a TUI Matrix client with vi-like keybinds.
Note that I'm not completely sure what
generatedConfig.outputand.placeholderdo, I cobbled this together from the Alacritty and Yazi modules. Would appreciate some info about that :)