If I can find out how to make it work without the double definition
i'll be happy
This commit is contained in:
parent
e7608a6c3d
commit
578cb7f3a9
6 changed files with 13 additions and 9 deletions
4
modules/waybar/allmodules.nix
Normal file
4
modules/waybar/allmodules.nix
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
config:
|
||||
[ "hyprland/workspaces" "tray" "hyprland/window" ] ++
|
||||
[ "clock" ] ++
|
||||
[ "custom/vpn" "wireplumber" "network" "cpu" "memory" "custom/poweroff" ]
|
||||
1
modules/waybar/createmodules.nix
Normal file
1
modules/waybar/createmodules.nix
Normal file
|
|
@ -0,0 +1 @@
|
|||
config: builtins.listToAttrs (import ./namedmodules.nix config)
|
||||
|
|
@ -1,8 +1,6 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
let
|
||||
cfg = config.modules.waybar;
|
||||
|
||||
ifIsDef = name: builtins.any (row: builtins.any (x: x == name) row) (with cfg.modules; [left center right]);
|
||||
in
|
||||
{
|
||||
options.modules.waybar = {
|
||||
|
|
@ -42,10 +40,7 @@ in
|
|||
];
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
modules.waybar = {
|
||||
clock.enable = ifIsDef "clock";
|
||||
"hyprland/workspaces".enable = ifIsDef "hyprland/workspaces";
|
||||
};
|
||||
modules.waybar = import ./createmodules.nix cfg.modules;
|
||||
home.packages = with pkgs; [
|
||||
font-awesome
|
||||
];
|
||||
|
|
|
|||
4
modules/waybar/namedmodules.nix
Normal file
4
modules/waybar/namedmodules.nix
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
config:
|
||||
builtins.map
|
||||
(n: {name = n; value = {enable = true;}; })
|
||||
(import ./allmodules.nix config)
|
||||
|
|
@ -15,7 +15,7 @@ in
|
|||
programs.waybar.settings.mainBar."${name}" = {
|
||||
format = "";
|
||||
on-click = "wofi-power";
|
||||
# on-click-right = "swaylock"; # TODO: change to whatever lock screen i want
|
||||
on-click-right = "swaylock"; # TODO: change to whatever lock screen i want
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue