feat: waybar

This commit is contained in:
punkfairie 2025-05-26 16:24:59 -07:00
parent 57b58d78ea
commit da9ca5a563
Signed by: punkfairie
GPG key ID: B3C5488E9A1A7CA6
6 changed files with 53 additions and 25 deletions

View file

@ -1,19 +1,23 @@
{ {
lib, marleylib,
config, config,
osConfig,
lib,
pkgs, pkgs,
... ...
}: let }: let
cfg = config.marleyos.programs.waybar; inherit (marleylib.module) mkEnableOption';
in {
options.marleyos.programs.waybar = {
enable = lib.mkEnableOption "waybar";
};
config = lib.mkIf cfg.enable { cfg = config.marleyos.programs.waybar;
osCfg = osConfig.marleyos.programs.waybar;
in {
options.marleyos.programs.waybar.enable =
mkEnableOption' "waybar" osCfg.enable;
config = lib.mkIf (cfg.enable && pkgs.stdenv.isLinux) {
marleyos = { marleyos = {
services.swaync.enable = true; # services.swaync.enable = true;
programs.wlogout.enable = true; # programs.wlogout.enable = true;
}; };
stylix.targets.waybar.addCss = false; stylix.targets.waybar.addCss = false;
@ -26,9 +30,10 @@ in {
settings = let settings = let
niri = niri =
config.programs.niri config.programs.niri
# HM module doesn't include an enable option... # HM module doesn't include an enable option when imported by nixOS
# module...
// { // {
enable = config.marleyos.wayland.niri.enable; inherit (config.marleyos.shell.niri) enable;
}; };
in [ in [
{ {
@ -47,18 +52,16 @@ in {
"cpu" "cpu"
"memory" "memory"
]; ];
modules-center = modules-center = lib.optionals niri.enable [
[]
++ (lib.optionals niri.enable [
"niri/workspaces" "niri/workspaces"
]); ];
modules-right = modules-right =
[ [
"mpd" "mpd"
"custom/notifications" "custom/notifications"
"tray" "tray"
] ]
++ (lib.optionals (!config.marleyos.isDesktop) [ ++ (lib.optionals config.marleycfg.profiles.laptop [
"battery" "battery"
]) ])
++ [ ++ [
@ -71,7 +74,7 @@ in {
tooltip = false; tooltip = false;
format = ""; format = "";
on-click = let on-click = let
inherit (config.marleyos.apps) launcher; inherit (config.marleycfg.apps) launcher;
in "sleep 0.1 && ${lib.getExe launcher.package} ${launcher.command}"; in "sleep 0.1 && ${lib.getExe launcher.package} ${launcher.command}";
}; };

View file

@ -24,12 +24,12 @@ in {
config = lib.mkIf (cfg.enable && pkgs.stdenv.isLinux) { config = lib.mkIf (cfg.enable && pkgs.stdenv.isLinux) {
marleyos = { marleyos = {
shell.wayland = enabled; shell.wayland = enabled;
# programs = { programs = {
# waybar = enabled; waybar = enabled;
# wlogout = enabled; # wlogout = enabled;
# fuzzel = enabled; # fuzzel = enabled;
# xwayland-satellite = enabled; # xwayland-satellite = enabled;
# }; };
# services = { # services = {
# swaybg = enabled; # swaybg = enabled;
# swaync = enabled; # swaync = enabled;

View file

@ -2,5 +2,6 @@
imports = [ imports = [
./fish.nix ./fish.nix
./nh.nix ./nh.nix
./waybar.nix
]; ];
} }

View file

@ -0,0 +1,15 @@
{
lib,
config,
...
}: let
cfg = config.marleyos.programs.waybar;
in {
options.marleyos.programs.waybar.enable = lib.mkEnableOption "waybar";
config = lib.mkIf cfg.enable {
programs.waybar = {
enable = true;
};
};
}

View file

@ -1,17 +1,25 @@
{ {
config, config,
marleylib,
lib, lib,
inputs, inputs,
... ...
}: let }: let
cfg = config.marleyos.shell.niri; cfg = config.marleyos.shell.niri;
inherit (marleylib.module) enabled;
in { in {
options.marleyos.shell.niri.enable = lib.mkEnableOption "niri"; options.marleyos.shell.niri.enable = lib.mkEnableOption "niri";
imports = [inputs.niri-flake.nixosModules.niri]; imports = [inputs.niri-flake.nixosModules.niri];
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
marleyos.shell.hyprlock.enable = true; marleyos = {
shell.hyprlock = enabled;
programs = {
waybar = enabled;
};
};
programs.niri = { programs.niri = {
enable = true; enable = true;

View file

@ -7,6 +7,7 @@
in { in {
options.marleycfg.profiles = { options.marleycfg.profiles = {
desktop = lib.mkEnableOption "graphical desktop profile"; desktop = lib.mkEnableOption "graphical desktop profile";
laptop = lib.mkEnableOption "laptop profile";
server = lib.mkEnableOption "server profile"; server = lib.mkEnableOption "server profile";
}; };