1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-11-08 11:36:05 +01:00

zellij: Allow using extraConfig without settings

Fixes https://github.com/nix-community/home-manager/issues/8015
This commit is contained in:
Dietrich Daroch 2025-10-19 11:40:58 -03:00 committed by Austin Horstman
parent c3a5e5f0df
commit 84e1adb0cd
5 changed files with 61 additions and 5 deletions

View file

@ -274,12 +274,15 @@ in
{
"zellij/config.yaml" =
mkIf (cfg.settings != { } && (lib.versionOlder cfg.package.version "0.32.0"))
mkIf ((lib.versionOlder cfg.package.version "0.32.0") && cfg.settings != { })
{
source = yamlFormat.generate "zellij.yaml" cfg.settings;
};
"zellij/config.kdl" =
mkIf (cfg.settings != { } && (lib.versionAtLeast cfg.package.version "0.32.0"))
mkIf
(
(lib.versionAtLeast cfg.package.version "0.32.0") && (cfg.settings != { } || cfg.extraConfig != "")
)
{
text =
(lib.hm.generators.toKDL { } cfg.settings)

View file

@ -0,0 +1,29 @@
{
programs = {
zellij = {
enable = true;
# No `settings`
extraConfig = ''
This_could_have_been_json {
}
'';
};
};
test.stubs = {
zellij = { };
};
nmt.script = ''
assertFileExists home-files/.config/zellij/config.kdl
assertFileContains \
home-files/.config/zellij/config.kdl \
'// extraConfig'
assertFileContains \
home-files/.config/zellij/config.kdl \
'This_could_have_been_json'
'';
}

View file

@ -1,5 +1,3 @@
{ lib, ... }:
{
programs = {
zellij = {

View file

@ -0,0 +1,24 @@
{
programs = {
zellij = {
enable = true;
settings = {
default_layout = "welcome";
};
# No extraConfig
};
};
test.stubs = {
zellij = { };
};
nmt.script = ''
assertFileExists home-files/.config/zellij/config.kdl
assertFileContains \
home-files/.config/zellij/config.kdl \
'default_layout "welcome"'
'';
}

View file

@ -1,5 +1,7 @@
{
zellij-config = ./config.nix;
zellij-config-mixed = ./config-mixed.nix;
zellij-config-settings = ./config-settings.nix;
zellij-config-extra_config = ./config-extra_config.nix;
zellij-enable-shells = ./enable-shells.nix;
zellij-layout = ./layout.nix;
zellij-theme = ./theme.nix;