diff --git a/modules/lib/maintainers.nix b/modules/lib/maintainers.nix index 05d82c72e..68aa063da 100644 --- a/modules/lib/maintainers.nix +++ b/modules/lib/maintainers.nix @@ -395,6 +395,12 @@ githubId = 56614642; name = "Ilan Joselevich"; }; + kiara = { + name = "kiara"; + email = "cinereal@riseup.net"; + github = "KiaraGrouwstra"; + githubId = 3059397; + }; mager = { email = "andreas@mager.eu"; github = "AndreasMager"; diff --git a/modules/misc/news.nix b/modules/misc/news.nix index a3fb800f0..cf13538dd 100644 --- a/modules/misc/news.nix +++ b/modules/misc/news.nix @@ -2140,6 +2140,15 @@ in { you can use `lib.mkOrder` to specify the order of the content you want to insert. ''; } + + { + time = "2025-03-"; + message = '' + A new module is available: 'programs.wallust'. + + Wallust generates colors from an images, similar to pywal. + ''; + } ]; }; } diff --git a/modules/modules.nix b/modules/modules.nix index eef32d196..5fdb49699 100644 --- a/modules/modules.nix +++ b/modules/modules.nix @@ -267,6 +267,7 @@ let ./programs/vscode/haskell.nix ./programs/pywal.nix ./programs/rbenv.nix + ./programs/wallust.nix ./programs/watson.nix ./programs/waybar.nix ./programs/wezterm.nix diff --git a/modules/programs/wallust.nix b/modules/programs/wallust.nix new file mode 100644 index 000000000..4bcb51209 --- /dev/null +++ b/modules/programs/wallust.nix @@ -0,0 +1,46 @@ +{ + pkgs, + lib, + config, + ... +}: + +let + inherit (lib) + mkEnableOption + mkPackageOption + mkOption + mkIf + literalExpression + ; + cfg = config.programs.wallust; + tomlFormat = pkgs.formats.toml { }; +in +{ + meta.maintainers = with lib.hm.maintainers; [ kiara ]; + + options.programs.wallust = { + enable = mkEnableOption "Wallust color scheme generator"; + package = mkPackageOption pkgs "wallust" { }; + settings = mkOption { + type = tomlFormat.type; + default = { }; + example = literalExpression '' + { + palette = "softdark"; + } + ''; + description = '' + Configuration written to {file}`$XDG_CONFIG_HOME/wallust/wallust.toml`. + See for + documentation. + ''; + }; + }; + config = mkIf cfg.enable { + home.packages = [ cfg.package ]; + xdg.configFile."wallust/wallust.toml" = mkIf (cfg.settings != { }) { + source = tomlFormat.generate "wallust.toml" cfg.settings; + }; + }; +} diff --git a/tests/default.nix b/tests/default.nix index 0949936a5..4ee1e6975 100644 --- a/tests/default.nix +++ b/tests/default.nix @@ -394,6 +394,7 @@ in import nmtSrc { ./modules/programs/vifm ./modules/programs/vim-vint ./modules/programs/vscode + ./modules/programs/wallust ./modules/programs/watson ./modules/programs/wezterm ./modules/programs/yazi diff --git a/tests/modules/programs/wallust/default.nix b/tests/modules/programs/wallust/default.nix new file mode 100644 index 000000000..955a72e1d --- /dev/null +++ b/tests/modules/programs/wallust/default.nix @@ -0,0 +1,3 @@ +{ + wallust = ./wallust.nix; +} diff --git a/tests/modules/programs/wallust/expected.toml b/tests/modules/programs/wallust/expected.toml new file mode 100644 index 000000000..8991d7bb9 --- /dev/null +++ b/tests/modules/programs/wallust/expected.toml @@ -0,0 +1,2 @@ +backend = "fastresize" +color_space = "lchmixed" diff --git a/tests/modules/programs/wallust/wallust.nix b/tests/modules/programs/wallust/wallust.nix new file mode 100644 index 000000000..eaf9048af --- /dev/null +++ b/tests/modules/programs/wallust/wallust.nix @@ -0,0 +1,16 @@ +{ + home.enableNixpkgsReleaseCheck = false; + programs.wallust = { + enable = true; + backend = "full"; + settings = { + backend = "fastresize"; + color_space = "lchmixed"; + }; + }; + + nmt.script = '' + assertFileExists home-files/.config/wallust/wallust.toml + assertFileContent home-files/.config/wallust/wallust.toml ${./expected.toml} + ''; +}