refactor(treewide): format with alejandra

This commit is contained in:
ooks-io 2024-07-29 15:00:38 +12:00
parent 7fefb94400
commit 61cef505da
216 changed files with 5995 additions and 3969 deletions

View file

@ -1,5 +1,4 @@
{ lib, ... }:
{
{lib, ...}: {
imports = [
#./eww
# ./ags
@ -17,5 +16,4 @@
enable = lib.mkEnableOption "Enable waybar bar";
};
};
}

View file

@ -1,15 +1,17 @@
{ config, lib, pkgs, osConfig, ... }:
let
{
config,
lib,
pkgs,
osConfig,
...
}: let
inherit (config.colorscheme) palette;
inherit (lib) mkIf head;
fonts = config.ooknet.fonts;
wayland = config.ooknet.wayland;
monitors = osConfig.ooknet.host.hardware.monitors;
monitorWidth = (head monitors).width - 20;
in
{
monitorWidth = (head monitors).width - 20;
in {
config = mkIf (wayland.bar == "waybar") {
programs.waybar = {
enable = true;
@ -25,9 +27,9 @@ in
margin-top = 10;
margin-bottom = -12;
modules-left = [ "clock" "battery" "hyprland/workspaces" ];
modules-left = ["clock" "battery" "hyprland/workspaces"];
modules-center = [];
modules-right = [ "custom/hyprrecord" "tray" ];
modules-right = ["custom/hyprrecord" "tray"];
"hyprland/workspaces" = let
hyprctl = config.wayland.windowManager.hyprland.package + "/bin/hyprctl";
@ -60,7 +62,7 @@ in
};
bat = "BAT0";
interval = 10;
format-icons = [ "󰁺" "󰁻" "󰁼" "󰁽" "󰁾" "󰁿" "󰂀" "󰂁" "󰂂" "󰁹" ];
format-icons = ["󰁺" "󰁻" "󰁼" "󰁽" "󰁾" "󰁿" "󰂀" "󰂁" "󰂂" "󰁹"];
format = "{icon} {capacity}%";
format-charging = "󱐋{icon} {capacity}%";
tooltip-format = "{timeTo} {power}W";
@ -79,77 +81,81 @@ in
signal = 12;
};
};
style = /* css */ ''
* {
font-family: "${fonts.monospace.family}";
font-size: 19px;
border: solid #${palette.base05};
}
style =
/*
css
*/
''
* {
font-family: "${fonts.monospace.family}";
font-size: 19px;
border: solid #${palette.base05};
}
window#waybar {
background-color: transparent;
margin: 10px;
}
window#waybar {
background-color: transparent;
margin: 10px;
}
#clock,
#battery,
#workspaces {
background-color: #${palette.base00};
padding-right: 10px;
}
#clock,
#battery,
#workspaces {
background-color: #${palette.base00};
padding-right: 10px;
}
#clock {
padding-left: 10px;
border: 2px solid #${palette.base05};
border-right: 0px;
border-top-left-radius: 10px;
}
#clock {
padding-left: 10px;
border: 2px solid #${palette.base05};
border-right: 0px;
border-top-left-radius: 10px;
}
#battery {
padding-left: 10px;
border-top: 2px solid #${palette.base05};
border-bottom: 2px solid #${palette.base05};
border-left: 0px;
}
#battery {
padding-left: 10px;
border-top: 2px solid #${palette.base05};
border-bottom: 2px solid #${palette.base05};
border-left: 0px;
}
#battery.good {
color: #${palette.base0B};
}
#battery.warning {
color: #${palette.base0A};
}
#battery.critical {
color: #${palette.base08};
}
#battery.good {
color: #${palette.base0B};
}
#battery.warning {
color: #${palette.base0A};
}
#battery.critical {
color: #${palette.base08};
}
#tray {
padding-right: 10px;
padding-left: 10px;
background-color: transparent;
border: 0;
}
#tray {
padding-right: 10px;
padding-left: 10px;
background-color: transparent;
border: 0;
}
#workspaces {
border: 2px solid #${palette.base05};
border-left: 0;
border-top-right-radius: 10px;
}
#workspaces {
border: 2px solid #${palette.base05};
border-left: 0;
border-top-right-radius: 10px;
}
#workspace button,
#workspaces button.active,
#workspaces button.visible {
color: #${palette.base0B};
}
#workspace button,
#workspaces button.active,
#workspaces button.visible {
color: #${palette.base0B};
}
#workspaces button.urgent {
color: #${palette.base08};
}
#workspaces button.urgent {
color: #${palette.base08};
}
#custom-hyprrecord {
color: #${palette.base08};
padding-right: 20px;
}
'';
#custom-hyprrecord {
color: #${palette.base08};
padding-right: 20px;
}
'';
};
};
}

View file

@ -1,9 +1,13 @@
{ inputs, lib, config, pkgs, ... }:
let
{
inputs,
lib,
config,
pkgs,
...
}: let
wayland = config.ooknet.wayland;
inherit (lib) mkIf;
in
{
in {
imports = [
inputs.hyprland.homeManagerModules.default
./settings
@ -13,8 +17,8 @@ in
config = mkIf (wayland.compositor == "hyprland") {
home.packages = [
pkgs.hyprpicker
];
];
wayland.windowManager.hyprland = {
enable = true;
package = inputs.hyprland.packages.${pkgs.system}.hyprland;

View file

@ -1,17 +1,18 @@
{ lib, config, pkgs, inputs, ... }:
let
{
lib,
config,
pkgs,
inputs,
...
}: let
inherit (lib) mkIf;
wayland = config.ooknet.wayland;
in
{
in {
config = mkIf (wayland.compositor == "hyprland") {
home.packages = with inputs; [
# Screenshot tool
# Screenshot tool
hyprland-contrib.packages.${pkgs.system}.grimblast
# Screen recording tool
# Screen recording tool
ooks-scripts.packages.${pkgs.system}.hyprrecord
];

View file

@ -1,13 +1,14 @@
{ lib, config, pkgs, ... }:
let
{
lib,
config,
pkgs,
...
}: let
inherit (lib) mkIf;
wayland = config.ooknet.wayland;
in
{
in {
config = mkIf (wayland.compositor == "hyprland") {
home.packages = [ pkgs.hyprshade ];
home.packages = [pkgs.hyprshade];
# TODO: implement hyprshade configuration
};
}

View file

@ -1,13 +1,13 @@
{ config, lib, ... }:
let
{
config,
lib,
...
}: let
wayland = config.ooknet.wayland;
pointer = config.home.pointerCursor;
inherit (config.colorscheme) palette;
inherit (lib) mkIf;
in
{
in {
config = mkIf (wayland.compositor == "hyprland") {
wayland.windowManager.hyprland = {
settings = {
@ -20,14 +20,13 @@ in
border_size = 2;
"col.active_border" = "0xff${palette.base05}";
"col.inactive_border" = "0xff${palette.base02}";
};
};
exec-once = [
"hyprctl setcursor ${pointer.name} ${toString pointer.size}"
];
decoration = {
active_opacity = 1.0;
inactive_opacity = 1.0;
fullscreen_opacity = 1.0;
@ -45,7 +44,7 @@ in
"col.shadow" = "0x44000000";
"col.shadow_inactive" = "0x66000000";
};
animations = {
enabled = false;
};

View file

@ -1,12 +1,12 @@
{ lib, config, ... }:
let
{
lib,
config,
...
}: let
inherit (lib) mkIf;
wayland = config.ooknet.wayland;
binds = config.ooknet.binds;
in
{
in {
config = mkIf (wayland.compositor == "hyprland") {
wayland.windowManager.hyprland.settings = {
bind = [
@ -38,7 +38,7 @@ in
",XF86AudioRaiseVolume, exec, ${binds.volume.up}"
",XF86AudioLowerVolume, exec, ${binds.volume.down}"
",XF86AudioMute, exec, ${binds.volume.mute}"
# Window Management
"SUPER, Q, killactive"
"SUPER CTRL, backspace, killactive"
@ -97,7 +97,7 @@ in
# Lock Screen
"SUPER, Backspace, exec, ${binds.lock}"
];
# Mouse
# Mouse
bindm = [
"SUPER, mouse:272, movewindow"
"SUPER, mouse:273, resizewindow"

View file

@ -1,17 +1,15 @@
{ lib, config, ... }:
let
{
lib,
config,
...
}: let
inherit (lib) mkIf;
wayland = config.ooknet.wayland;
in
{
in {
config = mkIf (wayland.compositor == "hyprland") {
wayland.windowManager.hyprland.settings.env = [
"XDG_SESSION_DESKTOP,hyprland"
"XDG_CURRENT_DESKTOP,hyprland"
];
];
};
}

View file

@ -1,11 +1,12 @@
{ config, lib, pkgs, ... }:
let
{
config,
lib,
pkgs,
...
}: let
inherit (lib) mkIf;
wayland = config.ooknet.wayland;
in
{
in {
config = mkIf (wayland.compositor == "hyprland") {
wayland.windowManager.hyprland.settings = {
exec = [

View file

@ -1,11 +1,11 @@
{ lib, config, ... }:
let
{
lib,
config,
...
}: let
inherit (lib) mkIf;
wayland = config.ooknet.wayland;
in
{
in {
config = mkIf (wayland.compositor == "hyprland") {
wayland.windowManager.hyprland.settings.gestures = {
workspace_swipe = true;

View file

@ -1,12 +1,12 @@
{ lib, config, ... }:
let
{
lib,
config,
...
}: let
inherit (lib) mkIf;
wayland = config.ooknet.wayland;
wallpaperPath = config.ooknet.wallpaper.path;
in
{
in {
config = mkIf (wayland.compositor == "hyprland") {
services.hyprpaper = {
enable = true;

View file

@ -1,11 +1,11 @@
{ lib, config, ... }:
let
{
lib,
config,
...
}: let
inherit (lib) mkIf;
wayland = config.ooknet.wayland;
in
{
in {
config = mkIf (wayland.compositor == "hyprland") {
wayland.windowManager.hyprland.settings.input = {
kb_layout = "us";
@ -14,5 +14,4 @@ in
mouse_refocus = false;
};
};
}

View file

@ -1,11 +1,11 @@
{ lib, config, ... }:
let
{
lib,
config,
...
}: let
inherit (lib) mkIf;
wayland = config.ooknet.wayland;
in
{
in {
config = mkIf (wayland.compositor == "hyprland") {
wayland.windowManager.hyprland.settings.misc = {
mouse_move_enables_dpms = true;
@ -19,4 +19,4 @@ in
focus_on_activate = true;
};
};
}
}

View file

@ -1,22 +1,34 @@
{ lib, config, osConfig, ... }:
let
{
lib,
config,
osConfig,
...
}: let
inherit (lib) mkIf concatMap;
wayland = config.ooknet.wayland;
monitors = osConfig.ooknet.host.hardware.monitors;
in
{
in {
config = mkIf (wayland.compositor == "hyprland") {
wayland.windowManager.hyprland.settings = {
monitor = concatMap (m: let
resolution = "${toString m.width}x${toString m.height}@${toString m.refreshRate}";
position = "${toString m.x}x${toString m.y}";
basicConfig = "${m.name},${if m.enabled then "${resolution},${position},1" else "disable"}";
in
[ basicConfig ] ++ (if m.transform != 0 then ["${m.name},transform,${toString m.transform}"] else [])
) (monitors);
monitor =
concatMap (
m: let
resolution = "${toString m.width}x${toString m.height}@${toString m.refreshRate}";
position = "${toString m.x}x${toString m.y}";
basicConfig = "${m.name},${
if m.enabled
then "${resolution},${position},1"
else "disable"
}";
in
[basicConfig]
++ (
if m.transform != 0
then ["${m.name},transform,${toString m.transform}"]
else []
)
)
monitors;
};
};
}

View file

@ -1,11 +1,11 @@
{ lib, config, ... }:
let
{
lib,
config,
...
}: let
inherit (lib) mkIf;
wayland = config.ooknet.wayland;
in
{
in {
config = mkIf (wayland.compositor == "hyprland") {
wayland.windowManager.hyprland.settings = {
windowrulev2 = [
@ -26,7 +26,7 @@ in
"stayfocused,title:^(BTOP)$"
# Tearing
"immediate, title:^(TEKKEN8)$"
"immediate, title:^(TEKKEN8)$"
];
};
};

View file

@ -1,12 +1,13 @@
{ lib, config, pkgs, ... }:
let
{
lib,
config,
pkgs,
...
}: let
inherit (lib) mkIf;
fonts = config.ooknet.fonts;
wayland = config.ooknet.wayland;
in
{
in {
config = mkIf (wayland.launcher == "rofi") {
programs.rofi = {
enable = true;
@ -14,7 +15,7 @@ in
package = pkgs.rofi-wayland;
terminal = "${config.home.sessionVariables.TERMINAL}";
theme = let
inherit (config.colorscheme ) palette;
inherit (config.colorscheme) palette;
inherit (config.lib.formats.rasi) mkLiteral;
in {
"*" = {

View file

@ -1,41 +1,45 @@
{ lib, config, pkgs, ... }:
let
{
lib,
config,
pkgs,
...
}: let
inherit (config.colorscheme) palette;
inherit (lib) mkIf;
wayland = config.ooknet.wayland;
fonts = config.ooknet.fonts;
in
{
in {
config = mkIf (wayland.launcher == "tofi") {
home.packages = [pkgs.tofi];
xdg.configFile."tofi/config".text = /* config */ ''
history = false
clip-to-padding = false
horizontal = true
width = 40%
height = 35
anchor = top-left
margin-top = 5
margin-left = 25%
num-results = 1
border-width = 0
outline-width = 0
result-spacing = 10
selection-background-padding = 30
prompt-padding = 10
font = "${fonts.monospace.family}"
font-size = 14
prompt-text = " "
background-color = #0000
prompt-background = #0000
prompt-color = ${palette.base0B}
input-color = ${palette.base05}
placeholder-color = ${palette.base03}
default-result-color = ${palette.base03}
selection-color = ${palette.base04}
'';
xdg.configFile."tofi/config".text =
/*
config
*/
''
history = false
clip-to-padding = false
horizontal = true
width = 40%
height = 35
anchor = top-left
margin-top = 5
margin-left = 25%
num-results = 1
border-width = 0
outline-width = 0
result-spacing = 10
selection-background-padding = 30
prompt-padding = 10
font = "${fonts.monospace.family}"
font-size = 14
prompt-text = " "
background-color = #0000
prompt-background = #0000
prompt-color = ${palette.base0B}
input-color = ${palette.base05}
placeholder-color = ${palette.base03}
default-result-color = ${palette.base03}
selection-color = ${palette.base04}
'';
};
}

View file

@ -4,4 +4,3 @@
./hyprlock.nix
];
}

View file

@ -1,13 +1,13 @@
{ lib, config, ... }:
let
{
lib,
config,
...
}: let
inherit (config.colorscheme) palette;
inherit (lib) mkIf;
wayland = config.ooknet.wayland;
fonts = config.ooknet.fonts;
in
{
in {
config = mkIf (wayland.locker == "hyprlock") {
ooknet.binds.lock = "hyprlock";
programs.hyprlock = {
@ -29,7 +29,7 @@ in
size = {
width = 300;
height = 40;
};
};
position = {
x = 0;
y = 0;
@ -49,7 +49,7 @@ in
text = " ";
position = {
x = 0;
y = 80;
y = 80;
};
color = "0xff${palette.base08}";
font_size = 30;
@ -60,7 +60,7 @@ in
text = "$TIME";
position = {
x = 0;
y = -80;
y = -80;
};
color = "0xff${palette.base0B}";
font_size = 20;

View file

@ -1,13 +1,14 @@
{ config, lib, ... }:
let
{
config,
lib,
...
}: let
inherit (config.colorscheme) palette;
inherit (lib) mkIf;
fonts = config.ooknet.fonts;
wallpaperPath = config.ooknet.wallpaper.path;
wayland = config.ooknet.wayland;
in
{
in {
config = mkIf (wayland.locker == "swaylock") {
ooknet.binds.lock = "swaylock";
programs.swaylock = {

View file

@ -1,21 +1,20 @@
{ config, lib, ... }:
let
{
config,
lib,
...
}: let
inherit (config.colorscheme) palette variant;
inherit (lib) mkIf;
fonts = config.ooknet.fonts;
wayland = config.ooknet.wayland;
in
{
in {
config = mkIf (wayland.notification == "mako") {
services.mako = {
services.mako = {
enable = true;
iconPath =
if variant == "dark" then
"${config.gtk.iconTheme.package}/share/icons/Papirus-Dark"
else
"${config.gtk.iconTheme.package}/share/icons/Papirus-Light";
if variant == "dark"
then "${config.gtk.iconTheme.package}/share/icons/Papirus-Dark"
else "${config.gtk.iconTheme.package}/share/icons/Papirus-Light";
font = "${fonts.regular.family} 12";
padding = "10,10";
anchor = "top-right";
@ -41,4 +40,3 @@ in
};
};
}

View file

@ -1,11 +1,11 @@
{ lib, config, ... }:
let
{
lib,
config,
...
}: let
inherit (lib) mkIf;
cfg = config.ooknet.wayland;
in
{
in {
config = mkIf cfg.enable {
services.gammastep = {
enable = true;

View file

@ -1,11 +1,12 @@
{ lib, config, pkgs, ... }:
let
{
lib,
config,
pkgs,
...
}: let
inherit (lib) mkIf;
cfg = config.ooknet.wayland;
in
{
in {
config = lib.mkIf cfg.enable {
home = {
packages = with pkgs; [
@ -17,7 +18,7 @@ in
wl-clipboard
];
};
systemd.user.targets.tray = {
Unit = {
Description = "Home Manager System Tray";

View file

@ -1,30 +1,33 @@
{ lib, config, osConfig, ... }:
let
{
lib,
config,
osConfig,
...
}: let
inherit (lib) mkIf;
cfg = config.ooknet.wayland;
gpu = osConfig.ooknet.host.hardware.gpu;
in
{
in {
config = mkIf cfg.enable {
home.sessionVariables = {
CLUTTER_BACKEND = "wayland";
NIXOS_OZONE_WL = "1";
GDK_BACKEND = "wayland";
QT_QPA_PLATFORM = "wayland";
QT_WAYLAND_DISABLE_WINDOWDECORATION = "1";
DISABLE_QT5_COMPAT = "0";
QT_AUTO_SCREEN_SCALE_FACTOR = "1";
MOZ_ENABLE_WAYLAND = "1";
MOZ_DBUS_REMOTE = "1";
XDG_SESSION_TYPE = "wayland";
SDL_VIDEODRIVER = "wayland";
} // mkIf (gpu == "nvidia") {
LIBVA_DRIVER_NAME = "nvidia";
GBM_BACKEND = "nvidia-drm";
__GLX_VENDOR_LIBRARY_NAME = "nvidia";
WLR_NO_HARDWARE_CURSORS = "1";
};
home.sessionVariables =
{
CLUTTER_BACKEND = "wayland";
NIXOS_OZONE_WL = "1";
GDK_BACKEND = "wayland";
QT_QPA_PLATFORM = "wayland";
QT_WAYLAND_DISABLE_WINDOWDECORATION = "1";
DISABLE_QT5_COMPAT = "0";
QT_AUTO_SCREEN_SCALE_FACTOR = "1";
MOZ_ENABLE_WAYLAND = "1";
MOZ_DBUS_REMOTE = "1";
XDG_SESSION_TYPE = "wayland";
SDL_VIDEODRIVER = "wayland";
}
// mkIf (gpu == "nvidia") {
LIBVA_DRIVER_NAME = "nvidia";
GBM_BACKEND = "nvidia-drm";
__GLX_VENDOR_LIBRARY_NAME = "nvidia";
WLR_NO_HARDWARE_CURSORS = "1";
};
};
}