herdr: add module

This commit is contained in:
Amadej Kastelic
2026-06-30 12:14:44 -05:00
committed by Austin Horstman
parent 5d72a29fc3
commit 2a37d71bbe
7 changed files with 299 additions and 0 deletions
@@ -0,0 +1,10 @@
{
time = "2026-06-27T12:17:31+00:00";
condition = true;
message = ''
A new module is available: 'programs.herdr'.
Herdr is a terminal workspace and agent manager. The new module lets
you install it and declaratively configure its TOML config file.
'';
}
+69
View File
@@ -0,0 +1,69 @@
{
config,
lib,
pkgs,
...
}:
let
inherit (lib) mkIf mkOption;
cfg = config.programs.herdr;
tomlFormat = pkgs.formats.toml { };
in
{
meta.maintainers = [ lib.maintainers.amadejkastelic ];
options.programs.herdr = {
enable = lib.mkEnableOption "Herdr";
package = lib.mkPackageOption pkgs "herdr" { nullable = true; };
settings = mkOption {
inherit (tomlFormat) type;
default = { };
example = {
onboarding = false;
terminal = {
default_shell = "nu";
shell_mode = "auto";
new_cwd = "follow";
};
theme = {
name = "catppuccin";
auto_switch = true;
light_name = "catppuccin-latte";
dark_name = "catppuccin";
};
ui = {
sidebar_width = 32;
agent_panel_sort = "priority";
toast.delivery = "herdr";
sound.enabled = true;
};
keys.prefix = "ctrl+b";
keys.command = [
{
key = "prefix+l";
type = "plugin_action";
command = "example.layout.apply";
description = "apply layout";
}
];
};
description = ''
Configuration written to {file}`$XDG_CONFIG_HOME/herdr/config.toml`.
See <https://herdr.dev/docs/configuration/> for the full list of options.
'';
};
};
config = mkIf cfg.enable {
home.packages = lib.mkIf (cfg.package != null) [ cfg.package ];
xdg.configFile."herdr/config.toml" = mkIf (cfg.settings != { }) {
source = tomlFormat.generate "herdr-config.toml" cfg.settings;
};
};
}
+1
View File
@@ -82,6 +82,7 @@ let
"halloy"
"helix"
"hello"
"herdr"
"himalaya"
"hjson-go"
"htop"
+4
View File
@@ -0,0 +1,4 @@
{
herdr-enable = ./herdr-enable.nix;
herdr-settings = ./herdr-settings.nix;
}
@@ -0,0 +1,11 @@
{
xdg.enable = true;
programs.herdr.enable = true;
test.asserts.warnings.expected = [ ];
nmt.script = ''
assertPathNotExists "home-files/.config/herdr/config.toml"
'';
}
@@ -0,0 +1,114 @@
{
xdg.enable = true;
programs.herdr = {
enable = true;
settings = {
onboarding = false;
update = {
channel = "stable";
version_check = true;
manifest_check = true;
};
terminal = {
default_shell = "nu";
shell_mode = "auto";
new_cwd = "follow";
};
worktrees.directory = "~/.herdr/worktrees";
remote.manage_ssh_config = true;
theme = {
name = "catppuccin";
auto_switch = true;
light_name = "catppuccin-latte";
dark_name = "catppuccin";
custom = {
accent = "#a6e3a1";
green = "#a6e3a1";
};
};
ui = {
sidebar_width = 32;
sidebar_min_width = 18;
sidebar_max_width = 36;
mobile_width_threshold = 64;
mouse_capture = true;
confirm_close = true;
agent_panel_sort = "priority";
accent = "cyan";
toast = {
delivery = "herdr";
delay_seconds = 1;
herdr.position = "bottom-right";
clipboard = {
enabled = true;
position = "bottom-center";
};
};
sound = {
enabled = true;
path = "sounds/notification.mp3";
agents = {
droid = "off";
claude = "on";
};
};
};
keys = {
prefix = "ctrl+b";
goto = "prefix+g";
new_tab = "prefix+c";
next_tab = [
"prefix+n"
"ctrl+alt+]"
];
focus_pane_left = "prefix+h";
split_horizontal = "prefix+minus";
command = [
{
key = "prefix+alt+g";
type = "pane";
command = "lazygit";
description = "run lazygit";
}
{
key = "prefix+l";
type = "plugin_action";
command = "example.layout.apply";
description = "apply layout";
}
];
};
advanced.scrollback_limit_bytes = 10485760;
experimental = {
pane_history = true;
allow_nested = false;
kitty_graphics = false;
reveal_hidden_cursor_for_cjk_ime = false;
cjk_ime_agents = [ ];
cjk_ime_cursor_shape = "steady_block";
};
session.resume_agents_on_restore = true;
};
};
test.asserts.warnings.expected = [ ];
nmt.script = ''
assertFileExists "home-files/.config/herdr/config.toml"
assertFileContent \
"home-files/.config/herdr/config.toml" \
${./settings-expected.toml}
'';
}
@@ -0,0 +1,90 @@
onboarding = false
[advanced]
scrollback_limit_bytes = 10485760
[experimental]
allow_nested = false
cjk_ime_agents = []
cjk_ime_cursor_shape = "steady_block"
kitty_graphics = false
pane_history = true
reveal_hidden_cursor_for_cjk_ime = false
[keys]
focus_pane_left = "prefix+h"
goto = "prefix+g"
new_tab = "prefix+c"
next_tab = ["prefix+n", "ctrl+alt+]"]
prefix = "ctrl+b"
split_horizontal = "prefix+minus"
[[keys.command]]
command = "lazygit"
description = "run lazygit"
key = "prefix+alt+g"
type = "pane"
[[keys.command]]
command = "example.layout.apply"
description = "apply layout"
key = "prefix+l"
type = "plugin_action"
[remote]
manage_ssh_config = true
[session]
resume_agents_on_restore = true
[terminal]
default_shell = "nu"
new_cwd = "follow"
shell_mode = "auto"
[theme]
auto_switch = true
dark_name = "catppuccin"
light_name = "catppuccin-latte"
name = "catppuccin"
[theme.custom]
accent = "#a6e3a1"
green = "#a6e3a1"
[ui]
accent = "cyan"
agent_panel_sort = "priority"
confirm_close = true
mobile_width_threshold = 64
mouse_capture = true
sidebar_max_width = 36
sidebar_min_width = 18
sidebar_width = 32
[ui.sound]
enabled = true
path = "sounds/notification.mp3"
[ui.sound.agents]
claude = "on"
droid = "off"
[ui.toast]
delay_seconds = 1
delivery = "herdr"
[ui.toast.clipboard]
enabled = true
position = "bottom-center"
[ui.toast.herdr]
position = "bottom-right"
[update]
channel = "stable"
manifest_check = true
version_check = true
[worktrees]
directory = "~/.herdr/worktrees"