style: use alejandra formatter on all nix files

This commit is contained in:
Yorick Barbanneau 2025-09-25 23:33:01 +02:00
parent d563805909
commit 0d8a394dcf
Signed by: ephase
GPG key ID: 246042E52B41FFCF
76 changed files with 1287 additions and 935 deletions

View file

@ -1,9 +1,12 @@
{ lib, config, pkgs, ... }:
with lib;
let
cfg = config.modules.desktop.sway;
in
{
lib,
config,
pkgs,
...
}:
with lib; let
cfg = config.modules.desktop.sway;
in {
options.modules.desktop.sway = {
enable = mkEnableOption "enable Sway Windows Manager";
@ -72,7 +75,6 @@ in
};
cpuThermal = {
thermalZone = mkOption {
type = types.nullOr types.int;
default = null;
@ -117,7 +119,6 @@ in
./includes/waybar.nix
];
config = mkIf cfg.enable {
programs.fuzzel.enable = true;
home.packages = with pkgs; [
@ -181,11 +182,11 @@ in
QT_SCALE_FACTOR_ROUNDING_POLICY = "RoundPreferFloor";
};
qt = {
enable = true;
qt = {
enable = true;
platformTheme.name = "adwaita";
style.name = "adwaita-dark";
};
};
xdg = {
enable = true;
mimeApps.enable = true;
@ -211,8 +212,8 @@ in
config = {
sway = {
default = [
"wlr"
"gtk"
"wlr"
"gtk"
];
};
};
@ -223,7 +224,7 @@ in
# choose the right screen. This is a workarount to not have to configure
# it manually.
home.file = mkIf cfg.xdg.useDistributionPortals {
"${config.xdg.configHome}/xdg-desktop-portal-wlr/config".text = ''
"${config.xdg.configHome}/xdg-desktop-portal-wlr/config".text = ''
[screencast]
max_fps=30
chooser_type=simple

View file

@ -1,6 +1,9 @@
{ config, lib, ... }:
with lib;
{
config,
lib,
...
}:
with lib; {
config = mkIf config.modules.desktop.sway.enable {
programs.fuzzel = {
settings = {
@ -25,5 +28,5 @@ with lib;
};
};
};
};
};
}

View file

@ -1,58 +1,60 @@
{ config, lib, ... }:
with lib;
{
config,
lib,
...
}:
with lib; {
config = mkIf config.modules.desktop.sway.enable {
services.kanshi = {
enable = config.modules.desktop.sway.kanshi ;
enable = config.modules.desktop.sway.kanshi;
settings = [
{
profile.name = "standalone";
profile.outputs = [
{
criteria = "eDP-1";
scale = 1.33;
status = "enable";
}
{
criteria = "eDP-1";
scale = 1.33;
status = "enable";
}
];
}
{
profile.name = "home";
profile.outputs = [
{
criteria = "Iiyama North America PL2792UH 1166310803122";
mode = "3840x2160";
position = "1235,0";
scale = 1.75;
}
{
criteria = "Iiyama North America PL2792UH 1176923201598";
mode = "3840x2160";
position = "0,0";
transform = "90";
scale = 1.75;
}
{
criteria = "eDP-1";
status = "disable";
}
{
criteria = "Iiyama North America PL2792UH 1166310803122";
mode = "3840x2160";
position = "1235,0";
scale = 1.75;
}
{
criteria = "Iiyama North America PL2792UH 1176923201598";
mode = "3840x2160";
position = "0,0";
transform = "90";
scale = 1.75;
}
{
criteria = "eDP-1";
status = "disable";
}
];
}
{
profile.name = "work";
profile.outputs = [
{
criteria = "Iiyama North America PL2792QN 1179214201663";
mode = "2560x1440";
position = "1450,0";
scale = 1.15;
}
{
criteria = "BOE 0x0A95 Unknown";
mode = "1920x1080";
position = "0,0";
scale = 1.325;
}
{
criteria = "Iiyama North America PL2792QN 1179214201663";
mode = "2560x1440";
position = "1450,0";
scale = 1.15;
}
{
criteria = "BOE 0x0A95 Unknown";
mode = "1920x1080";
position = "0,0";
scale = 1.325;
}
];
}
];

View file

@ -1,17 +1,20 @@
{ config, pkgs, lib, ... }:
with lib;
let
cfg = config.modules.desktop.sway;
in
{
config,
pkgs,
lib,
...
}:
with lib; let
cfg = config.modules.desktop.sway;
in {
config = mkIf config.modules.desktop.sway.enable {
systemd.user.services.mako = {
Service = {
ExecStart = "${pkgs.mako}/bin/mako";
};
Install = {
After = [ "sway-session.target" ];
WantedBy = [ "sway-session.target" ];
After = ["sway-session.target"];
WantedBy = ["sway-session.target"];
};
};
services.mako = {
@ -39,10 +42,10 @@ in
border-size = 1;
default-timeout = 7000;
group-by = "app-name";
format= "%b";
format = "%b";
};
"app-name=cmus grouped" = {
format = "%b";
format = "%b";
};
};
};

View file

@ -1,13 +1,16 @@
{ config, pkgs, lib, ... }:
with lib;
let
cfg = config.modules.desktop.sway;
in
{
config,
pkgs,
lib,
...
}:
with lib; let
cfg = config.modules.desktop.sway;
in {
config = mkIf config.modules.desktop.sway.enable {
wayland.windowManager.sway = {
package = config.lib.nixGL.wrap pkgs.sway;
enable = true;
enable = true;
wrapperFeatures.gtk = true;
systemd.enable = true;
config = {
@ -17,7 +20,7 @@ in
down = "j";
up = "k";
right = "l";
bars= [];
bars = [];
input = {
"4617:27904:MNT_Research_MNT_Reform_Keyboard_2.0_US/ST" = {
xkb_layout = "us";
@ -34,11 +37,16 @@ in
};
keybindings = let
mod = config.wayland.windowManager.sway.config.modifier;
inherit (config.wayland.windowManager.sway.config)
left down up right terminal;
in
{
# navigate only with direction or workspace
inherit
(config.wayland.windowManager.sway.config)
left
down
up
right
terminal
;
in {
# navigate only with direction or workspace
"${mod}+${left}" = "focus left";
"${mod}+${down}" = "focus down";
"${mod}+${up}" = "focus up";
@ -53,7 +61,7 @@ in
"${mod}+8" = "workspace $ws8";
"${mod}+9" = "workspace $ws9";
"${mod}+0" = "workspace $ws0";
# move with Shift and direction
# move with Shift and direction
"${mod}+Shift+${left}" = "move left";
"${mod}+Shift+${down}" = "move down";
"${mod}+Shift+${up}" = "move up";
@ -72,12 +80,15 @@ in
"${mod}+Ctrl+${left}" = "move workspace to output left";
"${mod}+Return" = "exec ${terminal}";
"${mod}+d" = "exec ${pkgs.fuzzel}/bin/fuzzel";
# manage windows manager actions with Alt
# manage windows manager actions with Alt
"${mod}+Alt+k" = "kill";
"${mod}+Alt+c" = "reload";
"${mod}+Alt+Backspace" = "exec swaynag -t warning -m 'Exit sway?' -B 'Yes' 'swaymsg exit'";
"${mod}+Alt+l" = if cfg.swaylock.useNullPackage then "exec swaylock" else "exec ${pkgs.swaylock}/bin/swaylock";
# Manage windows placement
"${mod}+Alt+l" =
if cfg.swaylock.useNullPackage
then "exec swaylock"
else "exec ${pkgs.swaylock}/bin/swaylock";
# Manage windows placement
"${mod}+b" = "splith";
"${mod}+v" = "splitv";
"${mod}+s" = "layout stacking";
@ -93,7 +104,7 @@ in
"${mod}+Shift+p" = "exec screencapt --region screen";
"${mod}+Alt+p" = "mode screenshot";
"${mod}+Alt+r" = "mode screenrecord";
# Media stuff
# Media stuff
"${mod}+F1" = "exec ${pkgs.brightnessctl}/bin/brightnessctl s 1%-";
"${mod}+F2" = "exec ${pkgs.brightnessctl}/bin/brightnessctl s +1%";
"${mod}+F3" = "exec ${pkgs.wireplumber}/bin/wpctl set-volume @DEFAULT_SINK@ 5%-";
@ -105,44 +116,47 @@ in
"${mod}+shift+n" = "exec makoctl dismiss -a";
"${mod}+alt+n" = "mode notification";
};
modes =
let
inherit (config.wayland.windowManager.sway.config)
left down up right;
modes = let
inherit
(config.wayland.windowManager.sway.config)
left
down
up
right
;
in {
"resize" = {
"${left}" = "resize shrink width 10 px or 10 ppt";
"${down}" = "resize grow height 10 px or 10 ppt";
"${up}" = "resize shrink height 10 px or 10 ppt";
"${right}" = "resize grow width 10 px or 10 ppt";
"Return" = "mode default";
"Escape" = "mode default";
"${left}" = "resize shrink width 10 px or 10 ppt";
"${down}" = "resize grow height 10 px or 10 ppt";
"${up}" = "resize shrink height 10 px or 10 ppt";
"${right}" = "resize grow width 10 px or 10 ppt";
"Return" = "mode default";
"Escape" = "mode default";
};
"notification" = {
"r" = "exec ${pkgs.mako}/bin/makoctl restore";
"Escape" = "mode default";
};
"screenshot" = {
"s" = "exec screencapt --region screen; mode default";
"Shift+s" = "exec screencapt --region screen -f; mode default";
"r" = "exec screencapt --region region; mode default";
"Shift+r" = "exec screencapt --region region -f; mode default";
"w" = "exec screencapt --region window; mode default";
"Shift+w" = "exec screencapt --region window -f; mode default";
"Return" = "mode default";
"Escape" = "mode default";
"s" = "exec screencapt --region screen; mode default";
"Shift+s" = "exec screencapt --region screen -f; mode default";
"r" = "exec screencapt --region region; mode default";
"Shift+r" = "exec screencapt --region region -f; mode default";
"w" = "exec screencapt --region window; mode default";
"Shift+w" = "exec screencapt --region window -f; mode default";
"Return" = "mode default";
"Escape" = "mode default";
};
"screenrecord" = {
"s" = "exec screencapt video --region screen; mode default";
"Shift+s" = "exec screencapt --region video screen -a; mde default";
"r" = "exec screencapt video --region region; mode default";
"Shift+r" = "exec screencapt video --region region -a; mode default";
"w" = "exec screencapt video --region window -f ; mode default";
"Shift+w" = "exec screencapt --region video window -a; mode default";
"Return" = "mode default";
"Escape" = "mode default";
"s" = "exec screencapt video --region screen; mode default";
"Shift+s" = "exec screencapt --region video screen -a; mde default";
"r" = "exec screencapt video --region region; mode default";
"Shift+r" = "exec screencapt video --region region -a; mode default";
"w" = "exec screencapt video --region window -f ; mode default";
"Shift+w" = "exec screencapt --region video window -a; mode default";
"Return" = "mode default";
"Escape" = "mode default";
};
};
colors = {
focused = {
@ -171,7 +185,7 @@ in
background = "#900000";
text = "#cccccc";
indicator = "#900000";
childBorder = "#900000" ;
childBorder = "#900000";
};
#focused_tab_title = {
# boder = "#2f343a";
@ -183,32 +197,33 @@ in
border = 1;
titlebar = false;
commands = [
{
command = "inhibit_idle fullscreen";
criteria = {
title = "^.*";
};
}
{
command = "inhibit_idle fullscreen";
criteria = {
app_id = "^.*";
};
}
{
command = "resize set 70ppt 70ppt, border pixel 2";
criteria = {
title = "^Open .*$";
};
}];
{
command = "inhibit_idle fullscreen";
criteria = {
title = "^.*";
};
}
{
command = "inhibit_idle fullscreen";
criteria = {
app_id = "^.*";
};
}
{
command = "resize set 70ppt 70ppt, border pixel 2";
criteria = {
title = "^Open .*$";
};
}
];
};
floating = {
border = 2;
titlebar = false;
criteria = [
{
title = "^Open .*$";
}
{
title = "^Open .*$";
}
];
};
gaps = {

View file

@ -1,31 +1,43 @@
{ config, lib, pkgs, ... }:
with lib;
let
{
config,
lib,
pkgs,
...
}:
with lib; let
cfg = config.modules.desktop.sway;
in
{
config = mkIf config.modules.desktop.sway.enable {
in {
config = mkIf config.modules.desktop.sway.enable {
services.swayidle = {
enable = true;
timeouts = [
{
timeout = 300;
command = if cfg.swaylock.useNullPackage then ''/usr/bin/swaylock -f'' else ''${pkgs.swaylock}/bin/swaylock -f'';
command =
if cfg.swaylock.useNullPackage
then ''/usr/bin/swaylock -f''
else ''${pkgs.swaylock}/bin/swaylock -f'';
}
{
timeout = 600;
command = ''${pkgs.sway}/bin/swaymsg "output * power off"'';
resumeCommand =''${pkgs.sway}/bin/swaymsg "output * power on"'';
resumeCommand = ''${pkgs.sway}/bin/swaymsg "output * power on"'';
}
];
events = [
{
event = "before-sleep";
command = if cfg.swaylock.useNullPackage then ''/usr/bin/swaylock -f'' else ''${pkgs.swaylock}/bin/swaylock -f'';
command =
if cfg.swaylock.useNullPackage
then ''/usr/bin/swaylock -f''
else ''${pkgs.swaylock}/bin/swaylock -f'';
}
{
event = "lock";
command = if cfg.swaylock.useNullPackage then ''usr/bin/swaylock -f'' else ''${pkgs.swaylock}/bin/swaylock -f'';
command =
if cfg.swaylock.useNullPackage
then ''usr/bin/swaylock -f''
else ''${pkgs.swaylock}/bin/swaylock -f'';
}
];
};

View file

@ -1,15 +1,24 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.modules.desktop.sway;
in
{
config,
lib,
pkgs,
...
}:
with lib; let
cfg = config.modules.desktop.sway;
in {
config = mkIf config.modules.desktop.sway.enable {
programs.swaylock = {
package = if cfg.swaylock.useNullPackage then null else pkgs.swaylock;
package =
if cfg.swaylock.useNullPackage
then null
else pkgs.swaylock;
enable = true;
settings = {
image = if cfg.wallpapers.lockscreen != "" then "${cfg.wallpapers.lockscreen}" else false;
image =
if cfg.wallpapers.lockscreen != ""
then "${cfg.wallpapers.lockscreen}"
else false;
scaling = "center";
color = "000000";
indicator-radius = 70;

View file

@ -1,9 +1,12 @@
{lib, config, pkgs, ...}:
with lib;
let
cfg = config.modules.desktop.sway;
in
{
lib,
config,
pkgs,
...
}:
with lib; let
cfg = config.modules.desktop.sway;
in {
config = mkIf cfg.enable {
programs.waybar = {
enable = true;
@ -23,41 +26,45 @@ in
"sway/workspaces"
"sway/mode"
];
modules-right = [
"network"
"custom/sep"
] ++ (
if cfg.waybar.laptop then [
modules-right =
[
"network"
"custom/sep"
]
++ (
if cfg.waybar.laptop
then [
"backlight"
"battery"
"custom/sep"
]
else [
]
) ++
[
"memory"
"cpu"
"temperature"
"custom/sep"
] ++ (
if cfg.waybar.gpuThermal.enable then [
)
++ [
"memory"
"cpu"
"temperature"
"custom/sep"
]
++ (
if cfg.waybar.gpuThermal.enable
then [
"temperature#gpu"
"custom/sep"
]
else [
]
) ++
[
"pulseaudio#input"
"pulseaudio#output"
"custom/sep"
"clock"
"custom/sep"
"privacy"
"tray"
];
)
++ [
"pulseaudio#input"
"pulseaudio#output"
"custom/sep"
"clock"
"custom/sep"
"privacy"
"tray"
];
"clock" = {
"format-alt" = "{:%Y-%m-%d}";
"timezone" = "Europe/Paris";
@ -65,7 +72,7 @@ in
};
"cpu" = {
"format" = "{usage}% {icon}";
"format-icons" = [ "" ];
"format-icons" = [""];
"states" = {
"critical" = 90;
"warning" = 70;
@ -77,19 +84,19 @@ in
"tooltip" = false;
};
"custom/screenrecord" = {
"format" = " [rec.] ";
"interval" = 1;
"exec" = "echo '{\"class\": \"recording\"}'";
"exec-if" = "${pkgs.procps}/bin/pgrep wl-screenrec";
"format" = " [rec.] ";
"interval" = 1;
"exec" = "echo '{\"class\": \"recording\"}'";
"exec-if" = "${pkgs.procps}/bin/pgrep wl-screenrec";
"on-click" = "exec ${pkgs.coreutils}/bin/kill -s SIGINT $(${pkgs.procps}/bin/pgrep wl-screenrec)";
"tooltype" = false;
};
"idle_inhibitor" = {
"format" = "{icon}";
"format-icons" = {
"activated" = "";
"deactivated" = "";
};
"format" = "{icon}";
"format-icons" = {
"activated" = "";
"deactivated" = "";
};
};
"memory" = {
"format" = "{used:0.0f}/{total:0.0f}G ";
@ -107,11 +114,11 @@ in
"format-wifi" = "{signalStrength}% ";
"tooltip" = false;
};
"privacy"= {
"privacy" = {
"icon-spacing" = 6;
"icon-size" = 11;
"transition-duration" = 250;
"modules"= [
"modules" = [
{
"type" = "screenshare";
"tooltip" = false;
@ -149,19 +156,22 @@ in
"tooltip" = false;
};
"sway/mode" = {
"format" = "<span style=\"italic\">{}</span>";
"format" = "<span style=\"italic\">{}</span>";
};
"sway/workspace" = {
"disable-scroll" = true;
"disable-scroll" = true;
};
"temperature" = {
"critical-threshold" = 80;
"format" = " {temperatureC}°C ";
"thermal-zone" = mkIf ( cfg.waybar.cpuThermal.thermalZone != null )
"thermal-zone" =
mkIf (cfg.waybar.cpuThermal.thermalZone != null)
cfg.waybar.cpuThermal.thermalZone;
"hwmon-path-abs" = mkIf ( cfg.waybar.cpuThermal.hwmonPathAbs != "" )
"hwmon-path-abs" =
mkIf (cfg.waybar.cpuThermal.hwmonPathAbs != "")
"${cfg.waybar.cpuThermal.hwmonPathAbs}";
"input-filename" = mkIf ( cfg.waybar.cpuThermal.inputFilename != "" )
"input-filename" =
mkIf (cfg.waybar.cpuThermal.inputFilename != "")
"${cfg.waybar.cpuThermal.inputFilename}";
};
"temperature#gpu" = {