This commit is contained in:
Leonardo Eugênio 2022-07-21 00:32:09 -03:00
parent ed6f853da0
commit 810cf18e20
5 changed files with 306 additions and 338 deletions

View file

@ -5,7 +5,7 @@
nixpkgs-unstable.url = "nixpkgs/nixos-unstable"; nixpkgs-unstable.url = "nixpkgs/nixos-unstable";
home-manager.url = "github:nix-community/home-manager/release-22.05"; home-manager.url = "github:nix-community/home-manager/release-22.05";
home-manager.inputs.nixpkgs.follows = "nixpkgs"; home-manager.inputs.nixpkgs.follows = "nixpkgs";
nur.url = github:nix-community/NUR; nur.url = "github:nix-community/NUR";
}; };
outputs = { nixpkgs, nixpkgs-unstable, home-manager, nur, ... }: outputs = { nixpkgs, nixpkgs-unstable, home-manager, nur, ... }:
let let
@ -26,7 +26,9 @@
common_modules = [ common_modules = [
./system/configuration.nix ./system/configuration.nix
# nur.nixosModules.nur # nur.nixosModules.nur
({ config, pkgs, ... }: { nixpkgs.overlays = [ overlay-unstable nur.overlay ]; }) ({ config, pkgs, ... }: {
nixpkgs.overlays = [ overlay-unstable nur.overlay ];
})
home-manager.nixosModules.home-manager home-manager.nixosModules.home-manager
{ {
home-manager.useGlobalPkgs = true; home-manager.useGlobalPkgs = true;
@ -41,15 +43,13 @@
nixosConfigurations = { nixosConfigurations = {
i15 = lib.nixosSystem { i15 = lib.nixosSystem {
inherit system; inherit system;
modules = [ modules = [ ./system/i15-hardware-configuration.nix ]
./system/i15-hardware-configuration.nix ++ common_modules;
] ++ common_modules;
}; };
monolith = lib.nixosSystem { monolith = lib.nixosSystem {
inherit system; inherit system;
modules = [ modules = [ ./system/monolith-hardware-configuration.nix ]
./system/monolith-hardware-configuration.nix ++ common_modules;
] ++ common_modules;
}; };
}; };
}; };

View file

@ -3,7 +3,7 @@
# and in the NixOS manual (accessible by running nixos-help). # and in the NixOS manual (accessible by running nixos-help).
{ config, pkgs, ... }: { config, pkgs, ... }:
let let
# bash script to let dbus know about important env variables and # bash script to let dbus know about important env variables and
# propogate them to relevent services run at the end of sway config # propogate them to relevent services run at the end of sway config
# see # see
# https://github.com/emersion/xdg-desktop-portal-wlr/wiki/"It-doesn't-work"-Troubleshooting-Checklist # https://github.com/emersion/xdg-desktop-portal-wlr/wiki/"It-doesn't-work"-Troubleshooting-Checklist
@ -26,20 +26,19 @@ let
# using the XDG_DATA_DIR environment variable # using the XDG_DATA_DIR environment variable
# run at the end of sway config # run at the end of sway config
configure-gtk = pkgs.writeTextFile { configure-gtk = pkgs.writeTextFile {
name = "configure-gtk"; name = "configure-gtk";
destination = "/bin/configure-gtk"; destination = "/bin/configure-gtk";
executable = true; executable = true;
text = let text = let
schema = pkgs.gsettings-desktop-schemas; schema = pkgs.gsettings-desktop-schemas;
datadir = "${schema}/share/gsettings-schemas/${schema.name}"; datadir = "${schema}/share/gsettings-schemas/${schema.name}";
in '' in ''
export XDG_DATA_DIRS=${datadir}:$XDG_DATA_DIRS export XDG_DATA_DIRS=${datadir}:$XDG_DATA_DIRS
gnome_schema=org.gnome.desktop.interface gnome_schema=org.gnome.desktop.interface
gsettings set $gnome_schema gtk-theme 'Dracula' gsettings set $gnome_schema gtk-theme 'Dracula'
''; '';
}; };
in in {
{
# Bootloader. # Bootloader.
boot.loader.systemd-boot.enable = true; boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true; boot.loader.efi.canTouchEfiVariables = true;
@ -60,7 +59,7 @@ in
# services.xserver.displayManager.gdm.enable = true; # services.xserver.displayManager.gdm.enable = true;
# services.xserver.desktopManager.gnome.enable = true; # services.xserver.desktopManager.gnome.enable = true;
# services.xserver.displayManager.autologin.user = "lelgenio"; # services.xserver.displayManager.autologin.user = "lelgenio";
services.greetd = let services.greetd = let
swayConfig = pkgs.writeText "greetd-sway-config" '' swayConfig = pkgs.writeText "greetd-sway-config" ''
# `-l` activates layer-shell mode. Notice that `swaymsg exit` will run after gtkgreet. # `-l` activates layer-shell mode. Notice that `swaymsg exit` will run after gtkgreet.
exec "XDG_CURRENT_DESKTOP=sway GTK_THEME=Orchis-Red-Dark-Compact ${pkgs.greetd.gtkgreet}/bin/gtkgreet -l -c sway; swaymsg exit" exec "XDG_CURRENT_DESKTOP=sway GTK_THEME=Orchis-Red-Dark-Compact ${pkgs.greetd.gtkgreet}/bin/gtkgreet -l -c sway; swaymsg exit"
@ -120,7 +119,7 @@ in
users.users.lelgenio = { users.users.lelgenio = {
isNormalUser = true; isNormalUser = true;
description = "Leonardo Eugênio"; description = "Leonardo Eugênio";
extraGroups = [ "networkmanager" "wheel" "docker"]; extraGroups = [ "networkmanager" "wheel" "docker" ];
shell = pkgs.fish; shell = pkgs.fish;
}; };
# services.getty.autologinUser = "lelgenio"; # services.getty.autologinUser = "lelgenio";
@ -141,8 +140,8 @@ in
# List packages installed in system profile. To search, run: # List packages installed in system profile. To search, run:
# $ nix search wget # $ nix search wget
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
# vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. # vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
# wget # wget
git git
pinentry-curses pinentry-curses
firefox firefox
@ -161,7 +160,7 @@ in
wayland wayland
glib # gsettings glib # gsettings
dracula-theme # gtk theme dracula-theme # gtk theme
gnome3.adwaita-icon-theme # default gnome cursors gnome3.adwaita-icon-theme # default gnome cursors
swaylock swaylock
swayidle swayidle
grim # screenshot functionality grim # screenshot functionality

View file

@ -1,26 +1,23 @@
# Do not modify this file! It was generated by nixos-generate-config # Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes # and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead. # to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }: { config, lib, pkgs, modulesPath, ... }: {
{ imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
imports = boot.initrd.availableKernelModules =
[ (modulesPath + "/installer/scan/not-detected.nix") [ "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "rtsx_usb_sdmmc" ];
];
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "rtsx_usb_sdmmc" ];
boot.initrd.kernelModules = [ ]; boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ]; boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];
fileSystems."/" = fileSystems."/" = {
{ device = "/dev/disk/by-uuid/67af2da1-b4a8-4c32-a7e8-c1d0a8de21ab"; device = "/dev/disk/by-uuid/67af2da1-b4a8-4c32-a7e8-c1d0a8de21ab";
fsType = "ext4"; fsType = "ext4";
}; };
fileSystems."/boot/efi" = fileSystems."/boot/efi" = {
{ device = "/dev/disk/by-uuid/1428-8899"; device = "/dev/disk/by-uuid/1428-8899";
fsType = "vfat"; fsType = "vfat";
}; };
swapDevices = swapDevices =
[ { device = "/dev/disk/by-uuid/4d214f1e-63d5-4a1b-94fe-50af27824325"; } [{ device = "/dev/disk/by-uuid/4d214f1e-63d5-4a1b-94fe-50af27824325"; }];
];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking # Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's # (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction # still possible to use this option, but it's recommended to use it in conjunction
@ -29,6 +26,7 @@
# networking.interfaces.enp2s0.useDHCP = lib.mkDefault true; # networking.interfaces.enp2s0.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp1s0.useDHCP = lib.mkDefault true; # networking.interfaces.wlp1s0.useDHCP = lib.mkDefault true;
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; hardware.cpu.intel.updateMicrocode =
lib.mkDefault config.hardware.enableRedistributableFirmware;
networking.hostName = "i15"; # Define your hostname. networking.hostName = "i15"; # Define your hostname.
} }

View file

@ -1,44 +1,42 @@
# Do not modify this file! It was generated by nixos-generate-config # Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes # and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead. # to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }: { config, lib, pkgs, modulesPath, ... }: {
{ imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
imports = boot.initrd.availableKernelModules =
[ (modulesPath + "/installer/scan/not-detected.nix") [ "nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ];
];
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ];
boot.initrd.kernelModules = [ ]; boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ]; boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];
fileSystems."/" = fileSystems."/" = {
{ device = "/dev/disk/by-label/BTRFS_ROOT"; device = "/dev/disk/by-label/BTRFS_ROOT";
fsType = "btrfs"; fsType = "btrfs";
options = [ "subvol=nixos" ]; options = [ "subvol=nixos" ];
}; };
boot.initrd.luks.reusePassphrases = true; boot.initrd.luks.reusePassphrases = true;
boot.initrd.luks.devices = { boot.initrd.luks.devices = {
"main".device = "/dev/disk/by-label/CRYPT_ROOT"; "main".device = "/dev/disk/by-label/CRYPT_ROOT";
"data".device = "/dev/disk/by-label/CRYPT_DATA"; "data".device = "/dev/disk/by-label/CRYPT_DATA";
}; };
fileSystems."/boot/efi" = fileSystems."/boot/efi" = {
{ device = "/dev/disk/by-label/NIXBOOT"; device = "/dev/disk/by-label/NIXBOOT";
fsType = "vfat"; fsType = "vfat";
}; };
fileSystems."/home" = fileSystems."/home" = {
{ device = "/dev/disk/by-label/BTRFS_ROOT"; device = "/dev/disk/by-label/BTRFS_ROOT";
fsType = "btrfs"; fsType = "btrfs";
options = [ "subvol=home" ]; options = [ "subvol=home" ];
}; };
fileSystems."/home/lelgenio/Games" = fileSystems."/home/lelgenio/Games" = {
{ device = "/dev/disk/by-label/BTRFS_DATA"; device = "/dev/disk/by-label/BTRFS_DATA";
fsType = "btrfs"; fsType = "btrfs";
options = [ "subvol=@games" "nofail" ]; options = [ "subvol=@games" "nofail" ];
}; };
fileSystems."/home/lelgenio/Downloads/Torrents" = fileSystems."/home/lelgenio/Downloads/Torrents" = {
{ device = "/dev/disk/by-label/BTRFS_DATA"; device = "/dev/disk/by-label/BTRFS_DATA";
fsType = "btrfs"; fsType = "btrfs";
options = [ "subvol=@torrents" "nofail" ]; options = [ "subvol=@torrents" "nofail" ];
}; };
swapDevices = [ ]; swapDevices = [ ];
services.udev.extraRules = '' services.udev.extraRules = ''
ACTION=="add", SUBSYSTEM=="pci", DRIVER=="pcieport", ATTR{power/wakeup}="disabled" ACTION=="add", SUBSYSTEM=="pci", DRIVER=="pcieport", ATTR{power/wakeup}="disabled"
@ -49,6 +47,7 @@
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`. # with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true; networking.useDHCP = lib.mkDefault true;
# networking.interfaces.enp4s0.useDHCP = lib.mkDefault true; # networking.interfaces.enp4s0.useDHCP = lib.mkDefault true;
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; hardware.cpu.amd.updateMicrocode =
lib.mkDefault config.hardware.enableRedistributableFirmware;
networking.hostName = "monolith"; # Define your hostname. networking.hostName = "monolith"; # Define your hostname.
} }

View file

@ -1,9 +1,10 @@
{ config, pkgs, lib, ... }: let { config, pkgs, lib, ... }:
let
key = { key = {
left = "n"; left = "n";
down = "e"; down = "e";
up = "i"; up = "i";
right = "o"; right = "o";
tabL = "u"; tabL = "u";
tabR = "Y"; tabR = "Y";
}; };
@ -24,35 +25,37 @@
}; };
themes = { themes = {
dark = { dark = {
background = "~/.local/share/backgrounds/assembly_dark.png"; background = "~/.local/share/backgrounds/assembly_dark.png";
opacity= "98"; opacity = "98";
color = { color = {
type= "dark"; type = "dark";
bg= "#202020"; bg = "#202020";
bg_light= "#404040"; bg_light = "#404040";
bg_dark= "#191919"; bg_dark = "#191919";
txt= "#FFFFFF"; txt = "#FFFFFF";
nontxt= "#252525"; nontxt = "#252525";
random_range= "[a-f]"; random_range = "[a-f]";
normal = { normal = {
black= "#404040"; black = "#404040";
red= "#AB4642"; red = "#AB4642";
green= "#A1B56C"; green = "#A1B56C";
yellow= "#E6C547"; yellow = "#E6C547";
blue= "#6C99DA"; blue = "#6C99DA";
magenta= "#C397D8"; magenta = "#C397D8";
cyan= "#70C0BA"; cyan = "#70C0BA";
white= "#EAEAEA"; white = "#EAEAEA";
#non standard #non standard
orange= "#FF7500"; orange = "#FF7500";
brown= "#A07040"; brown = "#A07040";
}; };
}; };
}; };
}; };
papirus_red = (pkgs.unstable.papirus-icon-theme.override { color = "red"; }); papirus_red = (pkgs.unstable.papirus-icon-theme.override { color = "red"; });
orchis_theme_compact = (pkgs.orchis-theme.override { tweaks = [ "compact" "solid" ]; }); orchis_theme_compact =
nerdfonts_fira_hack = (pkgs.nerdfonts.override { fonts = [ "FiraCode" "Hack" ]; }); (pkgs.orchis-theme.override { tweaks = [ "compact" "solid" ]; });
nerdfonts_fira_hack =
(pkgs.nerdfonts.override { fonts = [ "FiraCode" "Hack" ]; });
accent = accents.red; accent = accents.red;
color = themes.dark.color; color = themes.dark.color;
pulse_sink = pkgs.writeShellScriptBin "pulse_sink" '' pulse_sink = pkgs.writeShellScriptBin "pulse_sink" ''
@ -60,12 +63,12 @@
output=$(printf "HDMI\nHeadphones" | bemenu -b) output=$(printf "HDMI\nHeadphones" | bemenu -b)
vol=$(${pkgs.pamixer}/bin/pamixer --get-volume) vol=$(${pkgs.pamixer}/bin/pamixer --get-volume)
case "$output" in case "$output" in
HDMI) HDMI)
pactl set-default-sink alsa_output.pci-0000_07_00.1.hdmi-stereo-extra1 pactl set-default-sink alsa_output.pci-0000_07_00.1.hdmi-stereo-extra1
;; ;;
Headphones) Headphones)
pactl set-default-sink alsa_output.pci-0000_09_00.4.analog-stereo pactl set-default-sink alsa_output.pci-0000_09_00.4.analog-stereo
;; ;;
esac esac
${pkgs.pamixer}/bin/pamixer --set-volume "$vol" ${pkgs.pamixer}/bin/pamixer --set-volume "$vol"
''; '';
@ -138,57 +141,53 @@ in {
}; };
}; };
keys.normal = { keys.normal = {
# basic movement # basic movement
n = "move_char_left"; n = "move_char_left";
e = "move_line_down"; e = "move_line_down";
i = "move_line_up"; i = "move_line_up";
o = "move_char_right"; o = "move_char_right";
# search # search
l = "search_next"; l = "search_next";
L = "search_prev"; L = "search_prev";
# edits # edits
s = "insert_mode"; s = "insert_mode";
# open newline # open newline
h = "open_below"; h = "open_below";
H = "open_above"; H = "open_above";
# selections # selections
k = "select_regex"; k = "select_regex";
K = "split_selection"; K = "split_selection";
"C-k" = "split_selection_on_newline"; "C-k" = "split_selection_on_newline";
# goto mode # goto mode
g.n = "goto_line_start"; g.n = "goto_line_start";
g.o = "goto_line_end"; g.o = "goto_line_end";
}; };
keys.select = { keys.select = {
# basic movement # basic movement
n = "extend_char_left"; n = "extend_char_left";
e = "extend_line_down"; e = "extend_line_down";
i = "extend_line_up"; i = "extend_line_up";
o = "extend_char_right"; o = "extend_char_right";
# search # search
l = "search_next"; l = "search_next";
L = "search_prev"; L = "search_prev";
# edits # edits
s = "insert_mode"; s = "insert_mode";
# open newline # open newline
h = "open_below"; h = "open_below";
H = "open_above"; H = "open_above";
# selections # selections
k = "select_regex"; k = "select_regex";
K = "split_selection"; K = "split_selection";
"C-k" = "split_selection_on_newline"; "C-k" = "split_selection_on_newline";
# goto mode # goto mode
g.n = "goto_line_start"; g.n = "goto_line_start";
g.o = "goto_line_end"; g.o = "goto_line_end";
}; };
keys.insert = { keys.insert = { "A-k" = "normal_mode"; };
"A-k" = "normal_mode";
};
}; };
}; };
home.sessionVariables = { home.sessionVariables = { EDITOR = "hx"; };
EDITOR = "hx";
};
programs.firefox = { programs.firefox = {
enable = true; enable = true;
package = pkgs.firefox; package = pkgs.firefox;
@ -223,102 +222,94 @@ in {
systemd.target = "sway-session.target"; systemd.target = "sway-session.target";
settings = [{ settings = [{
layer = "top"; layer = "top";
modules-left = [ modules-left = [ "sway/workspaces" "sway/mode" ];
"sway/workspaces" modules-center = [ "clock" ];
"sway/mode" modules-right = [ "pulseaudio" "network" ];
]; network = {
modules-center = [ interval = 5;
"clock" tooltip = false;
]; on-click = "terminal iwd";
modules-right = [ format-wifi = "{icon}";
"pulseaudio" format-icons = [ "" "" "" "" "" ];
"network" format-ethernet = "";
]; format-linked = "";
"network" = { format-disconnected = "";
"interval"= 5;
"tooltip" = false;
"on-click" = "terminal iwd";
"format-wifi" = "{icon}";
"format-icons" = [ "" "" "" "" "" ];
"format-ethernet" = "";
"format-linked" = "";
"format-disconnected" = "";
}; };
"clock" = { clock = {
"interval"=60; interval = 60;
"format"="<b>{:%H:%M %a %d/%m}</b>"; format = "<b>{:%H:%M %a %d/%m}</b>";
"tooltip"=false; tooltip = false;
}; };
"pulseaudio"= { pulseaudio = {
"interval"= 5; interval = 5;
"tooltip"=false; tooltip = false;
"scroll-step"= 10; scroll-step = 10;
"format"= "{icon}"; format = "{icon}";
"format-bluetooth"= ""; format-bluetooth = "";
"format-bluetooth-muted"= ""; format-bluetooth-muted = "";
"format-muted"= ""; format-muted = "";
"format-icons"= { format-icons = {
"headphone"= [" " " 奔" " "]; headphone = [ " " " 奔" " " ];
"handsfree"= ""; handsfree = "";
"headset"= ""; headset = "";
"phone"= ""; phone = "";
"portable"= ""; portable = "";
"car"= ""; car = "";
"default"= ["" "奔" ""]; default = [ "" "奔" "" ];
}; };
"on-click"= "pavucontrol"; on-click = "pavucontrol";
"on-click-right"= "pulse-sink"; on-click-right = "pulse-sink";
}; };
}]; }];
style = '' style = ''
/* {%@@ set bg_rgb = hex2rgb(color.bg) @@%} */ /* {%@@ set bg_rgb = hex2rgb(color.bg) @@%} */
* { * {
font: ${ font.size.medium }px "${ font.interface }", Font Awesome, Fira Code Nerd Font; font: ${font.size.medium}px "${font.interface}", Font Awesome, Fira Code Nerd Font;
border-radius:0; border-radius:0;
margin:0; margin:0;
padding: 0; padding: 0;
transition-duration:0; transition-duration:0;
} }
window#waybar { window#waybar {
/* background-color: rgba(30,30,30,.9); */ /* background-color: rgba(30,30,30,.9); */
transition-duration: .5s; transition-duration: .5s;
/* TODO: background opacity */ /* TODO: background opacity */
background-color: ${color.bg}; background-color: ${color.bg};
/*{%@@ if bar_pos == "top" @@%} /*{%@@ if bar_pos == "top" @@%}
border-bottom:
{%@@ else @@%}
border-top:
{%@@ endif @@%}*/
border-bottom: border-bottom:
{%@@ else @@%} 2px solid ${color.bg_dark};
border-top:
{%@@ endif @@%}*/
border-bottom:
2px solid ${ color.bg_dark };
} }
window#waybar.solo { window#waybar.solo {
background-color: ${ color.bg }; background-color: ${color.bg};
} }
#workspaces button { #workspaces button {
color: ${ color.bg_light }; color: ${color.bg_light};
min-width:50px; min-width:50px;
background-color: transparent; background-color: transparent;
border: 3px solid transparent; border: 3px solid transparent;
} }
#workspaces button.focused { #workspaces button.focused {
color: ${ color.txt }; color: ${color.txt};
/*{%@@ if bar_pos == "top" @@%} /*{%@@ if bar_pos == "top" @@%}
border-top: border-top:
{%@@ else @@%} {%@@ else @@%}
border-bottom: border-bottom:
{%@@ endif @@%}*/ {%@@ endif @@%}*/
border-top: border-top:
3px solid ${ accent.color }; 3px solid ${accent.color};
/* border-bottom: 3px solid transparent; */ /* border-bottom: 3px solid transparent; */
} }
/*Window Title*/ /*Window Title*/
#window { #window {
color: ${ color.txt }; color: ${color.txt};
margin:0 4px; margin:0 4px;
} }
#mode { #mode {
color: ${ accent.color }; color: ${accent.color};
} }
#mpd, #mpd,
#custom-mpd, #custom-mpd,
@ -340,48 +331,48 @@ in {
#custom-delugeS, #custom-delugeS,
#custom-caffeine #custom-caffeine
{ {
margin: 0 7px; margin: 0 7px;
color: ${ color.txt }; color: ${color.txt};
opacity:.7; opacity:.7;
} }
#battery{ #battery{
margin-right:15px; margin-right:15px;
} }
#clock, #clock,
#custom-weather #custom-weather
{ {
font-size: ${ font.size.big }px; font-size: ${font.size.big}px;
} }
#network, #network,
#pulseaudio, #pulseaudio,
#custom-caffeine #custom-caffeine
{ {
margin-top:-1px; margin-top:-1px;
font-size:16px; font-size:16px;
} }
#mpd, #mpd,
#window, #window,
#workspaces #workspaces
{ {
font-weight:normal; font-weight:normal;
} }
#custom-unpushed, #custom-unpushed,
#custom-recording { #custom-recording {
min-width:15px; min-width:15px;
color: #ee4040; color: #ee4040;
} }
#tray { #tray {
padding: 0; padding: 0;
margin: 0; margin: 0;
} }
#language { #language {
font-size: ${ font.size.medium }px; font-size: ${font.size.medium}px;
color: ${ color.bg_light }; color: ${color.bg_light};
} }
#custom-sleep { #custom-sleep {
color: ${ accent.color }; color: ${accent.color};
font-size: ${ font.size.big }px; font-size: ${font.size.big}px;
font-weight: bold; font-weight: bold;
} }
''; '';
}; };
@ -395,23 +386,21 @@ in {
smartBorders = "on"; smartBorders = "on";
inner = 5; inner = 5;
}; };
colors = colors = let
let acc = accent.color;
acc = accent.color; fg_acc = accent.fg;
fg_acc = accent.fg; fg_color = color.txt;
fg_color = color.txt; bg_color = color.bg_dark;
bg_color = color.bg_dark; alert = "#000000";
alert = "#000000"; 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
{
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;
}; };
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;
};
input."type:touchpad" = { input."type:touchpad" = {
# Disable While Typing # Disable While Typing
dwt = "disabled"; dwt = "disabled";
@ -427,23 +416,21 @@ in {
}; };
assigns = { assigns = {
"10" = [ "10" = [
{app_id=".*[Tt]elegram.*";} { app_id = ".*[Tt]elegram.*"; }
{class=".*[Tt]elegram.*";} { class = ".*[Tt]elegram.*"; }
{class="Jitsi Meet";} { class = "Jitsi Meet"; }
{class="discord";} { class = "discord"; }
{title="Discord";} { title = "Discord"; }
]; ];
}; };
modes = let modes = let return_mode = lib.mapAttrs (k: v: "${v}; mode default");
return_mode = lib.mapAttrs (k: v: "${v}; mode default");
in { in {
audio = return_mode { audio = return_mode {
"escape" = ""; "escape" = "";
"s" = "exec ${pulse_sink}/bin/pulse_sink"; "s" = "exec ${pulse_sink}/bin/pulse_sink";
}; };
}; };
keybindings = keybindings = let
let
mod = "Mod4"; mod = "Mod4";
floating.modifier = "Mod4"; floating.modifier = "Mod4";
menu = "bemenu-run --bottom"; menu = "bemenu-run --bottom";
@ -459,42 +446,31 @@ in {
"${mod}+8" = "workspace number 8"; "${mod}+8" = "workspace number 8";
"${mod}+9" = "workspace number 9"; "${mod}+9" = "workspace number 9";
"${mod}+0" = "workspace number 10"; "${mod}+0" = "workspace number 10";
"${mod}+Shift+1" = "${mod}+Shift+1" = "move container to workspace number 1";
"move container to workspace number 1"; "${mod}+Shift+2" = "move container to workspace number 2";
"${mod}+Shift+2" = "${mod}+Shift+3" = "move container to workspace number 3";
"move container to workspace number 2"; "${mod}+Shift+4" = "move container to workspace number 4";
"${mod}+Shift+3" = "${mod}+Shift+5" = "move container to workspace number 5";
"move container to workspace number 3"; "${mod}+Shift+6" = "move container to workspace number 6";
"${mod}+Shift+4" = "${mod}+Shift+7" = "move container to workspace number 7";
"move container to workspace number 4"; "${mod}+Shift+8" = "move container to workspace number 8";
"${mod}+Shift+5" = "${mod}+Shift+9" = "move container to workspace number 9";
"move container to workspace number 5"; "${mod}+Shift+0" = "move container to workspace number 10";
"${mod}+Shift+6" =
"move container to workspace number 6";
"${mod}+Shift+7" =
"move container to workspace number 7";
"${mod}+Shift+8" =
"move container to workspace number 8";
"${mod}+Shift+9" =
"move container to workspace number 9";
"${mod}+Shift+0" =
"move container to workspace number 10";
}; };
prev_next_binds = prev_next_binds = let
let join_dict_arr = builtins.foldl' (a: v: a // v) { };
join_dict_arr = builtins.foldl' (a: v: a//v) {}; maybe_window = key:
maybe_window = key: if (lib.strings.hasInfix "button" key) then
if (lib.strings.hasInfix "button" key) "--whole-window"
then "--whole-window" else
else ""; "";
prev_binds = map (key: prev_binds = map (key: {
{"${maybe_window key} ${mod}+${key}" = "workspace prev_on_output";} "${maybe_window key} ${mod}+${key}" = "workspace prev_on_output";
) [ key.tabL "bracketleft" "Prior" "button9" "button4" ]; }) [ key.tabL "bracketleft" "Prior" "button9" "button4" ];
next_binds = map (key: next_binds = map (key: {
{"${maybe_window key} ${mod}+${key}" = "workspace next_on_output";} "${maybe_window key} ${mod}+${key}" = "workspace next_on_output";
) [ key.tabR "bracketright" "Next" "button8" "button5" ]; }) [ key.tabR "bracketright" "Next" "button8" "button5" ];
in in join_dict_arr (prev_binds ++ next_binds);
join_dict_arr (prev_binds ++ next_binds);
movement_binds = { movement_binds = {
"${mod}+${key.left}" = "focus left"; "${mod}+${key.left}" = "focus left";
"${mod}+${key.down}" = "focus down"; "${mod}+${key.down}" = "focus down";
@ -538,19 +514,20 @@ in {
"${mod}+mod1+Shift+Right" = "move workspace output right"; "${mod}+mod1+Shift+Right" = "move workspace output right";
}; };
audio_binds = { audio_binds = {
XF86AudioRaiseVolume = "exec pactl set-sink-volume @DEFAULT_SINK@ +10%"; XF86AudioRaiseVolume =
XF86AudioLowerVolume = "exec pactl set-sink-volume @DEFAULT_SINK@ -10%"; "exec pactl set-sink-volume @DEFAULT_SINK@ +10%";
XF86AudioLowerVolume =
"exec pactl set-sink-volume @DEFAULT_SINK@ -10%";
XF86AudioMute = "exec pactl set-sink-mute @DEFAULT_SINK@ toggle"; XF86AudioMute = "exec pactl set-sink-mute @DEFAULT_SINK@ toggle";
XF86AudioMicMute = "exec pactl set-source-mute @DEFAULT_SOURCE@ toggle"; XF86AudioMicMute =
"exec pactl set-source-mute @DEFAULT_SOURCE@ toggle";
# Control media # Control media
XF86AudioPlay = "exec playerctl play-pause"; XF86AudioPlay = "exec playerctl play-pause";
XF86AudioPause = "exec playerctl play-pause"; XF86AudioPause = "exec playerctl play-pause";
XF86AudioNext = "exec playerctl next"; XF86AudioNext = "exec playerctl next";
XF86AudioPrev = "exec playerctl previous"; XF86AudioPrev = "exec playerctl previous";
}; };
system_binds = { system_binds = { "Ctrl+${mod}+z" = "exec systemctl suspend"; };
"Ctrl+${mod}+z" = "exec systemctl suspend";
};
in { in {
"${mod}+Return" = "exec ${terminal}"; "${mod}+Return" = "exec ${terminal}";
"${mod}+Ctrl+Return" = "exec thunar"; "${mod}+Ctrl+Return" = "exec thunar";
@ -572,11 +549,7 @@ 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'";
"${mod}+r" = "mode resize"; "${mod}+r" = "mode resize";
} } // workspace_binds // prev_next_binds // movement_binds // audio_binds
// workspace_binds
// prev_next_binds
// movement_binds
// audio_binds
// system_binds // system_binds
# // map (key: "$mod+${key} workspace prev_on_output") [ key.tabL "bracketleft" "Prior" "button9" "button4" ] # // map (key: "$mod+${key} workspace prev_on_output") [ key.tabL "bracketleft" "Prior" "button9" "button4" ]
# // map (key: "$mod+${key} workspace next_on_output") [ key.tabL "bracketleft" "Prior" "button9" "button4" ] # // map (key: "$mod+${key} workspace next_on_output") [ key.tabL "bracketleft" "Prior" "button9" "button4" ]
@ -588,17 +561,18 @@ in {
enable = true; enable = true;
profiles = { profiles = {
sedetary = { sedetary = {
outputs = [{ outputs = [
criteria = "eDP-1"; {
status = "disable"; criteria = "eDP-1";
position = "1920,312"; status = "disable";
} { position = "1920,312";
criteria = "HDMI-A-1"; }
position = "0,0"; {
}]; criteria = "HDMI-A-1";
exec = [ position = "0,0";
"xrdb .Xresources" }
]; ];
exec = [ "xrdb .Xresources" ];
}; };
nomad = { nomad = {
outputs = [{ outputs = [{
@ -606,9 +580,7 @@ in {
status = "enable"; status = "enable";
position = "1920,312"; position = "1920,312";
}]; }];
exec = [ exec = [ "xrdb .Xresources" ];
"xrdb .Xresources"
];
}; };
}; };
}; };