Switch to nixfmt

This commit is contained in:
Filippo Berto 2023-01-19 19:53:17 +01:00
parent 44794e2c3d
commit 5b974a203b
Signed by: bertof
GPG key ID: 9DBF7E6A1D2CE9ED
63 changed files with 990 additions and 946 deletions

View file

@ -26,14 +26,13 @@ let
playerStatus =
"${playerCtl} -f '{{emoji(status)}} {{title}} - {{artist}}' metadata | ${head} -c 50";
confirm_command = { cmd, title ? null, text ? null, image ? null }:
lib.concatStringsSep " "
[
"${pkgs.yad}/bin/yad --question --center --on-top --sticky --timeout=30 --timeout-indicator=bottom"
(if title == null then "" else ''--title "${title}"'')
(if image == null then "" else ''--image "${image}"'')
(if text == null then "" else ''--text "${text}"'')
"&& ${cmd}"
];
lib.concatStringsSep " " [
"${pkgs.yad}/bin/yad --question --center --on-top --sticky --timeout=30 --timeout-indicator=bottom"
(if title == null then "" else ''--title "${title}"'')
(if image == null then "" else ''--image "${image}"'')
(if text == null then "" else ''--text "${text}"'')
"&& ${cmd}"
];
systemctl = "${pkgs.systemd}/bin/systemctl";
loginctl = "${pkgs.systemd}/bin/loginctl";
shutdown = "${pkgs.systemd}/bin/shutdown";
@ -43,8 +42,7 @@ let
'';
colors = with pkgs.lib.nix-rice;
let alpha = 255 * opacity;
in
palette.toARGBHex rec {
in palette.toARGBHex rec {
normal = {
foreground = color.darken 10 colorPalette.foreground;
@ -111,8 +109,7 @@ let
};
ramp = [ "" "" "" "" "" "" ];
in
{
in {
home.packages = with pkgs; [
pkgs.rice.font.monospace.package
# emojione
@ -140,7 +137,8 @@ in
"bar/primary" = recursiveUpdate commonBar {
modules-left = "bspwm";
# modules-center =
modules-right = "player pulseaudio temperature cpu memory battery notifications powermenu date";
modules-right =
"player pulseaudio temperature cpu memory battery notifications powermenu date";
tray = {
position = "right";
padding = 1;
@ -150,7 +148,8 @@ in
"bar/secondary" = recursiveUpdate commonBar {
modules-left = "bspwm";
# modules-center =
modules-right = "player pulseaudio temperature cpu memory battery notifications powermenu date";
modules-right =
"player pulseaudio temperature cpu memory battery notifications powermenu date";
};
"module/battery" = {
@ -193,22 +192,20 @@ in
type = "internal/bspwm";
format = "<label-state>";
label =
let
common = {
padding = 1;
# separator = " ";
text = "%name%";
};
in
{
focused = recursiveUpdate common colors.selected;
occupied = recursiveUpdate common colors.active;
urgent = recursiveUpdate (recursiveUpdate common colors.active) {
background = colors.alert;
};
empty = recursiveUpdate common colors.normal;
label = let
common = {
padding = 1;
# separator = " ";
text = "%name%";
};
in {
focused = recursiveUpdate common colors.selected;
occupied = recursiveUpdate common colors.active;
urgent = recursiveUpdate (recursiveUpdate common colors.active) {
background = colors.alert;
};
empty = recursiveUpdate common colors.normal;
};
};
"module/cpu" = {
@ -303,42 +300,40 @@ in
open = recursiveUpdate colors.normal { text = ""; };
close = recursiveUpdate colors.normal { text = ""; };
};
menu = [
[
{
text = "";
exec = confirm_command {
cmd = logout;
title = "Logout";
text = "Do you want to logout?";
};
}
{
text = "";
exec = confirm_command {
cmd = "${systemctl} reboot";
title = "Reboot";
text = "Do you want to reboot?";
};
}
{
text = "";
exec = confirm_command {
cmd = "${systemctl} hibernate";
title = "Hibernate";
text = "Do you want to hibernate?";
};
}
{
text = "";
exec = confirm_command {
cmd = "${shutdown} now";
title = "Shutdown";
text = "Do you want to shutdown?";
};
}
]
];
menu = [[
{
text = "";
exec = confirm_command {
cmd = logout;
title = "Logout";
text = "Do you want to logout?";
};
}
{
text = "";
exec = confirm_command {
cmd = "${systemctl} reboot";
title = "Reboot";
text = "Do you want to reboot?";
};
}
{
text = "";
exec = confirm_command {
cmd = "${systemctl} hibernate";
title = "Hibernate";
text = "Do you want to hibernate?";
};
}
{
text = "";
exec = confirm_command {
cmd = "${shutdown} now";
title = "Shutdown";
text = "Do you want to shutdown?";
};
}
]];
};
"module/notifications" = {