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

@ -97,9 +97,10 @@
home-manager.extraSpecialArgs = { inherit inputs; }; home-manager.extraSpecialArgs = { inherit inputs; };
} }
] ++ 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,54 +1,55 @@
(inputs@{ system, packages, ... }: (inputs@{ system, packages, ... }:
{ pkgs, ... }: { { pkgs, ... }: {
nixpkgs.overlays = [ nixpkgs.overlays = [
inputs.nur.overlay inputs.nur.overlay
(import ../scripts) (import ../scripts)
(import ./sway.nix) (import ./sway.nix)
(final: prev: { (final: prev: {
unstable = inputs.nixpkgs-unstable.legacyPackages.${prev.system}; unstable = inputs.nixpkgs-unstable.legacyPackages.${prev.system};
}) })
(import ./sixel-patches.nix (inputs // { inherit pkgs; })) (import ./sixel-patches.nix (inputs // { inherit pkgs; }))
(final: prev: { (final: prev: {
inherit (packages) dzgui; inherit (packages) dzgui;
plymouth-theme-red = (import ./plymouth-theme-red.nix (inputs // { inherit pkgs; })); plymouth-theme-red = (import ./plymouth-theme-red.nix (inputs // { inherit pkgs; }));
uservars = import ../user/variables.nix; uservars = import ../user/variables.nix;
dhist = inputs.dhist.packages.${system}.dhist; dhist = inputs.dhist.packages.${system}.dhist;
demoji = inputs.demoji.packages.${system}.demoji; demoji = inputs.demoji.packages.${system}.demoji;
devenv = inputs.devenv.packages.${system}.devenv; devenv = inputs.devenv.packages.${system}.devenv;
mpvpaper = inputs.wegank.packages.${prev.system}.mpvpaper; mpvpaper = inputs.wegank.packages.${prev.system}.mpvpaper;
bemenu = prev.bemenu.overrideAttrs (o: { bemenu = prev.bemenu.overrideAttrs (o: {
preBuild = '' preBuild = ''
sed -i 's/ZWLR_LAYER_SHELL_V1_LAYER_TOP/ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY/g' lib/renderers/wayland/window.c sed -i 's/ZWLR_LAYER_SHELL_V1_LAYER_TOP/ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY/g' lib/renderers/wayland/window.c
''; '';
}); });
sea-orm-cli = sea-orm-cli =
inputs.sea-orm-cli.legacyPackages.${prev.system}.sea-orm-cli; inputs.sea-orm-cli.legacyPackages.${prev.system}.sea-orm-cli;
webcord = inputs.webcord.legacyPackages.${prev.system}.webcord; webcord = inputs.webcord.legacyPackages.${prev.system}.webcord;
nil-lsp = inputs.nil-lsp.packages.${prev.system}.nil; nil-lsp = inputs.nil-lsp.packages.${prev.system}.nil;
sway-unwrapped = prev.sway-unwrapped.overrideAttrs (old: { sway-unwrapped = prev.sway-unwrapped.overrideAttrs (old: {
patches = old.patches patches = old.patches
++ [ ../patches/sway/fix-hide_cursor-clearing-focus.patch ]; ++ [ ../patches/sway/fix-hide_cursor-clearing-focus.patch ];
}); });
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}
''; '';
}; };
papirus_red = papirus_red =
(final.unstable.papirus-icon-theme.override { color = "red"; }); (final.unstable.papirus-icon-theme.override { color = "red"; });
orchis_theme_compact = orchis_theme_compact =
(final.orchis-theme.override { tweaks = [ "compact" "solid" ]; }); (final.orchis-theme.override { tweaks = [ "compact" "solid" ]; });
nerdfonts_fira_hack = nerdfonts_fira_hack =
(final.nerdfonts.override { fonts = [ "FiraCode" "Hack" ]; }); (final.nerdfonts.override { fonts = [ "FiraCode" "Hack" ]; });
steam = prev.steam.override { steam = prev.steam.override {
extraPkgs = pkgs: with pkgs; [ capitaine-cursors bibata-cursors ]; extraPkgs = pkgs: with pkgs; [ capitaine-cursors bibata-cursors ];
}; };
}) })
]; ];
}) })

View file

@ -1,24 +1,27 @@
(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
script_body = pkgs.writeTextFile { script_body = pkgs.writeTextFile {
inherit name; inherit name;
executable = true; executable = true;
text = '' text = ''
${builtins.readFile text} ${builtins.readFile text}
''; '';
}; };
in (pkgs.writeShellApplication { in
inherit name runtimeInputs; (pkgs.writeShellApplication {
text = ''exec ${script_body} "$@"''; inherit name runtimeInputs;
checkPhase = ""; text = ''exec ${script_body} "$@"'';
})); checkPhase = "";
create_scripts = }));
lib.mapAttrs (name: deps: create_script name ./${name} deps); create_scripts =
in create_scripts { lib.mapAttrs (name: deps: create_script name ./${name} deps);
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 ];
@ -34,7 +37,7 @@
volumesh = [ pulseaudio libnotify ]; volumesh = [ pulseaudio libnotify ];
pulse_sink = [ pulseaudio pamixer final.wdmenu ]; pulse_sink = [ pulseaudio pamixer final.wdmenu ];
} // lib.mapAttrs import_script { } // lib.mapAttrs import_script {
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,41 +16,43 @@
# 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 =
greetd_main_script = pkgs.writeShellScriptBin "main" '' let
${pkgs.dbus-sway-environment}/bin/dbus-sway-environment greetd_main_script = pkgs.writeShellScriptBin "main" ''
export XDG_CURRENT_DESKTOP=sway GTK_THEME="${pkgs.uservars.gtk_theme}" XCURSOR_THEME="${pkgs.uservars.cursor_theme}" ${pkgs.dbus-sway-environment}/bin/dbus-sway-environment
${pkgs.greetd.gtkgreet}/bin/gtkgreet -l -c sway export XDG_CURRENT_DESKTOP=sway GTK_THEME="${pkgs.uservars.gtk_theme}" XCURSOR_THEME="${pkgs.uservars.cursor_theme}"
swaymsg exit ${pkgs.greetd.gtkgreet}/bin/gtkgreet -l -c sway
''; swaymsg exit
swayConfig = pkgs.writeText "greetd-sway-config" '' '';
# `-l` activates layer-shell mode. Notice that `swaymsg exit` will run after gtkgreet. swayConfig = pkgs.writeText "greetd-sway-config" ''
exec "${greetd_main_script}/bin/main" # `-l` activates layer-shell mode. Notice that `swaymsg exit` will run after gtkgreet.
bindsym Mod4+shift+e exec swaynag \ exec "${greetd_main_script}/bin/main"
-t warning \ bindsym Mod4+shift+e exec swaynag \
-m 'What do you want to do?' \ -t warning \
-b 'Poweroff' 'systemctl poweroff' \ -m 'What do you want to do?' \
-b 'Reboot' 'systemctl reboot' -b 'Poweroff' 'systemctl poweroff' \
input "*" { -b 'Reboot' 'systemctl reboot'
repeat_delay 200 input "*" {
repeat_rate 30 repeat_delay 200
xkb_layout us(colemak) repeat_rate 30
xkb_numlock enabled xkb_layout us(colemak)
xkb_options lv3:lsgt_switch,grp:shifts_toggle xkb_numlock enabled
} xkb_options lv3:lsgt_switch,grp:shifts_toggle
''; }
in { '';
enable = true; in
settings = { {
initial_session = { enable = true;
command = "${pkgs.sway}/bin/sway"; settings = {
user = "lelgenio"; initial_session = {
}; command = "${pkgs.sway}/bin/sway";
default_session = { user = "lelgenio";
command = "${pkgs.sway}/bin/sway --config ${swayConfig}"; };
default_session = {
command = "${pkgs.sway}/bin/sway --config ${swayConfig}";
};
}; };
}; };
};
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
sway sway
swaylock swaylock

View file

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

View file

@ -1,32 +1,34 @@
{ pkgs, ... }: { { pkgs, ... }: {
accounts.email.accounts = let accounts.email.accounts =
mkAccount = username: host: passName: { let
realName = "Leonardo Eugênio"; mkAccount = username: host: passName: {
address = "${username}@${host}"; realName = "Leonardo Eugênio";
userName = username; address = "${username}@${host}";
astroid.enable = true; userName = username;
imap.host = host; astroid.enable = true;
smtp.host = host; imap.host = host;
imapnotify = { smtp.host = host;
enable = true; imapnotify = {
onNotify = "${pkgs.isync}/bin/mbsync -a"; enable = true;
onNotifyPost = onNotify = "${pkgs.isync}/bin/mbsync -a";
"${pkgs.notmuch}/bin/notmuch new && ${pkgs.libnotify}/bin/ notify-send 'New mail arrived'"; onNotifyPost =
"${pkgs.notmuch}/bin/notmuch new && ${pkgs.libnotify}/bin/ notify-send 'New mail arrived'";
};
mbsync = {
enable = true;
create = "both";
};
msmtp.enable = true;
notmuch.enable = true;
passwordCommand = toString (pkgs.writeShellScript "get_pass" ''
pass ${passName} | head -n1
'');
}; };
mbsync = { in
enable = true; {
create = "both"; "personal" = (mkAccount "lelgenio" "disroot.org" "disroot.org") // { primary = true; };
}; "work" = mkAccount "leonardo" "wopus.com.br" "Trabalho/wopus_email/leonardo@wopus.com.br";
msmtp.enable = true;
notmuch.enable = true;
passwordCommand = toString (pkgs.writeShellScript "get_pass" ''
pass ${passName} | head -n1
'');
}; };
in {
"personal" = (mkAccount "lelgenio" "disroot.org" "disroot.org") // { primary = true; } ;
"work" = mkAccount "leonardo" "wopus.com.br" "Trabalho/wopus_email/leonardo@wopus.com.br";
};
services.imapnotify.enable = true; services.imapnotify.enable = true;

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

@ -147,29 +147,31 @@ in {
programs.bash = { enable = true; }; programs.bash = { enable = true; };
services.nextcloud-client = { services.nextcloud-client = {
enable = true; enable = true;
startInBackground = true; startInBackground = true;
}; };
xdg.configFile = { xdg.configFile = {
"thunar/".source = ./thunar; "thunar/".source = ./thunar;
}; };
xdg.userDirs = let xdg.userDirs =
HOME = config.home.homeDirectory; let
in { HOME = config.home.homeDirectory;
enable = true; in
createDirectories = true; {
enable = true;
createDirectories = true;
desktop = "${HOME}/Área de trabalho"; desktop = "${HOME}/Área de trabalho";
documents = "${HOME}/Documentos"; documents = "${HOME}/Documentos";
download = "${HOME}/Downloads"; download = "${HOME}/Downloads";
music = "${HOME}/Música"; music = "${HOME}/Música";
pictures = "${HOME}/Imagens"; pictures = "${HOME}/Imagens";
publicShare = "${HOME}/Público"; publicShare = "${HOME}/Público";
templates = "${HOME}/Modelos"; templates = "${HOME}/Modelos";
videos = "${HOME}/Vídeos"; videos = "${HOME}/Vídeos";
}; };
systemd.user.services = { systemd.user.services = {
steam = { steam = {

View file

@ -4,122 +4,127 @@ in {
config = { config = {
programs.kakoune = { programs.kakoune = {
enable = true; enable = true;
extraConfig = let extraConfig =
colors = lib.mapAttrs (_: lib.replaceStrings [ "#" ] [ "rgb:" ]) { let
accent_fg = accent.fg; colors = lib.mapAttrs (_: lib.replaceStrings [ "#" ] [ "rgb:" ]) {
accent_color = accent.color; accent_fg = accent.fg;
bg_light = color.bg_light; accent_color = accent.color;
bg_dark = color.bg_dark; bg_light = color.bg_light;
nontxt = color.nontxt; bg_dark = color.bg_dark;
orange = color.normal.orange; nontxt = color.nontxt;
brown = color.normal.brown; orange = color.normal.orange;
}; brown = color.normal.brown;
in with colors; };
lib.concatStringsSep "\n" (map (lib.readFile) ([ in
./kak/filetypes.kak with colors;
./kak/hooks.kak lib.concatStringsSep "\n"
./kak/indent.kak (map (lib.readFile) ([
./kak/keys.kak ./kak/filetypes.kak
./kak/plug.kak ./kak/hooks.kak
./kak/usermode.kak ./kak/indent.kak
./kak/git-mode.kak ./kak/keys.kak
] ++ lib.optional (dmenu == "rofi") ./kak/rofi-commands.kak)) + '' ./kak/plug.kak
./kak/usermode.kak
./kak/git-mode.kak
] ++ lib.optional (dmenu == "rofi") ./kak/rofi-commands.kak)) + ''
set global scrolloff 10,20 set global scrolloff 10,20
set global autoreload yes set global autoreload yes
set global startup_info_version 20200901 set global startup_info_version 20200901
'' + '' '' + ''
face global crosshairs_line default,${bg_dark} face global crosshairs_line default,${bg_dark}
face global crosshairs_column default+b face global crosshairs_column default+b
# For Code # For Code
face global value magenta face global value magenta
face global type yellow face global type yellow
face global variable blue face global variable blue
face global module ${brown} face global module ${brown}
face global function ${orange} face global function ${orange}
face global string green face global string green
face global keyword ${accent_color} face global keyword ${accent_color}
face global operator yellow face global operator yellow
face global attribute cyan face global attribute cyan
face global comment ${bg_light} face global comment ${bg_light}
face global documentation comment face global documentation comment
face global meta +i@function face global meta +i@function
face global builtin blue face global builtin blue
# For markup # For markup
face global title blue face global title blue
face global header cyan face global header cyan
face global mono green face global mono green
face global block magenta face global block magenta
face global link cyan face global link cyan
face global bullet cyan face global bullet cyan
face global list yellow face global list yellow
# builtin faces # builtin faces
face global Default default,default face global Default default,default
face global PrimaryCursor ${accent_fg},${accent_color}+fg face global PrimaryCursor ${accent_fg},${accent_color}+fg
face global PrimaryCursorEol PrimaryCursor face global PrimaryCursorEol PrimaryCursor
face global PrimarySelection default,${bg_light}+f face global PrimarySelection default,${bg_light}+f
face global SecondaryCursor default,default+rfg face global SecondaryCursor default,default+rfg
face global SecondaryCursorEol SecondaryCursor face global SecondaryCursorEol SecondaryCursor
face global SecondarySelection PrimarySelection face global SecondarySelection PrimarySelection
face global InactiveCursor ${accent_fg},${bg_light}+fg face global InactiveCursor ${accent_fg},${bg_light}+fg
face global MenuForeground ${accent_fg},${accent_color} face global MenuForeground ${accent_fg},${accent_color}
face global MenuBackground default,${bg_dark} face global MenuBackground default,${bg_dark}
face global MenuInfo cyan face global MenuInfo cyan
face global Information default,${bg_dark} face global Information default,${bg_dark}
face global Error default,red+g face global Error default,red+g
face global StatusLine %sh{ face global StatusLine %sh{
printf "rgb:" printf "rgb:"
head /dev/urandom | head /dev/urandom |
base64 | base64 |
rg --text -o "${color.random_range}" | rg --text -o "${color.random_range}" |
head -n 6 | head -n 6 |
sd '\n' "" sd '\n' ""
} }
face global StatusLineMode StatusLine face global StatusLineMode StatusLine
face global StatusLineInfo StatusLine face global StatusLineInfo StatusLine
face global StatusLineValue StatusLine face global StatusLineValue StatusLine
face global StatusCursor ${accent_fg},${accent_color} face global StatusCursor ${accent_fg},${accent_color}
face global Prompt yellow,default face global Prompt yellow,default
try %{add-highlighter global/ show-matching} try %{add-highlighter global/ show-matching}
face global MatchingChar ${accent_color},default+b face global MatchingChar ${accent_color},default+b
# Goodies # Goodies
try %{add-highlighter global/number-lines number-lines -relative -hlcursor} try %{add-highlighter global/number-lines number-lines -relative -hlcursor}
face global LineNumbers ${bg_light},default face global LineNumbers ${bg_light},default
face global LineNumberCursor default,${bg_dark} face global LineNumberCursor default,${bg_dark}
face global LineNumbersWrapped red,default face global LineNumbersWrapped red,default
try %{add-highlighter global/ show-whitespaces} try %{add-highlighter global/ show-whitespaces}
face global Whitespace ${nontxt},default+f face global Whitespace ${nontxt},default+f
face global BufferPadding ${nontxt},default face global BufferPadding ${nontxt},default
## highlight trailing whitespace ## highlight trailing whitespace
# add-highlighter global/ regex '\h*$' 0:red,red+u # add-highlighter global/ regex '\h*$' 0:red,red+u
face global Reference default+bu face global Reference default+bu
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
face global HighlightDiagnostic${name} ${color},default+bu (name: color: ''
face global Diagnostic${name} ${color},default+bu face global HighlightDiagnostic${name} ${color},default+bu
face global TextDiagnostic${name} ${color},default+b face global Diagnostic${name} ${color},default+bu
face global InlayDiagnostic${name} ${color},default+br face global TextDiagnostic${name} ${color},default+b
'') { face global InlayDiagnostic${name} ${color},default+br
Error = "red"; '')
Warning = "yellow"; {
Hint = "blue"; Error = "red";
})); Warning = "yellow";
Hint = "blue";
}));
}; };
home.file = { ".config/kak-lsp/kak-lsp.toml".source = ./kak/kak-lsp.toml; }; home.file = { ".config/kak-lsp/kak-lsp.toml".source = ./kak/kak-lsp.toml; };
home.packages = with pkgs; [ home.packages = with pkgs; [

View file

@ -52,270 +52,272 @@ 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;
}); });
createMimeAssociations = (mime_prefix: application: mime_suffixes: createMimeAssociations = (mime_prefix: application: mime_suffixes:
lib.foldAttrs (n: _: n) { } lib.foldAttrs (n: _: n) { }
(map (createMimeAssociation mime_prefix application) mime_suffixes)); (map (createMimeAssociation mime_prefix application) mime_suffixes));
mimes = simple mimes = simple
// (createMimeAssociations "image" "pqiv.desktop" image_suffixes) // (createMimeAssociations "image" "pqiv.desktop" image_suffixes)
// (createMimeAssociations "video" "mpv.desktop" video_suffixes); // (createMimeAssociations "video" "mpv.desktop" video_suffixes);
browser_desktop = { browser_desktop = {
firefox = "firefox.desktop"; firefox = "firefox.desktop";
qutebrowser = "org.qutebrowser.qutebrowser.desktop"; qutebrowser = "org.qutebrowser.qutebrowser.desktop";
}.${browser}; }.${browser};
simple = { simple = {
"text/plain" = "kak.desktop"; "text/plain" = "kak.desktop";
"inode/directory" = "thunar.desktop"; "inode/directory" = "thunar.desktop";
"application/pdf" = "org.pwmt.zathura.desktop"; "application/pdf" = "org.pwmt.zathura.desktop";
"application/epub+zip" = "org.pwmt.zathura.desktop"; "application/epub+zip" = "org.pwmt.zathura.desktop";
"text/html" = browser_desktop; "text/html" = browser_desktop;
"x-scheme-handler/http" = browser_desktop; "x-scheme-handler/http" = browser_desktop;
"x-scheme-handler/https" = browser_desktop; "x-scheme-handler/https" = browser_desktop;
"x-scheme-handler/magnet" = "torrent.desktop"; "x-scheme-handler/magnet" = "torrent.desktop";
"application/x-bittorrent" = "torrent.desktop"; "application/x-bittorrent" = "torrent.desktop";
"x-scheme-handler/mailto" = "thunderbird.desktop"; "x-scheme-handler/mailto" = "thunderbird.desktop";
};
image_suffixes = [
"bmp"
"cgm"
"dicom-rle"
"emf"
"example"
"fits"
"g3fax"
"gif"
"heic"
"heif"
"ief"
"jls"
"jp2"
"jpeg"
"jpeg"
"jpg"
"jpm"
"jpx"
"ktx"
"naplps"
"pjpeg"
"png"
"prs.btif"
"prs.pti"
"pwg-raster"
"svg+xml-compressed"
"svg+xml"
"t38"
"tiff-fx"
"tiff"
"vnd.adobe.photoshop"
"vnd.airzip.accelerator.azv"
"vnd.cns.inf2"
"vnd.dece.graphic"
"vnd.djvu"
"vnd.dvb.subtitle"
"vnd.dwg"
"vnd.dxf"
"vnd.fastbidsheet"
"vnd.fpx"
"vnd.fst"
"vnd.fujixerox.edmics-mmr"
"vnd.fujixerox.edmics-rlc"
"vnd.globalgraphics.pgb"
"vnd.microsoft.icon"
"vnd.mix"
"vnd.mozilla.apng"
"vnd.ms-modi"
"vnd.net-fpx"
"vnd.radiance"
"vnd.rn-realpix"
"vnd.sealed.png"
"vnd.sealedmedia.softseal.gif"
"vnd.sealedmedia.softseal.jpg"
"vnd.svf"
"vnd.tencent.tap"
"vnd.valve.source.texture"
"vnd.wap.wbmp"
"vnd.xiff"
"vnd.zbrush.pcx"
"webp"
"wmf"
"x-bmp"
"x-cmu-raster"
"x-compressed-xcf"
"x-emf"
"x-eps"
"x-exr"
"x-fits"
"x-freehand"
"x-gimp-gbr"
"x-gimp-gih"
"x-gimp-pat"
"x-icon"
"x-pcx"
"x-png"
"x-portable-anymap"
"x-portable-bitmap"
"x-portable-graymap"
"x-portable-pixmap"
"x-psd"
"x-psp"
"x-rgb"
"x-sgi"
"x-targa"
"x-tga"
"x-vsd"
"x-webp"
"x-wmf"
"x-xbitmap"
"x-xcdr"
"x-xcf"
"x-xcursor"
"x-xpixmap"
"x-xwindowdump"
];
video_suffixes = [
"1d-interleaved-parityfec"
"3gp"
"3gpp"
"3gpp-tt"
"3gpp2"
"BMPEG"
"BT656"
"CelB"
"DV"
"H261"
"H263"
"H263-1998"
"H263-2000"
"H264"
"H264-RCDO"
"H264-SVC"
"H265"
"JPEG"
"MP1S"
"MP2P"
"MP2T"
"MP4V-ES"
"MPV"
"SMPTE292M"
"VP8"
"avi"
"divx"
"dv"
"encaprtp"
"example"
"fli"
"flv"
"iso.segment"
"jpeg2000"
"mj2"
"mkv"
"mp2t"
"mp4"
"mp4v-es"
"mpeg"
"mpeg-system"
"mpeg4-generic"
"msvideo"
"nv"
"ogg"
"parityfec"
"pointer"
"quicktime"
"raptorfec"
"raw"
"rtp-enc-aescm128"
"rtploopback"
"rtx"
"ulpfec"
"vc1"
"vnd.CCTV"
"vnd.dece.hd"
"vnd.dece.mobile"
"vnd.dece.mp4"
"vnd.dece.pd"
"vnd.dece.sd"
"vnd.dece.video"
"vnd.directv.mpeg"
"vnd.directv.mpeg-tts"
"vnd.divx"
"vnd.dlna.mpeg-tts"
"vnd.dvb.file"
"vnd.fvt"
"vnd.hns.video"
"vnd.iptvforum.1dparityfec-1010"
"vnd.iptvforum.1dparityfec-2005"
"vnd.iptvforum.2dparityfec-1010"
"vnd.iptvforum.2dparityfec-2005"
"vnd.iptvforum.ttsavc"
"vnd.iptvforum.ttsmpeg2"
"vnd.motorola.video"
"vnd.motorola.videop"
"vnd.mpegurl"
"vnd.ms-playready.media.pyv"
"vnd.nokia.interleaved-multimedia"
"vnd.nokia.mp4vr"
"vnd.nokia.videovoip"
"vnd.objectvideo"
"vnd.radgamettools.bink"
"vnd.radgamettools.smacker"
"vnd.rn-realvideo"
"vnd.sealed.mpeg1"
"vnd.sealed.mpeg4"
"vnd.sealed.swf"
"vnd.sealedmedia.softseal.mov"
"vnd.uvvu.mp4"
"vnd.vivo"
"webm"
"x-anim"
"x-annodex"
"x-avi"
"x-flc"
"x-fli"
"x-flic"
"x-flv"
"x-javafx"
"x-m4v"
"x-matroska"
"x-matroska-3d"
"x-mpeg"
"x-mpeg-system"
"x-mpeg2"
"x-mpeg3"
"x-ms-afs"
"x-ms-asf"
"x-ms-asf-plugin"
"x-ms-asx"
"x-ms-wm"
"x-ms-wmv"
"x-ms-wmx"
"x-ms-wvx"
"x-ms-wvxvideo"
"x-msvideo"
"x-nsv"
"x-ogm"
"x-ogm+ogg"
"x-sgi-movie"
"x-theora"
"x-theora+ogg"
];
in
{
enable = true;
defaultApplications = mimes;
}; };
image_suffixes = [
"bmp"
"cgm"
"dicom-rle"
"emf"
"example"
"fits"
"g3fax"
"gif"
"heic"
"heif"
"ief"
"jls"
"jp2"
"jpeg"
"jpeg"
"jpg"
"jpm"
"jpx"
"ktx"
"naplps"
"pjpeg"
"png"
"prs.btif"
"prs.pti"
"pwg-raster"
"svg+xml-compressed"
"svg+xml"
"t38"
"tiff-fx"
"tiff"
"vnd.adobe.photoshop"
"vnd.airzip.accelerator.azv"
"vnd.cns.inf2"
"vnd.dece.graphic"
"vnd.djvu"
"vnd.dvb.subtitle"
"vnd.dwg"
"vnd.dxf"
"vnd.fastbidsheet"
"vnd.fpx"
"vnd.fst"
"vnd.fujixerox.edmics-mmr"
"vnd.fujixerox.edmics-rlc"
"vnd.globalgraphics.pgb"
"vnd.microsoft.icon"
"vnd.mix"
"vnd.mozilla.apng"
"vnd.ms-modi"
"vnd.net-fpx"
"vnd.radiance"
"vnd.rn-realpix"
"vnd.sealed.png"
"vnd.sealedmedia.softseal.gif"
"vnd.sealedmedia.softseal.jpg"
"vnd.svf"
"vnd.tencent.tap"
"vnd.valve.source.texture"
"vnd.wap.wbmp"
"vnd.xiff"
"vnd.zbrush.pcx"
"webp"
"wmf"
"x-bmp"
"x-cmu-raster"
"x-compressed-xcf"
"x-emf"
"x-eps"
"x-exr"
"x-fits"
"x-freehand"
"x-gimp-gbr"
"x-gimp-gih"
"x-gimp-pat"
"x-icon"
"x-pcx"
"x-png"
"x-portable-anymap"
"x-portable-bitmap"
"x-portable-graymap"
"x-portable-pixmap"
"x-psd"
"x-psp"
"x-rgb"
"x-sgi"
"x-targa"
"x-tga"
"x-vsd"
"x-webp"
"x-wmf"
"x-xbitmap"
"x-xcdr"
"x-xcf"
"x-xcursor"
"x-xpixmap"
"x-xwindowdump"
];
video_suffixes = [
"1d-interleaved-parityfec"
"3gp"
"3gpp"
"3gpp-tt"
"3gpp2"
"BMPEG"
"BT656"
"CelB"
"DV"
"H261"
"H263"
"H263-1998"
"H263-2000"
"H264"
"H264-RCDO"
"H264-SVC"
"H265"
"JPEG"
"MP1S"
"MP2P"
"MP2T"
"MP4V-ES"
"MPV"
"SMPTE292M"
"VP8"
"avi"
"divx"
"dv"
"encaprtp"
"example"
"fli"
"flv"
"iso.segment"
"jpeg2000"
"mj2"
"mkv"
"mp2t"
"mp4"
"mp4v-es"
"mpeg"
"mpeg-system"
"mpeg4-generic"
"msvideo"
"nv"
"ogg"
"parityfec"
"pointer"
"quicktime"
"raptorfec"
"raw"
"rtp-enc-aescm128"
"rtploopback"
"rtx"
"ulpfec"
"vc1"
"vnd.CCTV"
"vnd.dece.hd"
"vnd.dece.mobile"
"vnd.dece.mp4"
"vnd.dece.pd"
"vnd.dece.sd"
"vnd.dece.video"
"vnd.directv.mpeg"
"vnd.directv.mpeg-tts"
"vnd.divx"
"vnd.dlna.mpeg-tts"
"vnd.dvb.file"
"vnd.fvt"
"vnd.hns.video"
"vnd.iptvforum.1dparityfec-1010"
"vnd.iptvforum.1dparityfec-2005"
"vnd.iptvforum.2dparityfec-1010"
"vnd.iptvforum.2dparityfec-2005"
"vnd.iptvforum.ttsavc"
"vnd.iptvforum.ttsmpeg2"
"vnd.motorola.video"
"vnd.motorola.videop"
"vnd.mpegurl"
"vnd.ms-playready.media.pyv"
"vnd.nokia.interleaved-multimedia"
"vnd.nokia.mp4vr"
"vnd.nokia.videovoip"
"vnd.objectvideo"
"vnd.radgamettools.bink"
"vnd.radgamettools.smacker"
"vnd.rn-realvideo"
"vnd.sealed.mpeg1"
"vnd.sealed.mpeg4"
"vnd.sealed.swf"
"vnd.sealedmedia.softseal.mov"
"vnd.uvvu.mp4"
"vnd.vivo"
"webm"
"x-anim"
"x-annodex"
"x-avi"
"x-flc"
"x-fli"
"x-flic"
"x-flv"
"x-javafx"
"x-m4v"
"x-matroska"
"x-matroska-3d"
"x-mpeg"
"x-mpeg-system"
"x-mpeg2"
"x-mpeg3"
"x-ms-afs"
"x-ms-asf"
"x-ms-asf-plugin"
"x-ms-asx"
"x-ms-wm"
"x-ms-wmv"
"x-ms-wmx"
"x-ms-wvx"
"x-ms-wvxvideo"
"x-msvideo"
"x-nsv"
"x-ogm"
"x-ogm+ogg"
"x-sgi-movie"
"x-theora"
"x-theora+ogg"
];
in {
enable = true;
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,31 +64,33 @@ in {
# Tabs # Tabs
######################################################## ########################################################
tabs = let tabs =
tabs_defaults = { let
odd = { tabs_defaults = {
fg = color.txt;
bg = color.bg;
};
even = {
fg = color.txt;
bg = color.bg_dark;
};
selected = {
odd = { odd = {
fg = accent.fg; fg = color.txt;
bg = accent.color; bg = color.bg;
}; };
even = { even = {
fg = accent.fg; fg = color.txt;
bg = accent.color; bg = color.bg_dark;
};
selected = {
odd = {
fg = accent.fg;
bg = accent.color;
};
even = {
fg = accent.fg;
bg = accent.color;
};
}; };
}; };
}; in
in { {
bar = { bg = color.bg; }; bar = { bg = color.bg; };
pinned = tabs_defaults; pinned = tabs_defaults;
} // tabs_defaults; } // tabs_defaults;
######################################################## ########################################################
# Completion for urls and commands # Completion for urls and commands

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 {
rofi-emoji plugins = with pkgs; [
rofi-file-browser rofi-emoji
];}; rofi-file-browser
];
};
extraConfig = { extraConfig = {
show-icons = true; show-icons = true;
modi = "drun,emoji"; modi = "drun,emoji";
@ -17,62 +19,64 @@ 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 =
# Use `mkLiteral` for string-like values that should show without let
# quotes, e.g.: # Use `mkLiteral` for string-like values that should show without
# { # quotes, e.g.:
# foo = "abc"; => foo: "abc"; # {
# bar = mkLiteral "abc"; => bar: abc; # foo = "abc"; => foo: "abc";
# }; # bar = mkLiteral "abc"; => bar: abc;
inherit (config.lib.formats.rasi) mkLiteral; # };
in { inherit (config.lib.formats.rasi) mkLiteral;
"*" = { in
# foreground-color = mkLiteral color.txt; {
text-color = mkLiteral color.txt; "*" = {
# background-color = mkLiteral color.bg; # foreground-color = mkLiteral color.txt;
background-color = mkLiteral "transparent"; text-color = mkLiteral color.txt;
# width = 512; # background-color = mkLiteral color.bg;
}; background-color = mkLiteral "transparent";
# width = 512;
};
"#window" = { "#window" = {
background-color = mkLiteral background-color = mkLiteral
"${color.bg}${lib.toHexString (theme.opacity * 255 / 100)}"; "${color.bg}${lib.toHexString (theme.opacity * 255 / 100)}";
# children = map mkLiteral [ "prompt" "entry" ]; # children = map mkLiteral [ "prompt" "entry" ];
border = mkLiteral "2px solid"; border = mkLiteral "2px solid";
border-color = mkLiteral accent.color; border-color = mkLiteral accent.color;
padding = 0; padding = 0;
}; };
"#inputbar" = { margin = mkLiteral "10px"; }; "#inputbar" = { margin = mkLiteral "10px"; };
"#listview" = { "#listview" = {
# fixed-height=0; # fixed-height=0;
border = mkLiteral "2px solid 0px 0px"; border = mkLiteral "2px solid 0px 0px";
# border-color = mkLiteral "@separatorcolor"; # border-color = mkLiteral "@separatorcolor";
# spacing= 0 ; # spacing= 0 ;
}; };
# "#textbox-prompt-colon" = { # "#textbox-prompt-colon" = {
# expand = false; # expand = false;
# str = ":"; # str = ":";
# margin = mkLiteral "0px 0.3em 0em 0em"; # margin = mkLiteral "0px 0.3em 0em 0em";
# text-color = mkLiteral "@foreground-color"; # text-color = mkLiteral "@foreground-color";
# }; # };
"#element" = { "#element" = {
# text-color = mkLiteral "#252525"; # text-color = mkLiteral "#252525";
background-color = mkLiteral "transparent"; background-color = mkLiteral "transparent";
padding = mkLiteral "3px 10px"; padding = mkLiteral "3px 10px";
}; };
"#element selected" = { "#element selected" = {
# text-color = mkLiteral "#252525"; # text-color = mkLiteral "#252525";
background-color = mkLiteral accent.color; background-color = mkLiteral accent.color;
}; };
element-icon = { element-icon = {
# background-color= inherit; # background-color= inherit;
# text-color= inherit; # text-color= inherit;
margin-right = mkLiteral "20px"; margin-right = mkLiteral "20px";
size = 24; size = 24;
}; };
}; };
}; };
}; };

View file

@ -24,291 +24,309 @@ 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 =
mod = "Mod4"; let
menu = "wlauncher"; mod = "Mod4";
terminal = "alacritty"; menu = "wlauncher";
terminal = "alacritty";
# Utility funcion # Utility funcion
# Input: [{v1=1;} {v2=2;}] # Input: [{v1=1;} {v2=2;}]
# Output: {v1=1;v2=2;} # Output: {v1=1;v2=2;}
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; {
config = { enable = true;
bars = [ ]; config = {
window.titlebar = false; bars = [ ];
gaps = { window.titlebar = false;
smartGaps = true; gaps = {
smartBorders = "on"; smartGaps = true;
inner = 5; smartBorders = "on";
}; inner = 5;
colors = let
acc = accent.color;
fg_acc = accent.fg;
fg_color = color.txt;
bg_color = color.bg_dark;
alert = "#000000";
client = border: background: text: indicator: childBorder: {
inherit border background text indicator childBorder;
}; };
in { colors =
focused = client acc acc fg_acc acc acc; let
focusedInactive = client bg_color bg_color fg_color bg_color bg_color; acc = accent.color;
unfocused = client bg_color bg_color fg_color bg_color bg_color; fg_acc = accent.fg;
urgent = client alert alert fg_color alert alert; fg_color = color.txt;
}; bg_color = color.bg_dark;
output = { alert = "#000000";
"*" = { client = border: background: text: indicator: childBorder: {
adaptive_sync = "on"; inherit border background text indicator childBorder;
bg = "${theme.background} fill"; };
in
{
focused = client acc acc fg_acc acc acc;
focusedInactive = client bg_color bg_color fg_color bg_color bg_color;
unfocused = client bg_color bg_color fg_color bg_color bg_color;
urgent = client alert alert fg_color alert alert;
};
output = {
"*" = {
adaptive_sync = "on";
bg = "${theme.background} fill";
};
"DP-1" = {
mode = "1920x1080@144.000Hz";
};
}; };
"DP-1" = { fonts = {
mode = "1920x1080@144.000Hz"; names = [ font.interface ];
size = font.size.medium * 1.0;
}; };
}; input."type:touchpad" = {
fonts = { # Disable While Typing
names = [ font.interface ]; dwt = "enabled";
size = font.size.medium * 1.0; natural_scroll = "enabled";
}; tap = "enabled";
input."type:touchpad" = { };
# Disable While Typing input."*" = {
dwt = "enabled"; xkb_layout = "us(colemak),br";
natural_scroll = "enabled"; xkb_options = "lv3:lsgt_switch,grp:shifts_toggle";
tap = "enabled"; xkb_numlock = "enabled";
}; repeat_rate = "30";
input."*" = { repeat_delay = "200";
xkb_layout = "us(colemak),br"; };
xkb_options = "lv3:lsgt_switch,grp:shifts_toggle"; # setup cursor based on home.pointerCursor
xkb_numlock = "enabled"; seat."*" = {
repeat_rate = "30"; xcursor_theme = "${config.home.pointerCursor.name} ${
repeat_delay = "200";
};
# setup cursor based on home.pointerCursor
seat."*" = {
xcursor_theme = "${config.home.pointerCursor.name} ${
toString config.home.pointerCursor.size toString config.home.pointerCursor.size
}"; }";
};
assigns = {
"2" = [
{ class = "qutebrowser"; }
{ app_id = "qutebrowser"; }
{ class = "firefox"; }
{ app_id = "firefox"; }
{ class = "Chromium"; }
{ app_id = "chromium"; }
];
"7" = [
{ app_id = "thunderbird"; }
];
"9" = [
{ class = ".*[Ss]team.*"; }
{ app_id = ".*[Ss]team.*"; }
{ app_id = "[Ll]utris"; }
];
"10" = [
{ app_id = ".*[Tt]elegram.*"; }
{ class = ".*[Tt]elegram.*"; }
{ class = "Jitsi Meet"; }
{ class = "discord"; }
{ title = "Discord"; }
{ class = "WebCord"; }
{ app_id = "WebCord"; }
];
};
modes = let
locked_binds =
lib.mapAttrs' (k: v: lib.nameValuePair "--locked ${k}" v);
code_binds =
lib.mapAttrs' (k: v: lib.nameValuePair "--to-code ${k}" v);
return_mode = lib.mapAttrs (k: v: "${v}; mode default");
in {
audio = code_binds (locked_binds {
${key.tabR} = "exec volumesh -i 10";
${key.tabL} = "exec volumesh -d 10";
${key.right} = "exec mpc next";
${key.left} = "exec mpc prev";
${key.up} = "exec volumesh --mpd -i 10";
${key.down} = "exec volumesh --mpd -d 10";
}) // return_mode {
"space" = "exec mpc toggle";
"escape" = "";
"q" = "";
"m" = "exec volumesh -t";
"s" = "exec ${pkgs.pulse_sink}/bin/pulse_sink";
}; };
passthrough = { assigns = {
"${mod}+escape" = "mode default;exec notify-send 'Passthrough off'"; "2" = [
}; { class = "qutebrowser"; }
}; { app_id = "qutebrowser"; }
floating = { { class = "firefox"; }
modifier = "Mod4"; { app_id = "firefox"; }
criteria = [ { class = "file_picker"; } { app_id = "file_picker"; } ]; { class = "Chromium"; }
}; { app_id = "chromium"; }
keybindings = let
# mod+1 to swich to workspace 1
# mod+shift+1 to move to workspace 1
workspace_binds = let
workspaceBinds = map makeWorkspaceBinds (lib.range 1 10);
makeWorkspaceBinds = (i:
let
key = toString (lib.mod i 10);
workspaceNumber = toString i;
in {
"${mod}+${key}" = "workspace number ${workspaceNumber}";
"${mod}+Shift+${key}" =
"move container to workspace number ${workspaceNumber}";
});
in mergeAttrsSet workspaceBinds;
prev_next_binds = let
maybe_window = key:
if (lib.strings.hasInfix "button" key) then
"--whole-window"
else
"";
makePrevNextBindFunction = (prev_or_next:
map (key: {
"${maybe_window key} ${mod}+${key}" =
"workspace ${prev_or_next}_on_output";
}));
prev_binds = makePrevNextBindFunction "prev" [
key.tabL
"bracketleft"
"Prior"
"button9"
"button4"
"Shift+Tab"
]; ];
next_binds = makePrevNextBindFunction "next" [ "7" = [
key.tabR { app_id = "thunderbird"; }
"bracketright"
"Next"
"button8"
"button5"
"Tab"
]; ];
in mergeAttrsSet (prev_binds ++ next_binds); "9" = [
{ class = ".*[Ss]team.*"; }
{ app_id = ".*[Ss]team.*"; }
{ app_id = "[Ll]utris"; }
];
"10" = [
{ app_id = ".*[Tt]elegram.*"; }
{ class = ".*[Tt]elegram.*"; }
{ class = "Jitsi Meet"; }
{ class = "discord"; }
{ title = "Discord"; }
{ class = "WebCord"; }
{ app_id = "WebCord"; }
];
};
modes =
let
locked_binds =
lib.mapAttrs' (k: v: lib.nameValuePair "--locked ${k}" v);
code_binds =
lib.mapAttrs' (k: v: lib.nameValuePair "--to-code ${k}" v);
return_mode = lib.mapAttrs (k: v: "${v}; mode default");
in
{
audio = code_binds
(locked_binds {
${key.tabR} = "exec volumesh -i 10";
${key.tabL} = "exec volumesh -d 10";
${key.right} = "exec mpc next";
${key.left} = "exec mpc prev";
${key.up} = "exec volumesh --mpd -i 10";
${key.down} = "exec volumesh --mpd -d 10";
}) // return_mode {
"space" = "exec mpc toggle";
"escape" = "";
"q" = "";
"m" = "exec volumesh -t";
"s" = "exec ${pkgs.pulse_sink}/bin/pulse_sink";
};
passthrough = {
"${mod}+escape" = "mode default;exec notify-send 'Passthrough off'";
};
};
floating = {
modifier = "Mod4";
criteria = [{ class = "file_picker"; } { app_id = "file_picker"; }];
};
keybindings =
let
# mod+1 to swich to workspace 1
# mod+shift+1 to move to workspace 1
workspace_binds =
let
workspaceBinds = map makeWorkspaceBinds (lib.range 1 10);
makeWorkspaceBinds = (i:
let
key = toString (lib.mod i 10);
workspaceNumber = toString i;
in
{
"${mod}+${key}" = "workspace number ${workspaceNumber}";
"${mod}+Shift+${key}" =
"move container to workspace number ${workspaceNumber}";
});
in
mergeAttrsSet workspaceBinds;
# focus, move, resize, (focus and move output) prev_next_binds =
# for every direction with both arrow keys and vim keys let
movement_binds = let maybe_window = key:
directions = [ "Left" "Up" "Right" "Down" ]; if (lib.strings.hasInfix "button" key) then
makeVimKeys = (k: key.${lib.toLower k}); "--whole-window"
makeArrowKeys = (k: k); else
makeResizeCommand = direction: "";
{ makePrevNextBindFunction = (prev_or_next:
Left = "shrink width 20px"; map (key: {
Up = "shrink height 20px"; "${maybe_window key} ${mod}+${key}" =
Right = "grow width 20px"; "workspace ${prev_or_next}_on_output";
Down = "grow height 20px"; }));
}.${direction}; prev_binds = makePrevNextBindFunction "prev" [
in forEachMerge [ makeVimKeys makeArrowKeys ] (prefixFun: key.tabL
forEachMerge directions (direction: "bracketleft"
let "Prior"
resize_cmd = makeResizeCommand direction; "button9"
keyBind = prefixFun direction; "button4"
in { "Shift+Tab"
# Move focus ];
"${mod}+${keyBind}" = "focus ${direction}"; next_binds = makePrevNextBindFunction "next" [
# Move window key.tabR
"${mod}+Shift+${keyBind}" = "move ${direction}"; "bracketright"
# Resize window "Next"
"${mod}+Control+${keyBind}" = "resize ${resize_cmd}"; "button8"
# focus output "button5"
"${mod}+mod1+${keyBind}" = "focus output ${direction}"; "Tab"
# Move workspace to output ];
"${mod}+mod1+Shift+${keyBind}" = in
"move workspace output ${direction}"; mergeAttrsSet (prev_binds ++ next_binds);
}));
parenting_binds = { # focus, move, resize, (focus and move output)
"${mod}+equal" = "focus parent"; # for every direction with both arrow keys and vim keys
"${mod}+minus" = "focus child"; movement_binds =
"${mod}+r" = "layout toggle split"; let
"${mod}+t" = "layout toggle split tabbed stacking"; directions = [ "Left" "Up" "Right" "Down" ];
"${mod}+b" = "splith"; makeVimKeys = (k: key.${lib.toLower k});
"${mod}+v" = "splitv"; makeArrowKeys = (k: k);
"${mod}+a" = "focus parent"; makeResizeCommand = direction:
{
Left = "shrink width 20px";
Up = "shrink height 20px";
Right = "grow width 20px";
Down = "grow height 20px";
}.${direction};
in
forEachMerge [ makeVimKeys makeArrowKeys ] (prefixFun:
forEachMerge directions (direction:
let
resize_cmd = makeResizeCommand direction;
keyBind = prefixFun direction;
in
{
# Move focus
"${mod}+${keyBind}" = "focus ${direction}";
# Move window
"${mod}+Shift+${keyBind}" = "move ${direction}";
# Resize window
"${mod}+Control+${keyBind}" = "resize ${resize_cmd}";
# focus output
"${mod}+mod1+${keyBind}" = "focus output ${direction}";
# Move workspace to output
"${mod}+mod1+Shift+${keyBind}" =
"move workspace output ${direction}";
}));
## TODO: parenting_binds = {
# "${mod}+Shift+minus" = "move scratchpad"; "${mod}+equal" = "focus parent";
# "${mod}+minus" = "scratchpad show"; "${mod}+minus" = "focus child";
}; "${mod}+r" = "layout toggle split";
"${mod}+t" = "layout toggle split tabbed stacking";
"${mod}+b" = "splith";
"${mod}+v" = "splitv";
"${mod}+a" = "focus parent";
audio_binds = { ## TODO:
XF86AudioRaiseVolume = "exec volumesh -i 10"; # "${mod}+Shift+minus" = "move scratchpad";
XF86AudioLowerVolume = "exec volumesh -d 10"; # "${mod}+minus" = "scratchpad show";
XF86AudioMute = "exec volumesh -t"; };
XF86AudioMicMute =
"exec pactl set-source-mute @DEFAULT_SOURCE@ toggle"; audio_binds = {
# Control media XF86AudioRaiseVolume = "exec volumesh -i 10";
XF86AudioPlay = "exec playerctl play-pause"; XF86AudioLowerVolume = "exec volumesh -d 10";
XF86AudioPause = "exec playerctl play-pause"; XF86AudioMute = "exec volumesh -t";
XF86AudioNext = "exec playerctl next"; XF86AudioMicMute =
XF86AudioPrev = "exec playerctl previous"; "exec pactl set-source-mute @DEFAULT_SOURCE@ toggle";
}; # Control media
system_binds = { XF86AudioPlay = "exec playerctl play-pause";
"--locked Ctrl+${mod}+z" = "exec ${_suspend}/bin/_suspend"; XF86AudioPause = "exec playerctl play-pause";
"${mod}+Alt+c" = "exec ${_sway_idle_toggle}/bin/_sway_idle_toggle"; XF86AudioNext = "exec playerctl next";
}; XF86AudioPrev = "exec playerctl previous";
screenshot_binds = { };
# Screens to file system_binds = {
"Print" = "exec ${pkgs.screenshotsh}/bin/screenshotsh def"; "--locked Ctrl+${mod}+z" = "exec ${_suspend}/bin/_suspend";
# Screen area to file "${mod}+Alt+c" = "exec ${_sway_idle_toggle}/bin/_sway_idle_toggle";
"Shift+Print" = "exec ${pkgs.screenshotsh}/bin/screenshotsh area"; };
# Screen area to clipboard screenshot_binds = {
"Control+Shift+Print" = # Screens to file
"exec ${pkgs.screenshotsh}/bin/screenshotsh area-clip"; "Print" = "exec ${pkgs.screenshotsh}/bin/screenshotsh def";
# Focused monitor to clipboard # Screen area to file
"Control+Print" = "exec ${pkgs.screenshotsh}/bin/screenshotsh clip"; "Shift+Print" = "exec ${pkgs.screenshotsh}/bin/screenshotsh area";
}; # Screen area to clipboard
other_binds = { "Control+Shift+Print" =
"${mod}+p" = "exec ${pkgs.wpass}/bin/wpass"; "exec ${pkgs.screenshotsh}/bin/screenshotsh area-clip";
"${mod}+s" = "exec ${menu}"; # Focused monitor to clipboard
"${mod}+g" = "exec ${pkgs.demoji}/bin/demoji --lang pt --fallback --copy -- ${pkgs.wdmenu}/bin/wdmenu"; "Control+Print" = "exec ${pkgs.screenshotsh}/bin/screenshotsh clip";
"${mod}+c" = "exec ${color_picker}"; };
"${mod}+Return" = "exec ${terminal}"; other_binds = {
"${mod}+Ctrl+Return" = "exec thunar"; "${mod}+p" = "exec ${pkgs.wpass}/bin/wpass";
"${mod}+Shift+s" = "exec grim - | swappy -f -"; "${mod}+s" = "exec ${menu}";
"${mod}+Ctrl+v" = "exec wl-paste | tesseract -l por - - | wl-copy"; "${mod}+g" = "exec ${pkgs.demoji}/bin/demoji --lang pt --fallback --copy -- ${pkgs.wdmenu}/bin/wdmenu";
"${mod}+k" = "exec showkeys"; "${mod}+c" = "exec ${color_picker}";
"${mod}+x" = "kill"; "${mod}+Return" = "exec ${terminal}";
"${mod}+m" = "mode audio"; "${mod}+Ctrl+Return" = "exec thunar";
"${mod}+escape" = "${mod}+Shift+s" = "exec grim - | swappy -f -";
"mode passthrough;exec notify-send 'Passthrough on'"; "${mod}+Ctrl+v" = "exec wl-paste | tesseract -l por - - | wl-copy";
"${mod}+f" = "fullscreen toggle"; "${mod}+k" = "exec showkeys";
"${mod}+Shift+space" = "floating toggle"; "${mod}+x" = "kill";
"${mod}+space" = "focus mode_toggle"; "${mod}+m" = "mode audio";
"${mod}+ctrl+space" = "sticky toggle"; "${mod}+escape" =
"${mod}+Shift+c" = "reload"; "mode passthrough;exec notify-send 'Passthrough on'";
# "${mod}+Shift+e" = "${mod}+f" = "fullscreen toggle";
# "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'"; "${mod}+Shift+space" = "floating toggle";
}; "${mod}+space" = "focus mode_toggle";
in mergeAttrsSet [ "${mod}+ctrl+space" = "sticky toggle";
other_binds "${mod}+Shift+c" = "reload";
workspace_binds # "${mod}+Shift+e" =
prev_next_binds # "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'";
movement_binds };
audio_binds in
system_binds mergeAttrsSet [
parenting_binds other_binds
screenshot_binds workspace_binds
]; prev_next_binds
terminal = pkgs.alacritty.executable; movement_binds
audio_binds
system_binds
parenting_binds
screenshot_binds
];
terminal = pkgs.alacritty.executable;
};
extraConfig = ''
for_window [title=.*] inhibit_idle fullscreen
exec ${pkgs.dbus-sway-environment}/bin/dbus-sway-environment
exec swaymsg workspace 2
'';
}; };
extraConfig = ''
for_window [title=.*] inhibit_idle fullscreen
exec ${pkgs.dbus-sway-environment}/bin/dbus-sway-environment
exec swaymsg workspace 2
'';
};
services.swayidle = { services.swayidle = {
enable = true; enable = true;
timeouts = [ timeouts = [

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,21 +72,23 @@ in {
format = "<b>{:%H:%M %a %d/%m}</b>"; format = "<b>{:%H:%M %a %d/%m}</b>";
tooltip = false; tooltip = false;
}; };
mpd = let mpd =
mpc = "${pkgs.mpc-cli}/bin/mpc"; let
in { mpc = "${pkgs.mpc-cli}/bin/mpc";
format = "{stateIcon} {title} - {artist}"; in
format-paused = "{stateIcon}"; {
format-stopped = ""; format = "{stateIcon} {title} - {artist}";
state-icons = { format-paused = "{stateIcon}";
paused = ""; format-stopped = "";
playing = ""; state-icons = {
paused = "";
playing = "";
};
tooltip = false;
on-click = "${mpc} toggle";
on-scroll-up = "${mpc} vol +10";
on-scroll-down = "${mpc} vol -10";
}; };
tooltip = false;
on-click = "${mpc} toggle";
on-scroll-up = "${mpc} vol +10";
on-scroll-down = "${mpc} vol -10";
};
"sway/language" = { format = "{short} {variant}"; }; "sway/language" = { format = "{short} {variant}"; };
"custom/caffeine" = { "custom/caffeine" = {
format = "{}"; format = "{}";