format using nixpkgs-fmt

This commit is contained in:
Leonardo Eugênio 2023-01-22 18:12:04 -03:00
parent 219fe2c565
commit 273cd93ea3
26 changed files with 936 additions and 878 deletions

View file

@ -99,7 +99,8 @@
] ++ lib.optional (desktop == "sway") ./system/sway.nix ] ++ lib.optional (desktop == "sway") ./system/sway.nix
++ lib.optional (desktop == "gnome") ./system/gnome.nix ++ lib.optional (desktop == "gnome") ./system/gnome.nix
++ lib.optional (desktop == "kde") ./system/kde.nix; ++ lib.optional (desktop == "kde") ./system/kde.nix;
in { in
{
nixosConfigurations = { nixosConfigurations = {
i15 = lib.nixosSystem { i15 = lib.nixosSystem {
inherit system specialArgs; inherit system specialArgs;

View file

@ -4,7 +4,8 @@
{ config, lib, pkgs, modulesPath, ... }: { config, lib, pkgs, modulesPath, ... }:
let let
btrfs_options = [ "compress=zstd:3" "noatime" ]; btrfs_options = [ "compress=zstd:3" "noatime" ];
in { in
{
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot.initrd.availableKernelModules = boot.initrd.availableKernelModules =

View file

@ -5,7 +5,8 @@
let let
btrfs_options = [ "compress=zstd:3" "noatime" ]; btrfs_options = [ "compress=zstd:3" "noatime" ];
btrfs_ssd = [ "ssd" "discard=async" ]; btrfs_ssd = [ "ssd" "discard=async" ];
in { in
{
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot.initrd.availableKernelModules = boot.initrd.availableKernelModules =
[ "nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ]; [ "nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ];

View file

@ -5,7 +5,8 @@
let let
btrfs_options = [ "compress=zstd:3" "noatime" ]; btrfs_options = [ "compress=zstd:3" "noatime" ];
btrfs_ssd = [ "ssd" "discard=async" ]; btrfs_ssd = [ "ssd" "discard=async" ];
in { in
{
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot.initrd.availableKernelModules = boot.initrd.availableKernelModules =

View file

@ -1,5 +1,5 @@
(inputs@{ system, packages, ... }: (inputs@{ system, packages, ... }:
{ pkgs, ... }: { { pkgs, ... }: {
nixpkgs.overlays = [ nixpkgs.overlays = [
inputs.nur.overlay inputs.nur.overlay
(import ../scripts) (import ../scripts)
@ -34,7 +34,8 @@
material-wifi-icons = final.stdenv.mkDerivation rec { material-wifi-icons = final.stdenv.mkDerivation rec {
name = "material-wifi-icons"; name = "material-wifi-icons";
src = inputs.material-wifi-icons; src = inputs.material-wifi-icons;
installPhase = let dest = "$out/share/fonts/${name}"; installPhase =
let dest = "$out/share/fonts/${name}";
in '' in ''
mkdir -p ${dest} mkdir -p ${dest}
cp material-wifi.ttf ${dest} cp material-wifi.ttf ${dest}
@ -51,4 +52,4 @@
}; };
}) })
]; ];
}) })

View file

@ -1,6 +1,6 @@
(final: prev: (final: prev:
with prev; with prev;
let let
import_script = (_: path: import (path) { inherit pkgs lib; }); import_script = (_: path: import (path) { inherit pkgs lib; });
create_script = (name: text: runtimeInputs: create_script = (name: text: runtimeInputs:
let let
@ -11,14 +11,17 @@
${builtins.readFile text} ${builtins.readFile text}
''; '';
}; };
in (pkgs.writeShellApplication { in
(pkgs.writeShellApplication {
inherit name runtimeInputs; inherit name runtimeInputs;
text = ''exec ${script_body} "$@"''; text = ''exec ${script_body} "$@"'';
checkPhase = ""; checkPhase = "";
})); }));
create_scripts = create_scripts =
lib.mapAttrs (name: deps: create_script name ./${name} deps); lib.mapAttrs (name: deps: create_script name ./${name} deps);
in create_scripts { in
create_scripts
{
br = [ ]; br = [ ];
bmenu = [ final.bemenu final.dhist fish j4-dmenu-desktop jq sway ]; bmenu = [ final.bemenu final.dhist fish j4-dmenu-desktop jq sway ];
_diffr = [ diffr ]; _diffr = [ diffr ];
@ -37,4 +40,4 @@
wdmenu = ./wdmenu.nix; wdmenu = ./wdmenu.nix;
wlauncher = ./wlauncher.nix; wlauncher = ./wlauncher.nix;
_gpg-unlock = ./_gpg-unlock.nix; _gpg-unlock = ./_gpg-unlock.nix;
}) })

View file

@ -6,6 +6,7 @@ let
rofi = "rofi -dmenu -sort"; rofi = "rofi -dmenu -sort";
}; };
menu_cmd = available_menus.${dmenu}; menu_cmd = available_menus.${dmenu};
in pkgs.writeShellScriptBin "wdmenu" '' in
pkgs.writeShellScriptBin "wdmenu" ''
exec ${menu_cmd} "$@" exec ${menu_cmd} "$@"
'' ''

View file

@ -6,6 +6,7 @@ let
rofi = "rofi -show drun -sort"; rofi = "rofi -show drun -sort";
}; };
menu_cmd = available_menus.${dmenu}; menu_cmd = available_menus.${dmenu};
in pkgs.writeShellScriptBin "wlauncher" '' in
pkgs.writeShellScriptBin "wlauncher" ''
exec ${menu_cmd} "$@" exec ${menu_cmd} "$@"
'' ''

View file

@ -6,6 +6,7 @@ let
rofi = "rofi -show drun -sort"; rofi = "rofi -show drun -sort";
}; };
menu_cmd = available_menus.${dmenu}; menu_cmd = available_menus.${dmenu};
in pkgs.writeShellScriptBin "wlauncher" '' in
pkgs.writeShellScriptBin "wlauncher" ''
exec ${menu_cmd} "$@" exec ${menu_cmd} "$@"
'' ''

View file

@ -1,6 +1,7 @@
let let
main_ssh_public_key = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCxR/w+38b2lX90yNBqhq3mUmkn1WGu6GAPhN1tVp2ZjYRJNV/+5gWCnTtOWYtDx35HmK/spQ2Qy8X9ttkzORa24fysNx1Iqn/TiXhD7eIJjbGPnrOpIKTkW5/uB3SD/P5NBSa06//BaqJU4sBlG79hoXRpod052hQtdpTVDiMCIV+iboWPKqopmJJfWdBtVnHXs9rep0htPRExxGslImFk7Z6xjcaHyCpIQZPlOGf+sGsmUU7jRqzvZFV8ucIdbnAlMHrU4pepNFhuraESyZVTa/bi9sw0iozXp5Q5+5thMebEslmT1Z771kI4sieDy+O4r8c0Sx2/VY1UAzcpq1faggc3YB01MTh+tiEC6xdMvZLrQGL1NBWjHleMyL53GU5ERluC0vXJF3Hv3BGGBDfXWbrEm5n06DHr2apRVJGC0LwiQ7Woud1X4V4X1pKSusxCVMjT2lmcOwV6YhKhB2sowJc1OdMx4+tL0UWE+YKSZgBHfolwk6ml0F4EO9nnUHc= lelgenio@i15"; main_ssh_public_key = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCxR/w+38b2lX90yNBqhq3mUmkn1WGu6GAPhN1tVp2ZjYRJNV/+5gWCnTtOWYtDx35HmK/spQ2Qy8X9ttkzORa24fysNx1Iqn/TiXhD7eIJjbGPnrOpIKTkW5/uB3SD/P5NBSa06//BaqJU4sBlG79hoXRpod052hQtdpTVDiMCIV+iboWPKqopmJJfWdBtVnHXs9rep0htPRExxGslImFk7Z6xjcaHyCpIQZPlOGf+sGsmUU7jRqzvZFV8ucIdbnAlMHrU4pepNFhuraESyZVTa/bi9sw0iozXp5Q5+5thMebEslmT1Z771kI4sieDy+O4r8c0Sx2/VY1UAzcpq1faggc3YB01MTh+tiEC6xdMvZLrQGL1NBWjHleMyL53GU5ERluC0vXJF3Hv3BGGBDfXWbrEm5n06DHr2apRVJGC0LwiQ7Woud1X4V4X1pKSusxCVMjT2lmcOwV6YhKhB2sowJc1OdMx4+tL0UWE+YKSZgBHfolwk6ml0F4EO9nnUHc= lelgenio@i15";
in { in
{
"rainbow-gitlab-runner-thoreb-itinerario-registrationConfigFile.age".publicKeys = [ main_ssh_public_key ]; "rainbow-gitlab-runner-thoreb-itinerario-registrationConfigFile.age".publicKeys = [ main_ssh_public_key ];
"monolith-gitlab-runner-thoreb-itinerario-registrationConfigFile.age".publicKeys = [ main_ssh_public_key ]; "monolith-gitlab-runner-thoreb-itinerario-registrationConfigFile.age".publicKeys = [ main_ssh_public_key ];
"lelgenio-cachix.age".publicKeys = [ main_ssh_public_key ]; "lelgenio-cachix.age".publicKeys = [ main_ssh_public_key ];

View file

@ -1,7 +1,7 @@
{ config, pkgs, inputs, ... }: { { config, pkgs, inputs, ... }: {
console = { console = {
font = "ter-120n"; font = "ter-120n";
packages = [pkgs.terminus_font]; packages = [ pkgs.terminus_font ];
earlySetup = false; earlySetup = false;
}; };

View file

@ -16,7 +16,8 @@
# gtk portal needed to make gtk apps happy # gtk portal needed to make gtk apps happy
extraPortals = [ pkgs.xdg-desktop-portal-gtk ]; extraPortals = [ pkgs.xdg-desktop-portal-gtk ];
}; };
services.greetd = let services.greetd =
let
greetd_main_script = pkgs.writeShellScriptBin "main" '' greetd_main_script = pkgs.writeShellScriptBin "main" ''
${pkgs.dbus-sway-environment}/bin/dbus-sway-environment ${pkgs.dbus-sway-environment}/bin/dbus-sway-environment
export XDG_CURRENT_DESKTOP=sway GTK_THEME="${pkgs.uservars.gtk_theme}" XCURSOR_THEME="${pkgs.uservars.cursor_theme}" export XDG_CURRENT_DESKTOP=sway GTK_THEME="${pkgs.uservars.gtk_theme}" XCURSOR_THEME="${pkgs.uservars.cursor_theme}"
@ -39,7 +40,8 @@
xkb_options lv3:lsgt_switch,grp:shifts_toggle xkb_options lv3:lsgt_switch,grp:shifts_toggle
} }
''; '';
in { in
{
enable = true; enable = true;
settings = { settings = {
initial_session = { initial_session = {

View file

@ -38,12 +38,14 @@ in {
hints = { hints = {
alphabet = key.hints; alphabet = key.hints;
enabled = [{ enabled = [{
regex = let regex =
let
mimes = mimes =
"(mailto:|gemini:|gopher:|https:|http:|news:|file:|git:|ssh:|ftp:)"; "(mailto:|gemini:|gopher:|https:|http:|news:|file:|git:|ssh:|ftp:)";
# I fucking hate regex, look at this bullshit # I fucking hate regex, look at this bullshit
delimiters = ''^\\u0000-\\u001F\\u007F-\\u009F<>"\\s{-}\\^`''; delimiters = ''^\\u0000-\\u001F\\u007F-\\u009F<>"\\s{-}\\^`'';
in "${mimes}[${delimiters}]+"; in
"${mimes}[${delimiters}]+";
command = "xdg-open"; command = "xdg-open";
post_processing = true; post_processing = true;
mouse = { mouse = {

View file

@ -1,5 +1,6 @@
{ pkgs, ... }: { { pkgs, ... }: {
accounts.email.accounts = let accounts.email.accounts =
let
mkAccount = username: host: passName: { mkAccount = username: host: passName: {
realName = "Leonardo Eugênio"; realName = "Leonardo Eugênio";
address = "${username}@${host}"; address = "${username}@${host}";
@ -23,8 +24,9 @@
pass ${passName} | head -n1 pass ${passName} | head -n1
''); '');
}; };
in { in
"personal" = (mkAccount "lelgenio" "disroot.org" "disroot.org") // { primary = true; } ; {
"personal" = (mkAccount "lelgenio" "disroot.org" "disroot.org") // { primary = true; };
"work" = mkAccount "leonardo" "wopus.com.br" "Trabalho/wopus_email/leonardo@wopus.com.br"; "work" = mkAccount "leonardo" "wopus.com.br" "Trabalho/wopus_email/leonardo@wopus.com.br";
}; };

View file

@ -17,7 +17,8 @@ in {
}; };
make_extension = name: src: make_extension = name: src:
((pkgs.fetchFirefoxAddon { inherit name src; })); ((pkgs.fetchFirefoxAddon { inherit name src; }));
in lib.mapAttrsToList make_extension extensions_name_src; in
lib.mapAttrsToList make_extension extensions_name_src;
}; };
profiles = { profiles = {
main = { main = {

View file

@ -17,7 +17,8 @@ let
preview_opts = preview_opts =
"--preview '${pkgs.bat}/bin/bat --style=numbers --color=always {}'"; "--preview '${pkgs.bat}/bin/bat --style=numbers --color=always {}'";
in { in
{
programs.fzf = { programs.fzf = {
enable = true; enable = true;

View file

@ -155,9 +155,11 @@ in {
"thunar/".source = ./thunar; "thunar/".source = ./thunar;
}; };
xdg.userDirs = let xdg.userDirs =
let
HOME = config.home.homeDirectory; HOME = config.home.homeDirectory;
in { in
{
enable = true; enable = true;
createDirectories = true; createDirectories = true;

View file

@ -4,7 +4,8 @@ in {
config = { config = {
programs.kakoune = { programs.kakoune = {
enable = true; enable = true;
extraConfig = let extraConfig =
let
colors = lib.mapAttrs (_: lib.replaceStrings [ "#" ] [ "rgb:" ]) { colors = lib.mapAttrs (_: lib.replaceStrings [ "#" ] [ "rgb:" ]) {
accent_fg = accent.fg; accent_fg = accent.fg;
accent_color = accent.color; accent_color = accent.color;
@ -14,8 +15,10 @@ in {
orange = color.normal.orange; orange = color.normal.orange;
brown = color.normal.brown; brown = color.normal.brown;
}; };
in with colors; in
lib.concatStringsSep "\n" (map (lib.readFile) ([ with colors;
lib.concatStringsSep "\n"
(map (lib.readFile) ([
./kak/filetypes.kak ./kak/filetypes.kak
./kak/hooks.kak ./kak/hooks.kak
./kak/indent.kak ./kak/indent.kak
@ -110,12 +113,14 @@ in {
face global InlayHint ${bg_light}+buif face global InlayHint ${bg_light}+buif
# Lsp # Lsp
'' + (lib.concatStringsSep "\n" (lib.mapAttrsToList (name: color: '' '' + (lib.concatStringsSep "\n" (lib.mapAttrsToList
(name: color: ''
face global HighlightDiagnostic${name} ${color},default+bu face global HighlightDiagnostic${name} ${color},default+bu
face global Diagnostic${name} ${color},default+bu face global Diagnostic${name} ${color},default+bu
face global TextDiagnostic${name} ${color},default+b face global TextDiagnostic${name} ${color},default+b
face global InlayDiagnostic${name} ${color},default+br face global InlayDiagnostic${name} ${color},default+br
'') { '')
{
Error = "red"; Error = "red";
Warning = "yellow"; Warning = "yellow";
Hint = "blue"; Hint = "blue";

View file

@ -52,7 +52,8 @@ in {
# workaround to allow overriding mimeapps file # workaround to allow overriding mimeapps file
# btw, whatever it was that decided that damn file should always be written is an asshole # btw, whatever it was that decided that damn file should always be written is an asshole
xdg.configFile."mimeapps.list".force = true; xdg.configFile."mimeapps.list".force = true;
xdg.mimeApps = let xdg.mimeApps =
let
createMimeAssociation = (mime_prefix: application: mime_suffix: { createMimeAssociation = (mime_prefix: application: mime_suffix: {
"${mime_prefix}/${mime_suffix}" = application; "${mime_prefix}/${mime_suffix}" = application;
@ -312,7 +313,8 @@ in {
"x-theora" "x-theora"
"x-theora+ogg" "x-theora+ogg"
]; ];
in { in
{
enable = true; enable = true;
defaultApplications = mimes; defaultApplications = mimes;
}; };

View file

@ -1,4 +1,4 @@
{pkgs, config, ...}: { { pkgs, config, ... }: {
services.mpd = { services.mpd = {
enable = true; enable = true;
musicDirectory = config.home.homeDirectory + "/Música"; musicDirectory = config.home.homeDirectory + "/Música";

View file

@ -6,7 +6,8 @@ let
let let
sign = if (idx < 2) then 1 else -1; sign = if (idx < 2) then 1 else -1;
axis = if ((lib.mod idx 2) != 0) then "y" else "x"; axis = if ((lib.mod idx 2) != 0) then "y" else "x";
in '' in
''
${key.${direction}} { shift_${axis}(${toString (sign * 10)}) } ${key.${direction}} { shift_${axis}(${toString (sign * 10)}) }
${lib.toUpper key.${direction}} { shift_${axis}(${toString (sign * 50)}) } ${lib.toUpper key.${direction}} { shift_${axis}(${toString (sign * 50)}) }
@MONTAGE{ @MONTAGE{
@ -16,7 +17,8 @@ let
} }
''); '');
in { in
{
# My bemenu wrapper # My bemenu wrapper
xdg.configFile = { xdg.configFile = {
"pqivrc".text = '' "pqivrc".text = ''

View file

@ -64,7 +64,8 @@ in {
# Tabs # Tabs
######################################################## ########################################################
tabs = let tabs =
let
tabs_defaults = { tabs_defaults = {
odd = { odd = {
fg = color.txt; fg = color.txt;
@ -85,7 +86,8 @@ in {
}; };
}; };
}; };
in { in
{
bar = { bg = color.bg; }; bar = { bg = color.bg; };
pinned = tabs_defaults; pinned = tabs_defaults;
} // tabs_defaults; } // tabs_defaults;

View file

@ -4,10 +4,12 @@ in {
config = { config = {
programs.rofi = { programs.rofi = {
enable = true; enable = true;
package = pkgs.rofi-wayland.override { plugins = with pkgs; [ package = pkgs.rofi-wayland.override {
plugins = with pkgs; [
rofi-emoji rofi-emoji
rofi-file-browser rofi-file-browser
];}; ];
};
extraConfig = { extraConfig = {
show-icons = true; show-icons = true;
modi = "drun,emoji"; modi = "drun,emoji";
@ -17,7 +19,8 @@ in {
kb-primary-paste = "Control+V,Shift+Insert"; kb-primary-paste = "Control+V,Shift+Insert";
kb-secondary-paste = "Control+v,Insert"; kb-secondary-paste = "Control+v,Insert";
}; };
theme = let theme =
let
# Use `mkLiteral` for string-like values that should show without # Use `mkLiteral` for string-like values that should show without
# quotes, e.g.: # quotes, e.g.:
# { # {
@ -25,7 +28,8 @@ in {
# bar = mkLiteral "abc"; => bar: abc; # bar = mkLiteral "abc"; => bar: abc;
# }; # };
inherit (config.lib.formats.rasi) mkLiteral; inherit (config.lib.formats.rasi) mkLiteral;
in { in
{
"*" = { "*" = {
# foreground-color = mkLiteral color.txt; # foreground-color = mkLiteral color.txt;
text-color = mkLiteral color.txt; text-color = mkLiteral color.txt;

View file

@ -24,10 +24,12 @@ let
systemctl --user start swayidle.service systemctl --user start swayidle.service
fi fi
''; '';
in { in
{
imports = [ ./theme.nix ]; imports = [ ./theme.nix ];
config = { config = {
wayland.windowManager.sway = let wayland.windowManager.sway =
let
mod = "Mod4"; mod = "Mod4";
menu = "wlauncher"; menu = "wlauncher";
terminal = "alacritty"; terminal = "alacritty";
@ -38,7 +40,8 @@ in {
mergeAttrsSet = lib.foldAttrs (n: _: n) { }; mergeAttrsSet = lib.foldAttrs (n: _: n) { };
forEachMerge = list: func: mergeAttrsSet (lib.forEach list func); forEachMerge = list: func: mergeAttrsSet (lib.forEach list func);
in { in
{
enable = true; enable = true;
config = { config = {
bars = [ ]; bars = [ ];
@ -48,7 +51,8 @@ in {
smartBorders = "on"; smartBorders = "on";
inner = 5; inner = 5;
}; };
colors = let colors =
let
acc = accent.color; acc = accent.color;
fg_acc = accent.fg; fg_acc = accent.fg;
fg_color = color.txt; fg_color = color.txt;
@ -57,7 +61,8 @@ in {
client = border: background: text: indicator: childBorder: { client = border: background: text: indicator: childBorder: {
inherit border background text indicator childBorder; inherit border background text indicator childBorder;
}; };
in { in
{
focused = client acc acc fg_acc acc acc; focused = client acc acc fg_acc acc acc;
focusedInactive = client bg_color bg_color fg_color bg_color bg_color; focusedInactive = client bg_color bg_color fg_color bg_color bg_color;
unfocused = client bg_color bg_color fg_color bg_color bg_color; unfocused = client bg_color bg_color fg_color bg_color bg_color;
@ -122,14 +127,17 @@ in {
{ app_id = "WebCord"; } { app_id = "WebCord"; }
]; ];
}; };
modes = let modes =
let
locked_binds = locked_binds =
lib.mapAttrs' (k: v: lib.nameValuePair "--locked ${k}" v); lib.mapAttrs' (k: v: lib.nameValuePair "--locked ${k}" v);
code_binds = code_binds =
lib.mapAttrs' (k: v: lib.nameValuePair "--to-code ${k}" v); lib.mapAttrs' (k: v: lib.nameValuePair "--to-code ${k}" v);
return_mode = lib.mapAttrs (k: v: "${v}; mode default"); return_mode = lib.mapAttrs (k: v: "${v}; mode default");
in { in
audio = code_binds (locked_binds { {
audio = code_binds
(locked_binds {
${key.tabR} = "exec volumesh -i 10"; ${key.tabR} = "exec volumesh -i 10";
${key.tabL} = "exec volumesh -d 10"; ${key.tabL} = "exec volumesh -d 10";
${key.right} = "exec mpc next"; ${key.right} = "exec mpc next";
@ -149,25 +157,30 @@ in {
}; };
floating = { floating = {
modifier = "Mod4"; modifier = "Mod4";
criteria = [ { class = "file_picker"; } { app_id = "file_picker"; } ]; criteria = [{ class = "file_picker"; } { app_id = "file_picker"; }];
}; };
keybindings = let keybindings =
let
# mod+1 to swich to workspace 1 # mod+1 to swich to workspace 1
# mod+shift+1 to move to workspace 1 # mod+shift+1 to move to workspace 1
workspace_binds = let workspace_binds =
let
workspaceBinds = map makeWorkspaceBinds (lib.range 1 10); workspaceBinds = map makeWorkspaceBinds (lib.range 1 10);
makeWorkspaceBinds = (i: makeWorkspaceBinds = (i:
let let
key = toString (lib.mod i 10); key = toString (lib.mod i 10);
workspaceNumber = toString i; workspaceNumber = toString i;
in { in
{
"${mod}+${key}" = "workspace number ${workspaceNumber}"; "${mod}+${key}" = "workspace number ${workspaceNumber}";
"${mod}+Shift+${key}" = "${mod}+Shift+${key}" =
"move container to workspace number ${workspaceNumber}"; "move container to workspace number ${workspaceNumber}";
}); });
in mergeAttrsSet workspaceBinds; in
mergeAttrsSet workspaceBinds;
prev_next_binds = let prev_next_binds =
let
maybe_window = key: maybe_window = key:
if (lib.strings.hasInfix "button" key) then if (lib.strings.hasInfix "button" key) then
"--whole-window" "--whole-window"
@ -194,11 +207,13 @@ in {
"button5" "button5"
"Tab" "Tab"
]; ];
in mergeAttrsSet (prev_binds ++ next_binds); in
mergeAttrsSet (prev_binds ++ next_binds);
# focus, move, resize, (focus and move output) # focus, move, resize, (focus and move output)
# for every direction with both arrow keys and vim keys # for every direction with both arrow keys and vim keys
movement_binds = let movement_binds =
let
directions = [ "Left" "Up" "Right" "Down" ]; directions = [ "Left" "Up" "Right" "Down" ];
makeVimKeys = (k: key.${lib.toLower k}); makeVimKeys = (k: key.${lib.toLower k});
makeArrowKeys = (k: k); makeArrowKeys = (k: k);
@ -209,12 +224,14 @@ in {
Right = "grow width 20px"; Right = "grow width 20px";
Down = "grow height 20px"; Down = "grow height 20px";
}.${direction}; }.${direction};
in forEachMerge [ makeVimKeys makeArrowKeys ] (prefixFun: in
forEachMerge [ makeVimKeys makeArrowKeys ] (prefixFun:
forEachMerge directions (direction: forEachMerge directions (direction:
let let
resize_cmd = makeResizeCommand direction; resize_cmd = makeResizeCommand direction;
keyBind = prefixFun direction; keyBind = prefixFun direction;
in { in
{
# Move focus # Move focus
"${mod}+${keyBind}" = "focus ${direction}"; "${mod}+${keyBind}" = "focus ${direction}";
# Move window # Move window
@ -291,7 +308,8 @@ in {
# "${mod}+Shift+e" = # "${mod}+Shift+e" =
# "exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit'"; # "exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit'";
}; };
in mergeAttrsSet [ in
mergeAttrsSet [
other_binds other_binds
workspace_binds workspace_binds
prev_next_binds prev_next_binds

View file

@ -77,7 +77,8 @@ let
}; };
}; };
}; };
in rec { in
rec {
key = keys.colemak; key = keys.colemak;
theme = themes.dark; theme = themes.dark;

View file

@ -72,9 +72,11 @@ in {
format = "<b>{:%H:%M %a %d/%m}</b>"; format = "<b>{:%H:%M %a %d/%m}</b>";
tooltip = false; tooltip = false;
}; };
mpd = let mpd =
let
mpc = "${pkgs.mpc-cli}/bin/mpc"; mpc = "${pkgs.mpc-cli}/bin/mpc";
in { in
{
format = "{stateIcon} {title} - {artist}"; format = "{stateIcon} {title} - {artist}";
format-paused = "{stateIcon}"; format-paused = "{stateIcon}";
format-stopped = ""; format-stopped = "";