Skip to content

Commit

Permalink
feat(nix): home-manager option to read style.css file
Browse files Browse the repository at this point in the history
  • Loading branch information
Alpha-Ursae-Minoris authored Jul 2, 2024
1 parent 6a06fa5 commit 92ae1a8
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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.";
};
Expand All @@ -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 {
Expand Down

0 comments on commit 92ae1a8

Please sign in to comment.