NixOS and Home Manager config

feat(helix): minimal viable product zellij + helix + broot IDE like thing

nel.pet e15a22a1 865cad25

verified
Changed files
+67
modules
+1
modules/home/default.nix
···
imports = [
./fonts.nix
./git.nix
./i18n.nix
./vscode.nix
./ssh.nix
···
imports = [
./fonts.nix
./git.nix
+
./helix/default.nix
./i18n.nix
./vscode.nix
./ssh.nix
+52
modules/home/helix/default.nix
···
···
+
+
{ lib, pkgs, wrappers, inputs, ... }: let
+
helix = wrappers.helix {
+
settings = {
+
theme = "catppuccin_mocha";
+
};
+
};
+
# TODO: figure out something better than broot (probably self written). its close but not quite what i want and
+
# configuring it is (evidently) a pain in the ass
+
broot-opener = pkgs.writeShellApplication {
+
name = "broot-zellij-hx-opener";
+
text = ''
+
# Make sure we are focused on helix
+
zellij action move-focus right
+
zellij action move-focus up
+
zellij action write 27 # escape
+
zellij action write-chars ":open $1"
+
zellij action write 13 # enter
+
'';
+
};
+
broot-conf = pkgs.writeTextDir "brootconf/conf.toml" ''
+
[[verbs]]
+
invocation = "edit"
+
key = "enter"
+
shortcut = "e"
+
external = [ "${lib.getExe pkgs.bash}", "-e", "${lib.getExe broot-opener}", "{file}" ]
+
apply_to = "text_file"
+
leave_broot = false
+
'';
+
abaca-broot = inputs.wrappers.lib.wrapPackage {
+
inherit pkgs;
+
package = pkgs.broot;
+
env = {
+
BROOT_CONFIG_DIR = "${broot-conf}/brootconf";
+
};
+
};
+
abaca = pkgs.writeShellApplication {
+
name = "abaca";
+
runtimeInputs = [ pkgs.zellij helix abaca-broot ];
+
text = ''
+
exec ${lib.getExe pkgs.zellij} \
+
"--config" "${./zellij-config.kdl}" \
+
"--layout" "${./layout.kdl}" \
+
"$@"
+
'';
+
};
+
in {
+
home.packages = [
+
helix
+
abaca
+
];
+
}
+13
modules/home/helix/layout.kdl
···
···
+
// Zellij layout for an IDE like interface around helix with terminal, treeview and helix itself
+
layout {
+
pane split_direction="vertical" {
+
pane size=35 command="broot"
+
pane split_direction="horizontal" {
+
pane command="hx"
+
pane size="25%" name="term"
+
}
+
}
+
pane size=1 borderless=true {
+
plugin location="status-bar"
+
}
+
}
+1
modules/home/helix/zellij-config.kdl
···
···
+
show_startup_tips false