diff --git a/home/aly.nix b/home/aly.nix index 54313a16..8dc6c80a 100644 --- a/home/aly.nix +++ b/home/aly.nix @@ -4,6 +4,7 @@ imports = [ ./gnome.nix ./shell.nix + ./sway.nix ]; home.username = "aly"; diff --git a/home/sway.nix b/home/sway.nix new file mode 100644 index 00000000..c47839eb --- /dev/null +++ b/home/sway.nix @@ -0,0 +1,85 @@ +{ config, pkgs, ... }: + +{ + programs.waybar.enable = true; # bar + programs.waybar.systemd.enable = true; + programs.swaylock.enable = true; + services.swayidle.enable = true; + + services.network-manager-applet.enable = true; + + home.packages = with pkgs; [ + swaylock + swayidle + wl-clipboard + wf-recorder + mako # notification daemon + grim + kanshi + slurp + dmenu # Dmenu is the default in the config but i recommend wofi since its wayland native + ]; + + + programs.waybar.settings = { + mainBar = { + layer = "top"; + position = "bottom"; + height = 30; + output = [ + "eDP-1" + "HDMI-A-1" + ]; + modules-left = [ "sway/workspaces" "sway/mode" ]; + modules-center = [ "sway/window" ]; + modules-right = [ "tray" ]; + + "sway/workspaces" = { + disable-scroll = true; + all-outputs = true; + }; + }; + }; + + wayland.windowManager.sway = { + enable = true; + wrapperFeatures.gtk = true; + config = rec { + modifier = "Mod4"; + bars = []; + gaps = { + inner = 10; + }; + # output = { + # eDP-1 = { + # scale = "1.0"; + # }; + # }; + input = { + "type:touchpad" = { + tap = "enabled"; + natural_scroll = "enabled"; + middle_emulation = "enabled"; + drag = "enabled"; + scroll_method = "two_finger"; + dwt = "enabled"; + click_method = "clickfinger"; + }; + }; + terminal = "alacritty"; + startup = [ + # Launch Firefox on start + {command = "firefox";} + ]; + keybindings = { + # audio control + "XF86AudioRaiseVolume" = "exec ${pkgs.pamixer}/bin/pamixer --increase 10"; + "XF86AudioLowerVolume" = "exec ${pkgs.pamixer}/bin/pamixer --decrease 10"; + "XF86AudioMute" = "exec ${pkgs.pamixer}/bin/pamixer --toggle-mute"; + "XF86MonBrightnessDown" = "exec ${pkgs.light}/bin/light -U 10"; + "XF86MonBrightnessUp" = "exec ${pkgs.light}/bin/light -A 10"; + "Mod4+d" = "exec ${pkgs.dmenu}/bin/dmenu_path | ${pkgs.dmenu}/bin/dmenu | ${pkgs.findutils}/bin/xargs swaymsg exec --"; + }; + }; + }; +} \ No newline at end of file diff --git a/modules/sway.nix b/modules/sway.nix new file mode 100644 index 00000000..d39003cb --- /dev/null +++ b/modules/sway.nix @@ -0,0 +1,19 @@ +{ config, pkgs, ... }: + +{ + imports = + [ # Include X settings. + ./desktop.nix + ]; + + services.xserver.displayManager = { + sessionPackages = [ pkgs.sway ]; + }; + + programs.light.enable = true; # Brightness and volume control. + programs.dconf.enable = true; + services.xserver.libinput.enable = true; + services.gnome.gnome-keyring.enable = true; + xdg.portal.wlr.enable = true; + xdg.portal.config.common.default = "*"; +} \ No newline at end of file