halloy: add module (#7034)
This commit is contained in:
parent
ecb2162422
commit
910292fe34
6 changed files with 78 additions and 0 deletions
|
|
@ -127,6 +127,7 @@ let
|
|||
./programs/gpg.nix
|
||||
./programs/gradle.nix
|
||||
./programs/granted.nix
|
||||
./programs/halloy.nix
|
||||
./programs/havoc.nix
|
||||
./programs/helix.nix
|
||||
./programs/hexchat.nix
|
||||
|
|
|
|||
49
modules/programs/halloy.nix
Normal file
49
modules/programs/halloy.nix
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
{
|
||||
lib,
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
let
|
||||
inherit (lib)
|
||||
mkIf
|
||||
mkEnableOption
|
||||
mkPackageOption
|
||||
mkOption
|
||||
;
|
||||
|
||||
cfg = config.programs.halloy;
|
||||
|
||||
formatter = pkgs.formats.toml { };
|
||||
in
|
||||
{
|
||||
meta.maintainers = with lib.hm.maintainers; [ aguirre-matteo ];
|
||||
|
||||
options.programs.halloy = {
|
||||
enable = mkEnableOption "halloy";
|
||||
package = mkPackageOption pkgs "halloy" { nullable = true; };
|
||||
settings = mkOption {
|
||||
type = formatter.type;
|
||||
default = { };
|
||||
example = {
|
||||
"buffer.channel.topic".enabled = true;
|
||||
"servers.liberachat" = {
|
||||
nickname = "halloy-user";
|
||||
server = "irc.libera.chat";
|
||||
channels = [ "#halloy" ];
|
||||
};
|
||||
};
|
||||
description = ''
|
||||
Configuration settings for halloy. All available options can be
|
||||
found here: <https://halloy.chat/configuration/index.html>.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = mkIf (cfg.package != null) [ cfg.package ];
|
||||
xdg.configFile."halloy/config.toml" = mkIf (cfg.settings != { }) {
|
||||
source = formatter.generate "halloy-config" cfg.settings;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -371,6 +371,7 @@ import nmtSrc {
|
|||
./modules/programs/getmail
|
||||
./modules/programs/gnome-shell
|
||||
./modules/programs/gnome-terminal
|
||||
./modules/programs/halloy
|
||||
./modules/programs/hexchat
|
||||
./modules/programs/hyprlock
|
||||
./modules/programs/i3bar-river
|
||||
|
|
|
|||
1
tests/modules/programs/halloy/default.nix
Normal file
1
tests/modules/programs/halloy/default.nix
Normal file
|
|
@ -0,0 +1 @@
|
|||
{ halloy-example-config = ./example-config.nix; }
|
||||
19
tests/modules/programs/halloy/example-config.nix
Normal file
19
tests/modules/programs/halloy/example-config.nix
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
programs.halloy = {
|
||||
enable = true;
|
||||
settings = {
|
||||
buffer.channel.topic.enabled = true;
|
||||
servers.liberachat = {
|
||||
nickname = "halloy-user";
|
||||
server = "irc.libera.chat";
|
||||
channels = [ "#halloy" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.config/halloy/config.toml
|
||||
assertFileContent home-files/.config/halloy/config.toml \
|
||||
${./example-config.toml}
|
||||
'';
|
||||
}
|
||||
7
tests/modules/programs/halloy/example-config.toml
Normal file
7
tests/modules/programs/halloy/example-config.toml
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
[buffer.channel.topic]
|
||||
enabled = true
|
||||
|
||||
[servers.liberachat]
|
||||
channels = ["#halloy"]
|
||||
nickname = "halloy-user"
|
||||
server = "irc.libera.chat"
|
||||
Loading…
Add table
Add a link
Reference in a new issue