From c88042de6a8317e1dd6f8179b8b06932a9ee0840 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cyryl=20P=C5=82otnicki?= Date: Wed, 11 Jan 2023 12:00:28 +0000 Subject: [PATCH] use sway on 480 --- nixos/boxes/foureighty/default.nix | 2 +- nixos/sway/default.nix | 46 +++++++++++++++++------------- nixos/sway/keybindings.nix | 28 +++++++++--------- 3 files changed, 42 insertions(+), 34 deletions(-) diff --git a/nixos/boxes/foureighty/default.nix b/nixos/boxes/foureighty/default.nix index 8575b2de..f1164d17 100644 --- a/nixos/boxes/foureighty/default.nix +++ b/nixos/boxes/foureighty/default.nix @@ -11,9 +11,9 @@ ../../distributed-builds.nix ../../git ../../gui - ../../i3 ../../libvirt.nix ../../mercurial + ../../sway ]; fileSystems."/" = { options = [ "compress=zstd" ]; }; diff --git a/nixos/sway/default.nix b/nixos/sway/default.nix index f61d8142..9c0669fc 100644 --- a/nixos/sway/default.nix +++ b/nixos/sway/default.nix @@ -1,14 +1,11 @@ -{ - config, - pkgs, - ... -}: let - mod = "Mod4"; +{ config, pkgs, ... }: +let mod = "Mod4"; in { - services.dbus.packages = with pkgs; [gnome2.GConf gnome3.dconf]; + services.dbus.packages = with pkgs; [ ]; programs.dconf.enable = true; - programs.qt5ct.enable = true; systemd.defaultUnit = "graphical.target"; + security.polkit.enable = true; + qt5.platformTheme = "qt5ct"; environment.loginShellInit = '' if [ -z $DISPLAY ] && [ "$(tty)" = "/dev/tty1" ]; then @@ -16,10 +13,20 @@ in { fi ''; - home-manager.users.cyryl = {...}: { + home-manager.users.cyryl = { ... }: { programs.mako.enable = true; - imports = [./keybindings.nix]; + imports = [ ./keybindings.nix ../home-manager/programs/alacritty.nix ]; + + home.pointerCursor = { + name = "Adwaita"; + package = pkgs.gnome.adwaita-icon-theme; + size = 24; + x11 = { + enable = true; + defaultCursor = "Adwaita"; + }; + }; home.sessionVariables = { XDG_CURRENT_DESKTOP = "Unity"; @@ -59,24 +66,23 @@ in { config = { modifier = "${mod}"; menu = "${pkgs.wofi}/bin/wofi --show drun,run"; - terminal = "${pkgs.kitty}/bin/kitty"; + terminal = "${pkgs.alacritty}/bin/alacritty"; workspaceLayout = "tabbed"; window = { hideEdgeBorders = "both"; titlebar = false; border = 0; }; - bars = [ - { - position = "top"; - command = "${pkgs.waybar}/bin/waybar"; - } - ]; + bars = [{ + position = "top"; + command = "${pkgs.waybar}/bin/waybar"; + }]; startup = [ { - command = "${pkgs.wl-clipboard}/bin/wl-paste -t text --watch ${pkgs.clipman}/bin/clipman store"; + command = + "${pkgs.wl-clipboard}/bin/wl-paste -t text --watch ${pkgs.clipman}/bin/clipman store"; } - {command = "${pkgs.clipman}/bin/clipman restore";} + { command = "${pkgs.clipman}/bin/clipman restore"; } { command = '' swayidle -w timeout 300 'swaylock -f -c 000000' timeout 600 'swaymsg "output * dpms off" && systemctl suspend' resume 'swaymsg "output * dpms on"' before-sleep 'swaylock -f -c 657b83' @@ -88,7 +94,7 @@ in { xkb_layout = "pl"; xkb_options = "caps:ctrl_modifier"; }; - input."2:7:SynPS/2_Synaptics_TouchPad" = {tap = "enabled";}; + input."2:7:SynPS/2_Synaptics_TouchPad" = { tap = "enabled"; }; }; }; }; diff --git a/nixos/sway/keybindings.nix b/nixos/sway/keybindings.nix index 62c6ada9..46254bd2 100644 --- a/nixos/sway/keybindings.nix +++ b/nixos/sway/keybindings.nix @@ -1,23 +1,25 @@ -{ - config, - pkgs, - ... -}: let - mod = "Mod4"; +{ config, pkgs, ... }: +let mod = "Mod4"; in { wayland.windowManager.sway.config.keybindings = { "${mod}+Shift+e" = "exit"; "${mod}+Shift+r" = "reload"; "${mod}+Shift+l" = "exec swaylock -c 657b83"; - "${mod}+Return" = "exec ${pkgs.kitty}/bin/kitty"; + "${mod}+Return" = "exec ${pkgs.alacritty}/bin/alacritty"; - "XF86AudioRaiseVolume" = "exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +5%"; - "XF86AudioLowerVolume" = "exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -5%"; - "XF86AudioMute" = "exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle"; - "XF86AudioMicMute" = "exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle"; + "XF86AudioRaiseVolume" = + "exec --no-startup-id ${pkgs.pulseaudio}/bin/pactl set-sink-volume @DEFAULT_SINK@ +5%"; + "XF86AudioLowerVolume" = + "exec --no-startup-id ${pkgs.pulseaudio}/bin/pactl set-sink-volume @DEFAULT_SINK@ -5%"; + "XF86AudioMute" = + "exec --no-startup-id ${pkgs.pulseaudio}/bin/pactl set-sink-mute @DEFAULT_SINK@ toggle"; + "XF86AudioMicMute" = + "exec --no-startup-id ${pkgs.pulseaudio}/bin/pactl set-source-mute @DEFAULT_SOURCE@ toggle"; - "XF86MonBrightnessUp" = "exec light -s sysfs/backlight/intel_backlight -A 5"; - "XF86MonBrightnessDown" = "exec light -s sysfs/backlight/intel_backlight -U 5"; + "XF86MonBrightnessUp" = + "exec light -s sysfs/backlight/intel_backlight -A 5"; + "XF86MonBrightnessDown" = + "exec light -s sysfs/backlight/intel_backlight -U 5"; "Print" = "exec ${pkgs.gnome3.gnome-screenshot}/bin/gnome-screenshot -i";