From ed79106342732a9fd6f9eb5cd8da2c774a043899 Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Mon, 1 Sep 2025 01:18:27 +0200 Subject: [PATCH] feat(desktop): make icon theme configurable --- modules/home-manager/desktop/sway/default.nix | 22 +++++++++++++++++-- .../desktop/sway/includes/mako.nix | 8 ++++--- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/modules/home-manager/desktop/sway/default.nix b/modules/home-manager/desktop/sway/default.nix index 024cb23..b3950e7 100644 --- a/modules/home-manager/desktop/sway/default.nix +++ b/modules/home-manager/desktop/sway/default.nix @@ -46,6 +46,24 @@ in }; }; + iconTheme = mkOption { + type = types.package; + default = pkgs.papirus-icon-theme; + description = ''Icon theme package to use''; + }; + + iconThemeName = mkOption { + type = types.str; + default = "Papirus Dark"; + description = ''Icon theme variant to use''; + }; + + iconThemePathname = mkOption { + type = types.str; + default = "Papirus-Dark"; + description = ''Icon theme variant to use''; + }; + waybar = { laptop = mkOption { type = types.bool; @@ -136,8 +154,8 @@ in package = pkgs.arc-theme; }; iconTheme = { - name = "Papirus Dark"; - package = pkgs.papirus-icon-theme; + name = cfg.iconThemeName; + package = cfg.iconTheme; }; font = { name = "Deja Vu Sans"; diff --git a/modules/home-manager/desktop/sway/includes/mako.nix b/modules/home-manager/desktop/sway/includes/mako.nix index 3b8d3df..b098010 100644 --- a/modules/home-manager/desktop/sway/includes/mako.nix +++ b/modules/home-manager/desktop/sway/includes/mako.nix @@ -1,5 +1,8 @@ { config, pkgs, lib, ... }: with lib; +let + cfg = config.modules.desktop.sway; +in { config = mkIf config.modules.desktop.sway.enable { systemd.user.services.mako = { @@ -24,12 +27,11 @@ with lib; border-radius = 0; border-size = 2; icons = true; + icon-path = "${cfg.iconTheme}/share/icons/${cfg.iconThemePathname}"; max-icon-size = 64; layer = "overlay"; anchor = "top-right"; - format = '' - %a\n%s\n%b - ''; + format = ''%a\n%s\n%b''; "urgency=high" = { border-color = "#F268b3"; };