[Hyprland,Eww] Refactors configs so that I can share more between Vega and Altair
This commit is contained in:
@@ -1,15 +1,48 @@
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
home = {
|
||||
packages = with pkgs; [
|
||||
# For Noto Sans NF
|
||||
nerd-fonts.noto
|
||||
];
|
||||
|
||||
file.".config/eww".source = ./config;
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
options = {
|
||||
programs.eww.widgets = lib.mkOption {
|
||||
type = lib.types.listOf lib.types.str;
|
||||
default = [ ];
|
||||
};
|
||||
};
|
||||
|
||||
programs.eww = {
|
||||
enable = true;
|
||||
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 ${lib.concatStringsSep " " config.programs.eww.widgets}";
|
||||
ExecStop = "${pkgs.eww}/bin/eww kill";
|
||||
};
|
||||
|
||||
Install = {
|
||||
WantedBy = [ "hyprland-session.target" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user