1
0
Fork 0
dotfiles/home/programs/wezterm.nix

59 lines
1.3 KiB
Nix
Raw Normal View History

2023-09-09 17:54:02 +00:00
{ pkgs, config, ... }:
2022-12-19 21:02:48 +00:00
2023-09-07 13:13:43 +00:00
let
wezterm-pkg = pkgs.wezterm;
2023-09-09 17:54:02 +00:00
wezterm-nushell = pkgs.writeShellScript "wezterm-nushell.sh" ''
source /etc/static/bashrc
source ${config.home.sessionVariablesPackage}/etc/profile.d/hm-session-vars.sh
exec ${pkgs.nushell.outPath}/bin/nu
'';
2023-09-07 13:13:43 +00:00
in
2022-12-19 21:02:48 +00:00
{
programs.wezterm = {
enable = true;
2023-09-07 13:13:43 +00:00
package = wezterm-pkg;
extraConfig = /* lua */ ''
2022-12-20 16:46:51 +00:00
_G.shells = {
2023-09-09 17:54:02 +00:00
bash = '${pkgs.bash.outPath}/bin/bash',
2022-12-20 16:46:51 +00:00
fish = '${pkgs.fish.outPath}/bin/fish',
2023-09-09 17:54:02 +00:00
nushell = '${wezterm-nushell}',
2022-12-20 16:46:51 +00:00
};
_G.programs = {
btop = '${pkgs.btop.outPath}/bin/btop',
};
2022-12-19 21:02:48 +00:00
local cfg = require('config');
return cfg
'';
};
xdg.configFile."wezterm" = {
source = pkgs.runCommand "wezterm-fennel-files"
{
nativeBuildInputs = with pkgs; [ lua53Packages.fennel stylua ];
} ''
mkdir -p $out
config_store_path="${../config/wezterm}"
fennel="fennel --use-bit-lib --compile"
echo "Using fennel command: $fennel"
# Change PWD to config directory
cd "$config_store_path"
# Init
echo "Compiling init.fnl ..."
$fennel "$config_store_path/config.fnl" > "$out/config.lua"
stylua "$out/"
'';
recursive = true;
};
}