From 92ae1a8d73d68ebf51e008cd6322a9269cd10325 Mon Sep 17 00:00:00 2001 From: Alpha-Ursae-Minoris <100356220+Alpha-Ursae-Minoris@users.noreply.github.com> Date: Tue, 2 Jul 2024 13:38:35 +0000 Subject: [PATCH] feat(nix): home-manager option to read style.css file --- flake.nix | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/flake.nix b/flake.nix index ac2a5ea2..0e7a8ad0 100644 --- a/flake.nix +++ b/flake.nix @@ -162,7 +162,7 @@ }; style = lib.mkOption { - type = lib.types.lines; + type = lib.types.either (lib.types.lines) (lib.types.path); default = ""; description = "The stylesheet to apply to ironbar."; }; @@ -189,8 +189,12 @@ source = jsonFormat.generate "ironbar-config" cfg.config; }; - "ironbar/style.css" = - lib.mkIf (cfg.style != "") { text = cfg.style; }; + "ironbar/style.css" = lib.mkIf (cfg.style != "") ( + if builtins.isPath cfg.style || lib.isStorePath cfg.style then + { source = cfg.style; } + else + { text = cfg.style; } + ); }; systemd.user.services.ironbar = lib.mkIf cfg.systemd {