feat(desktop): move status-bar config to homes and use home-manager modules
This commit is contained in:
parent
d09d6d37d7
commit
2369c0d37e
7 changed files with 75 additions and 64 deletions
|
@ -27,7 +27,16 @@ let
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
config = mkMerge [
|
config = mkMerge [
|
||||||
(mkIf osConfig.desktop.enable (import ./desktop { inherit lib inputs system; }))
|
(mkIf osConfig.desktop.enable (
|
||||||
|
import ./desktop {
|
||||||
|
inherit
|
||||||
|
lib
|
||||||
|
inputs
|
||||||
|
system
|
||||||
|
pkgs
|
||||||
|
;
|
||||||
|
}
|
||||||
|
))
|
||||||
(mkIf osConfig.desktop.enable {
|
(mkIf osConfig.desktop.enable {
|
||||||
home.persistence."/persist/home/rafiq".directories = [
|
home.persistence."/persist/home/rafiq".directories = [
|
||||||
"docs"
|
"docs"
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
{
|
{
|
||||||
|
pkgs,
|
||||||
lib,
|
lib,
|
||||||
inputs,
|
inputs,
|
||||||
system,
|
system,
|
||||||
|
@ -12,4 +13,5 @@ mkMerge [
|
||||||
(import ./lockscreen.nix)
|
(import ./lockscreen.nix)
|
||||||
(import ./launcher.nix)
|
(import ./launcher.nix)
|
||||||
(import ./media-player.nix)
|
(import ./media-player.nix)
|
||||||
|
(import ./status-bar.nix { inherit pkgs; })
|
||||||
]
|
]
|
||||||
|
|
50
homes/x86_64-linux/rafiq/desktop/status-bar.nix
Normal file
50
homes/x86_64-linux/rafiq/desktop/status-bar.nix
Normal file
|
@ -0,0 +1,50 @@
|
||||||
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
|
home.sessionVariables.STATUS_BAR = "waybar";
|
||||||
|
programs.waybar = {
|
||||||
|
settings = [
|
||||||
|
{
|
||||||
|
layer = "top";
|
||||||
|
modules-left = [
|
||||||
|
"pulseaudio"
|
||||||
|
];
|
||||||
|
modules-right = [
|
||||||
|
"battery"
|
||||||
|
"clock"
|
||||||
|
];
|
||||||
|
"pulseaudio" = {
|
||||||
|
format = "{icon} {volume}%";
|
||||||
|
format-muted = "";
|
||||||
|
format-icons.default = [
|
||||||
|
""
|
||||||
|
""
|
||||||
|
];
|
||||||
|
on-click = "${pkgs.pulseaudio}/bin/pactl set-sink-mute @DEFAULT_SINK@ toggle";
|
||||||
|
};
|
||||||
|
"clock" = {
|
||||||
|
interval = 1;
|
||||||
|
format = "{:%F %T}";
|
||||||
|
};
|
||||||
|
"battery" = {
|
||||||
|
interval = 1;
|
||||||
|
bat-compatibility = true;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
];
|
||||||
|
style = # css
|
||||||
|
''
|
||||||
|
window#waybar {
|
||||||
|
background-color: rgba(0, 0, 0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
#pulseaudio,
|
||||||
|
#battery,
|
||||||
|
#clock {
|
||||||
|
padding-top: 5px;
|
||||||
|
padding-bottom: 5px;
|
||||||
|
padding-right: 5px;
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
|
@ -1,61 +0,0 @@
|
||||||
{
|
|
||||||
pkgs,
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
osConfig,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
{
|
|
||||||
config = lib.mkMerge [
|
|
||||||
(lib.mkIf (osConfig.desktop.status-bar == "waybar") {
|
|
||||||
home.sessionVariables.STATUS_BAR = "waybar";
|
|
||||||
programs.waybar = {
|
|
||||||
enable = true;
|
|
||||||
settings = [
|
|
||||||
{
|
|
||||||
layer = "top";
|
|
||||||
modules-left = [
|
|
||||||
"pulseaudio"
|
|
||||||
];
|
|
||||||
modules-right = [
|
|
||||||
"battery"
|
|
||||||
"clock"
|
|
||||||
];
|
|
||||||
"pulseaudio" = {
|
|
||||||
format = "{icon} {volume}%";
|
|
||||||
format-muted = "";
|
|
||||||
format-icons.default = [
|
|
||||||
""
|
|
||||||
""
|
|
||||||
];
|
|
||||||
on-click = "${pkgs.pulseaudio}/bin/pactl set-sink-mute @DEFAULT_SINK@ toggle";
|
|
||||||
};
|
|
||||||
"clock" = {
|
|
||||||
interval = 1;
|
|
||||||
format = "{:%F %T}";
|
|
||||||
};
|
|
||||||
"battery" = {
|
|
||||||
interval = 1;
|
|
||||||
bat-compatibility = true;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
];
|
|
||||||
style = # css
|
|
||||||
''
|
|
||||||
window#waybar {
|
|
||||||
background-color: rgba(0, 0, 0, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
#pulseaudio,
|
|
||||||
#battery,
|
|
||||||
#clock {
|
|
||||||
padding-top: 5px;
|
|
||||||
padding-bottom: 5px;
|
|
||||||
padding-right: 5px;
|
|
||||||
color: #ffffff;
|
|
||||||
}
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
})
|
|
||||||
];
|
|
||||||
}
|
|
|
@ -23,7 +23,6 @@ in
|
||||||
};
|
};
|
||||||
windowManager = lib.pantheon.mkStrOption;
|
windowManager = lib.pantheon.mkStrOption;
|
||||||
terminal = lib.pantheon.mkStrOption;
|
terminal = lib.pantheon.mkStrOption;
|
||||||
status-bar = lib.pantheon.mkStrOption;
|
|
||||||
enableSpotifyd = lib.mkEnableOption "";
|
enableSpotifyd = lib.mkEnableOption "";
|
||||||
enableSteam = lib.mkEnableOption "";
|
enableSteam = lib.mkEnableOption "";
|
||||||
enableVR = lib.mkEnableOption "";
|
enableVR = lib.mkEnableOption "";
|
||||||
|
|
12
modules/nixos/desktop/status-bar/default.nix
Normal file
12
modules/nixos/desktop/status-bar/default.nix
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
{ config, lib, ... }:
|
||||||
|
let
|
||||||
|
inherit (lib) mkEnableOption singleton;
|
||||||
|
cfg = config.desktop.status-bar;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.desktop.status-bar = {
|
||||||
|
waybar.enable = mkEnableOption "";
|
||||||
|
};
|
||||||
|
|
||||||
|
config.home-manager.sharedModules = singleton { programs.waybar.enable = cfg.waybar.enable; };
|
||||||
|
}
|
|
@ -6,9 +6,9 @@
|
||||||
launcher.fuzzel.enable = true;
|
launcher.fuzzel.enable = true;
|
||||||
media-player.vlc.enable = true;
|
media-player.vlc.enable = true;
|
||||||
notification-daemon.mako.enable = true;
|
notification-daemon.mako.enable = true;
|
||||||
|
status-bar.waybar.enable = true;
|
||||||
windowManager = "hyprland";
|
windowManager = "hyprland";
|
||||||
terminal = "ghostty";
|
terminal = "ghostty";
|
||||||
status-bar = "waybar";
|
|
||||||
mainMonitor = {
|
mainMonitor = {
|
||||||
id = "desc:OOO AN-270W04K";
|
id = "desc:OOO AN-270W04K";
|
||||||
scale = "2";
|
scale = "2";
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue