If I can find out how to make it work without the double definition

i'll be happy
This commit is contained in:
Noa Aarts 2024-04-05 13:58:29 +02:00
parent 47fa902c75
commit f350f26baf
6 changed files with 13 additions and 9 deletions

View file

@ -25,12 +25,12 @@ in
config = lib.mkIf cfg.enable {
modules = {
waybar = {
enable = lib.mkDefault true;
modules = {
left = [ "hyprland/workspaces" "tray" "hyprland/window" ];
center = [ "clock" ];
right = [ "custom/vpn" "wireplumber" "network" "cpu" "memory" "temperature" "custom/poweroff" ];
right = [ "custom/vpn" "wireplumber" "network" "cpu" "memory" "custom/poweroff" ];
};
enable = lib.mkDefault true;
};
wofi.enable = lib.mkDefault true;
dunst.enable = lib.mkDefault true;

View file

@ -0,0 +1,4 @@
config:
[ "hyprland/workspaces" "tray" "hyprland/window" ] ++
[ "clock" ] ++
[ "custom/vpn" "wireplumber" "network" "cpu" "memory" "custom/poweroff" ]

View file

@ -0,0 +1 @@
config: builtins.listToAttrs (import ./namedmodules.nix config)

View file

@ -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
];

View file

@ -0,0 +1,4 @@
config:
builtins.map
(n: {name = n; value = {enable = true;}; })
(import ./allmodules.nix config)

View file

@ -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
};
};
}