Skip to content

Commit

Permalink
merge: pull request #61 from dixslyf/zellij
Browse files Browse the repository at this point in the history
Add Zellij
  • Loading branch information
dixslyf committed Jul 19, 2024
2 parents 612d863 + efa308b commit dbec796
Show file tree
Hide file tree
Showing 6 changed files with 68 additions and 8 deletions.
1 change: 1 addition & 0 deletions home-manager/users/shiba/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@
systemd.target = "hyprland-session.target";
};
yuzu.enable = false; # FIXME: Wait for the dust to settle.
zellij.enable = true;
zotero.enable = true;
zoxide.enable = true;
};
Expand Down
1 change: 1 addition & 0 deletions planet/modules/home-manager/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ _:
./xdg-terminal-exec
./yuzu
(importModule ./zathura { })
./zellij
./zotero
./zoxide
];
Expand Down
26 changes: 19 additions & 7 deletions planet/modules/home-manager/wezterm/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,17 @@
inherit (lib)
mkIf
mkMerge;

mkConfigFile = default_prog_args:
let
substituted = pkgs.substituteAll {
src = ./wezterm.fnl;
inherit default_prog_args;
};
in
pkgs.runCommand "wezterm.lua" { } ''
${pkgs.luaPackages.fennel}/bin/fennel --compile ${substituted} > "$out"
'';
in
mkIf cfg.enable (mkMerge [
{
Expand All @@ -33,15 +44,16 @@
programs.wezterm = {
enable = true;
};

xdg.configFile."wezterm/wezterm.lua".source = pkgs.substituteAll {
src = pkgs.runCommand "wezterm.lua" { } ''
${pkgs.luaPackages.fennel}/bin/fennel --compile ${./wezterm.fnl} > "$out"
'';
default_shell = "${pkgs.fish}/bin/fish";
};
}

(mkIf config.planet.zellij.enable {
xdg.configFile."wezterm/wezterm.lua".source = mkConfigFile ''"${pkgs.zellij}/bin/zellij"'';
})

(mkIf (!config.planet.zellij.enable) {
xdg.configFile."wezterm/wezterm.lua".source = mkConfigFile ''"${pkgs.fish}/bin/fish" "-l"'';
})

(mkIf cfg.defaultTerminal {
planet.default-terminal = {
startCommand = ''
Expand Down
2 changes: 1 addition & 1 deletion planet/modules/home-manager/wezterm/wezterm.fnl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

(local wezterm (require :wezterm))

{:default_prog ["@default_shell@" "-l"]
{:default_prog [@default_prog_args@]
:launch_menu [{:label "Bash" :args ["bash" "-l"]}]
:color_scheme "Catppuccin Macchiato"
:font (wezterm.font_with_fallback ["Iosevka Term Custom"
Expand Down
11 changes: 11 additions & 0 deletions planet/modules/home-manager/zellij/config.kdl
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
default_shell "fish"

pane_frames false

serialize_pane_viewport true

theme "catppuccin-macchiato"

default_layout "compact"

disable_session_metadata true
35 changes: 35 additions & 0 deletions planet/modules/home-manager/zellij/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{ config
, pkgs
, lib
, ...
}: {
options =
let
inherit (lib) mkEnableOption;
in
{
planet.zellij = {
enable = mkEnableOption "planet zellij";
};
};

config =
let
cfg = config.planet.zellij;
inherit (lib) mkIf;

in
mkIf cfg.enable {
home.packages = with pkgs; [
zellij
];

planet.persistence = {
directories = [
".cache/zellij"
];
};

xdg.configFile."zellij/config.kdl".source = ./config.kdl;
};
}

0 comments on commit dbec796

Please sign in to comment.