{ config, pkgs, lib, ... }: { options = { programs.eww.widgets = lib.mkOption { type = lib.types.listOf lib.types.str; default = [ ]; }; }; config = { home = { packages = with pkgs; [ # For Noto Sans NF nerd-fonts.noto ]; file.".config/eww".source = ./config; }; programs.eww = { enable = true; }; systemd.user.services.eww = lib.mkIf (config.programs.eww.widgets != [ ]) { Unit = { Description = "Eww widgets"; After = [ "hyprland-session.target" ]; # Start only after hyprland PartOf = [ "hyprland-session.target" ]; # Force it to exit if hyprland does }; Service = { Type = "oneshot"; RemainAfterExit = true; ExecStart = "${pkgs.eww}/bin/eww open-many ${lib.concatStringsSep " " config.programs.eww.widgets}"; ExecStop = "${pkgs.eww}/bin/eww kill"; }; Install = { WantedBy = [ "hyprland-session.target" ]; }; }; }; }