Skip to content

Commit dbec796

Browse files
authored
merge: pull request #61 from dixslyf/zellij
Add Zellij
2 parents 612d863 + efa308b commit dbec796

File tree

6 files changed

+68
-8
lines changed

6 files changed

+68
-8
lines changed

home-manager/users/shiba/default.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@
154154
systemd.target = "hyprland-session.target";
155155
};
156156
yuzu.enable = false; # FIXME: Wait for the dust to settle.
157+
zellij.enable = true;
157158
zotero.enable = true;
158159
zoxide.enable = true;
159160
};

planet/modules/home-manager/default.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ _:
6060
./xdg-terminal-exec
6161
./yuzu
6262
(importModule ./zathura { })
63+
./zellij
6364
./zotero
6465
./zoxide
6566
];

planet/modules/home-manager/wezterm/default.nix

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,17 @@
2121
inherit (lib)
2222
mkIf
2323
mkMerge;
24+
25+
mkConfigFile = default_prog_args:
26+
let
27+
substituted = pkgs.substituteAll {
28+
src = ./wezterm.fnl;
29+
inherit default_prog_args;
30+
};
31+
in
32+
pkgs.runCommand "wezterm.lua" { } ''
33+
${pkgs.luaPackages.fennel}/bin/fennel --compile ${substituted} > "$out"
34+
'';
2435
in
2536
mkIf cfg.enable (mkMerge [
2637
{
@@ -33,15 +44,16 @@
3344
programs.wezterm = {
3445
enable = true;
3546
};
36-
37-
xdg.configFile."wezterm/wezterm.lua".source = pkgs.substituteAll {
38-
src = pkgs.runCommand "wezterm.lua" { } ''
39-
${pkgs.luaPackages.fennel}/bin/fennel --compile ${./wezterm.fnl} > "$out"
40-
'';
41-
default_shell = "${pkgs.fish}/bin/fish";
42-
};
4347
}
4448

49+
(mkIf config.planet.zellij.enable {
50+
xdg.configFile."wezterm/wezterm.lua".source = mkConfigFile ''"${pkgs.zellij}/bin/zellij"'';
51+
})
52+
53+
(mkIf (!config.planet.zellij.enable) {
54+
xdg.configFile."wezterm/wezterm.lua".source = mkConfigFile ''"${pkgs.fish}/bin/fish" "-l"'';
55+
})
56+
4557
(mkIf cfg.defaultTerminal {
4658
planet.default-terminal = {
4759
startCommand = ''

planet/modules/home-manager/wezterm/wezterm.fnl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
(local wezterm (require :wezterm))
44

5-
{:default_prog ["@default_shell@" "-l"]
5+
{:default_prog [@default_prog_args@]
66
:launch_menu [{:label "Bash" :args ["bash" "-l"]}]
77
:color_scheme "Catppuccin Macchiato"
88
:font (wezterm.font_with_fallback ["Iosevka Term Custom"
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
default_shell "fish"
2+
3+
pane_frames false
4+
5+
serialize_pane_viewport true
6+
7+
theme "catppuccin-macchiato"
8+
9+
default_layout "compact"
10+
11+
disable_session_metadata true
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{ config
2+
, pkgs
3+
, lib
4+
, ...
5+
}: {
6+
options =
7+
let
8+
inherit (lib) mkEnableOption;
9+
in
10+
{
11+
planet.zellij = {
12+
enable = mkEnableOption "planet zellij";
13+
};
14+
};
15+
16+
config =
17+
let
18+
cfg = config.planet.zellij;
19+
inherit (lib) mkIf;
20+
21+
in
22+
mkIf cfg.enable {
23+
home.packages = with pkgs; [
24+
zellij
25+
];
26+
27+
planet.persistence = {
28+
directories = [
29+
".cache/zellij"
30+
];
31+
};
32+
33+
xdg.configFile."zellij/config.kdl".source = ./config.kdl;
34+
};
35+
}

0 commit comments

Comments
 (0)