diff --git a/graphical.nix b/graphical.nix new file mode 100644 index 0000000..2401d38 --- /dev/null +++ b/graphical.nix @@ -0,0 +1,208 @@ +{ pkgs, config, ... }: + +{ + home.packages = with pkgs; [ + bitwarden + firefox-wayland + thunderbird + discord + spotify + signal-desktop + + sway + ]; + + programs = { + mako = { + enable = true; + font = "hack nerd font 10"; + margin = "20,20,5,5"; + ignoreTimeout = true; + defaultTimeout = 7000; + }; + + waybar = { + enable = true; + style = builtins.readFile ./waybar.css; + settings = [ + { + layer = "top"; + position = "bottom"; + modules-left = [ + "network#wifi" + "sway/workspaces" + "sway/mode" + ]; + modules-center = [ "sway/window" ]; + modules-right = [ + "cpu" + "memory" + "disk#home" + "disk#root" + "battery" + "clock" + "tray" + ]; + modules = { + "sway/workspaces" = { + persistent_workspaces = { + "" = [ ]; + "" = [ ]; + "1:" = [ ]; + }; + numeric-first = true; + }; + "network#wifi" = { + interface = "wlp1s0"; + format-wifi = "{essid} ({signalStrength}%) "; + }; + cpu = { + format = "﬙ {load}"; + }; + memory = { + format = " {used:.0f}G/{total:.0f}G"; + }; + "sway/window" = { + max-length = 50; + }; + "disk#home" = { + path = "/home"; + format = " {free}"; + }; + "disk#root" = { + path = "/"; + format = " {percentage_free}%"; + }; + "battery" = { + format = "{capacity}% {icon}"; + format-icons = [ "" "" "" "" "" ]; + }; + "clock" = { + format-alt = "{:%a, %d. %b %H:%M}"; + }; + }; + } + ]; + }; + + zathura = { + enable = true; + }; + + }; + + wayland.windowManager.sway = { + enable = true; + config = { + modifier = "Mod4"; + bars = [{ + command = "waybar"; + }]; + input = { + "1:1:AT_Translated_Set_2_keyboard" = { + xkb_layout = "us"; + xkb_variant = "dvp"; + xkb_options = "compose:102"; + }; + "2:7:SynPS/2_Synaptics_TouchPad" = { + dwt = "disable"; + }; + }; + fonts = { + names = [ "Hack Nerd Font" ]; + style = "Regular"; + size = 13.0; + }; + window = { + titlebar = true; + }; + startup = [ + { command = "systemctl --user import-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK"; } + { command = "hash dbus-update-activation-environment 2>/dev/null && dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK"; } + { command = "${pkgs.mako}/bin/mako"; } + { command = "wdumpkeys >> ~/.keydump"; } + ]; + menu = "${pkgs.wofi}/bin/wofi --show drun,run --allow-images"; + terminal = "${pkgs.kitty}/bin/kitty"; + keybindings = + let + mod = config.wayland.windowManager.sway.config.modifier; + menu = config.wayland.windowManager.sway.config.menu; + terminal = config.wayland.windowManager.sway.config.terminal; + ws1 = "1:"; + ws2 = "2:"; + ws3 = "3"; + ws4 = "4:"; + ws5 = "5"; + ws6 = "6"; + ws7 = "7"; + ws8 = "8"; + ws9 = ""; + ws10 = ""; + in + { + "Print" = "exec ${pkgs.grim} -g \"$(${pkgs.slurp}/bin/slurp)\" - | ${pkgs.wl-clipboard}/bin/wl-copy"; + "${mod}+Shift+semicolon" = "kill"; + "${mod}+e" = "exec ${menu}"; + "${mod}+Return" = "exec ${terminal}"; + "${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'"; + + "${mod}+u" = "fullscreen toggle"; + "${mod}+comma" = "layout tabbed"; + "${mod}+p" = "mode resize"; + + "${mod}+h" = "focus left"; + "${mod}+t" = "focus down"; + "${mod}+n" = "focus up"; + "${mod}+s" = "focus right"; + "${mod}+Left" = "focus left"; + "${mod}+Down" = "focus down"; + "${mod}+Up" = "focus up"; + "${mod}+Right" = "focus right"; + "${mod}+Shift+H" = "move left"; + "${mod}+Shift+T" = "move down"; + "${mod}+Shift+N" = "move up"; + "${mod}+Shift+S" = "move right"; + "${mod}+Shift+Left" = "move left"; + "${mod}+Shift+Down" = "move down"; + "${mod}+Shift+Up" = "move up"; + "${mod}+Shift+Right" = "move right"; + + # Workspaces + "${mod}+ampersand" = "workspace ${ws1}"; + "${mod}+bracketleft" = "workspace ${ws2}"; + "${mod}+braceleft" = "workspace ${ws3}"; + "${mod}+braceright" = "workspace ${ws4}"; + "${mod}+parenleft" = "workspace ${ws5}"; + "${mod}+equal" = "workspace ${ws6}"; + "${mod}+asterisk" = "workspace ${ws7}"; + "${mod}+parenright" = "workspace ${ws8}"; + "${mod}+w" = "workspace ${ws9}"; + "${mod}+m" = "workspace ${ws10}"; + "${mod}+Shift+ampersand" = "move container to workspace ${ws1}"; + "${mod}+Shift+bracketleft" = "move container to workspace ${ws2}"; + "${mod}+Shift+braceleft" = "move container to workspace ${ws3}"; + "${mod}+Shift+braceright" = "move container to workspace ${ws4}"; + "${mod}+Shift+parenleft" = "move container to workspace ${ws5}"; + "${mod}+Shift+equal" = "move container to workspace ${ws6}"; + "${mod}+Shift+asterisk" = "move container to workspace ${ws7}"; + "${mod}+Shift+parenright" = "move container to workspace ${ws8}"; + "${mod}+Shift+w" = "move container to workspace ${ws9}"; + "${mod}+Shift+m" = "move container to workspace ${ws10}"; + + "${mod}+Shift+J" = "reload"; + "${mod}+Shift+p" = "restart"; + "${mod}+Shift+l" = "exec ${pkgs.swaylock-fancy}/bin/swaylock-fancy"; + }; + }; + + }; + + home.file = { + ".config/wofi/" = { + source = ./wofi; + recursive = true; + }; + }; +} diff --git a/home.nix b/home.nix index a82f925..0ccf214 100644 --- a/home.nix +++ b/home.nix @@ -1,6 +1,9 @@ { config, pkgs, lib, ... }: { + imports = [ + ./graphical.nix + ]; # Home Manager needs a bit of information about you and the # paths it should manage. home.username = "traxys"; @@ -13,16 +16,7 @@ home.packages = with pkgs; [ bitwarden-cli - bitwarden - firefox-wayland - thunderbird - discord - spotify - signal-desktop rustup - - sway - neovim-nightly rust-analyzer clang-tools @@ -32,7 +26,6 @@ (import (builtins.fetchTarball { url = https://github.com/nix-community/rnix-lsp/archive/master.tar.gz; })) - exa ]; @@ -51,86 +44,10 @@ userEmail = "quentin+dev@familleboyer.net"; }; - mako = { - enable = true; - font = "hack nerd font 10"; - margin = "20,20,5,5"; - ignoreTimeout = true; - defaultTimeout = 7000; - }; - - waybar = { - enable = true; - style = builtins.readFile ./waybar.css; - settings = [ - { - layer = "top"; - position = "bottom"; - modules-left = [ - "network#wifi" - "sway/workspaces" - "sway/mode" - ]; - modules-center = [ "sway/window" ]; - modules-right = [ - "cpu" - "memory" - "disk#home" - "disk#root" - "battery" - "clock" - "tray" - ]; - modules = { - "sway/workspaces" = { - persistent_workspaces = { - "" = [ ]; - "" = [ ]; - "1:" = [ ]; - }; - numeric-first = true; - }; - "network#wifi" = { - interface = "wlp1s0"; - format-wifi = "{essid} ({signalStrength}%) "; - }; - cpu = { - format = "﬙ {load}"; - }; - memory = { - format = " {used:.0f}G/{total:.0f}G"; - }; - "sway/window" = { - max-length = 50; - }; - "disk#home" = { - path = "/home"; - format = " {free}"; - }; - "disk#root" = { - path = "/"; - format = " {percentage_free}%"; - }; - "battery" = { - format = "{capacity}% {icon}"; - format-icons = [ "" "" "" "" "" ]; - }; - "clock" = { - format-alt = "{:%a, %d. %b %H:%M}"; - }; - }; - } - ]; - }; - zoxide = { enable = true; }; - zathura = { - enable = true; - }; - zsh = { enable = true; oh-my-zsh = { @@ -167,120 +84,7 @@ }; }; }; - - wayland.windowManager.sway = { - enable = true; - config = { - modifier = "Mod4"; - bars = [{ - command = "waybar"; - }]; - input = { - "1:1:AT_Translated_Set_2_keyboard" = { - xkb_layout = "us"; - xkb_variant = "dvp"; - xkb_options = "compose:102"; - }; - "2:7:SynPS/2_Synaptics_TouchPad" = { - dwt = "disable"; - }; - }; - fonts = { - names = [ "Hack Nerd Font" ]; - style = "Regular"; - size = 13.0; - }; - window = { - titlebar = true; - }; - startup = [ - { command = "systemctl --user import-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK"; } - { command = "hash dbus-update-activation-environment 2>/dev/null && dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK"; } - { command = "${pkgs.mako}/bin/mako"; } - { command = "wdumpkeys >> ~/.keydump"; } - ]; - menu = "${pkgs.wofi}/bin/wofi --show drun,run --allow-images"; - terminal = "${pkgs.kitty}/bin/kitty"; - keybindings = - let - mod = config.wayland.windowManager.sway.config.modifier; - menu = config.wayland.windowManager.sway.config.menu; - terminal = config.wayland.windowManager.sway.config.terminal; - ws1 = "1:"; - ws2 = "2:"; - ws3 = "3"; - ws4 = "4:"; - ws5 = "5"; - ws6 = "6"; - ws7 = "7"; - ws8 = "8"; - ws9 = ""; - ws10 = ""; - in - { - "Print" = "exec ${pkgs.grim} -g \"$(${pkgs.slurp}/bin/slurp)\" - | ${pkgs.wl-clipboard}/bin/wl-copy"; - "${mod}+Shift+semicolon" = "kill"; - "${mod}+e" = "exec ${menu}"; - "${mod}+Return" = "exec ${terminal}"; - "${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'"; - - "${mod}+u" = "fullscreen toggle"; - "${mod}+comma" = "layout tabbed"; - "${mod}+p" = "mode resize"; - - "${mod}+h" = "focus left"; - "${mod}+t" = "focus down"; - "${mod}+n" = "focus up"; - "${mod}+s" = "focus right"; - "${mod}+Left" = "focus left"; - "${mod}+Down" = "focus down"; - "${mod}+Up" = "focus up"; - "${mod}+Right" = "focus right"; - "${mod}+Shift+H" = "move left"; - "${mod}+Shift+T" = "move down"; - "${mod}+Shift+N" = "move up"; - "${mod}+Shift+S" = "move right"; - "${mod}+Shift+Left" = "move left"; - "${mod}+Shift+Down" = "move down"; - "${mod}+Shift+Up" = "move up"; - "${mod}+Shift+Right" = "move right"; - - # Workspaces - "${mod}+ampersand" = "workspace ${ws1}"; - "${mod}+bracketleft" = "workspace ${ws2}"; - "${mod}+braceleft" = "workspace ${ws3}"; - "${mod}+braceright" = "workspace ${ws4}"; - "${mod}+parenleft" = "workspace ${ws5}"; - "${mod}+equal" = "workspace ${ws6}"; - "${mod}+asterisk" = "workspace ${ws7}"; - "${mod}+parenright" = "workspace ${ws8}"; - "${mod}+w" = "workspace ${ws9}"; - "${mod}+m" = "workspace ${ws10}"; - "${mod}+Shift+ampersand" = "move container to workspace ${ws1}"; - "${mod}+Shift+bracketleft" = "move container to workspace ${ws2}"; - "${mod}+Shift+braceleft" = "move container to workspace ${ws3}"; - "${mod}+Shift+braceright" = "move container to workspace ${ws4}"; - "${mod}+Shift+parenleft" = "move container to workspace ${ws5}"; - "${mod}+Shift+equal" = "move container to workspace ${ws6}"; - "${mod}+Shift+asterisk" = "move container to workspace ${ws7}"; - "${mod}+Shift+parenright" = "move container to workspace ${ws8}"; - "${mod}+Shift+w" = "move container to workspace ${ws9}"; - "${mod}+Shift+m" = "move container to workspace ${ws10}"; - - "${mod}+Shift+J" = "reload"; - "${mod}+Shift+p" = "restart"; - "${mod}+Shift+l" = "exec ${pkgs.swaylock-fancy}/bin/swaylock-fancy"; - }; - }; - - }; - home.file = { - ".config/wofi/" = { - source = ./wofi; - recursive = true; - }; ".config/nvim" = { source = ./nvim; recursive = true;