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
|
@ -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;
|
||||
terminal = lib.pantheon.mkStrOption;
|
||||
status-bar = lib.pantheon.mkStrOption;
|
||||
enableSpotifyd = lib.mkEnableOption "";
|
||||
enableSteam = 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; };
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue