If I can find out how to make it work without the double definition
i'll be happy
This commit is contained in:
parent
47fa902c75
commit
f350f26baf
6 changed files with 13 additions and 9 deletions
|
|
@ -25,12 +25,12 @@ in
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
modules = {
|
modules = {
|
||||||
waybar = {
|
waybar = {
|
||||||
enable = lib.mkDefault true;
|
|
||||||
modules = {
|
modules = {
|
||||||
left = [ "hyprland/workspaces" "tray" "hyprland/window" ];
|
left = [ "hyprland/workspaces" "tray" "hyprland/window" ];
|
||||||
center = [ "clock" ];
|
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;
|
wofi.enable = lib.mkDefault true;
|
||||||
dunst.enable = lib.mkDefault true;
|
dunst.enable = lib.mkDefault true;
|
||||||
|
|
|
||||||
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, ... }:
|
{ config, pkgs, lib, ... }:
|
||||||
let
|
let
|
||||||
cfg = config.modules.waybar;
|
cfg = config.modules.waybar;
|
||||||
|
|
||||||
ifIsDef = name: builtins.any (row: builtins.any (x: x == name) row) (with cfg.modules; [left center right]);
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.modules.waybar = {
|
options.modules.waybar = {
|
||||||
|
|
@ -42,10 +40,7 @@ in
|
||||||
];
|
];
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
modules.waybar = {
|
modules.waybar = import ./createmodules.nix cfg.modules;
|
||||||
clock.enable = ifIsDef "clock";
|
|
||||||
"hyprland/workspaces".enable = ifIsDef "hyprland/workspaces";
|
|
||||||
};
|
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
font-awesome
|
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}" = {
|
programs.waybar.settings.mainBar."${name}" = {
|
||||||
format = "";
|
format = "";
|
||||||
on-click = "wofi-power";
|
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