From 42004587f9f385aba0f2e4ee62ad2d4f596c5b1a Mon Sep 17 00:00:00 2001 From: Nathan McCarty Date: Tue, 19 Apr 2022 14:50:57 -0400 Subject: [PATCH] Mostly migrate sway config to home-manager --- machines/levitation.nix | 29 +++++++++++++++++++ modules/sway.nix | 63 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 92 insertions(+) diff --git a/machines/levitation.nix b/machines/levitation.nix index 924713c..ab3bac0 100644 --- a/machines/levitation.nix +++ b/machines/levitation.nix @@ -22,4 +22,33 @@ allowedTCPPorts = [ 61377 ]; allowedUDPPorts = [ 61377 ]; }; + + ## Machine specific home-manager + home-manager.users.nathan = { + # Sway outputs + wayland.windowManager.sway.config = { + output = { + DP-1 = { + pos = "0 140"; + scale = "1"; + subpixel = "rgb"; + }; + DP-3 = { + pos = "2560 0"; + scale = "1.25"; + subpixel = "rgb"; + }; + HDMI-A-1 = { + pos = "5632 140"; + scale = "1"; + subpixel = "rgb"; + }; + }; + }; + # Mako output configuration + programs.mako = { + # Lock mako notifs to main display + output = "DP-3"; + }; + }; } diff --git a/modules/sway.nix b/modules/sway.nix index 37628c3..6cd425f 100644 --- a/modules/sway.nix +++ b/modules/sway.nix @@ -64,6 +64,8 @@ glpaper # Screenshots sway-contrib.grimshot + # Albert for launcher + albert ]; extraSessionCommands = '' # Make qt theming work @@ -90,4 +92,65 @@ gtkUsePortal = true; }; }; + + ## Home manager stuff for sway + home-manager.users.nathan = { + # Configure sway itself + wayland.windowManager.sway = { + enable = true; + systemdIntegration = true; + wrapperFeatures = { + base = true; + gtk = true; + }; + config = { + # Setup gaps + gaps = { + smartGaps = true; + inner = 9; + }; + # disable borders + window = { + border = 0; + }; + # Use windows key as modifier + modifier = "Mod4"; + # Alacritty as default terminal + terminal = "alacritty"; + # Use krunner (from kde) as our launcher + menu = "albert show"; + # Use waybar + bars = [{ + command = "${unstable.waybar}/bin/waybar"; + }]; + # Use fira code + fonts = { + names = [ "Fira Code Nerd Font" ]; + size = 10.0; + }; + }; + extraConfig = '' + exec albert + exec mako + ''; + }; + # Mako for notifications + programs.mako = { + enable = true; + # Selenized color scheme + borderColor = "#f275be"; + backgroundColor = "#184956"; + textColor = "#adbcbc"; + # Border configuration + borderSize = 3; + # Timeout to 5 seconds + defaultTimeout = 5000; + # Use Fira Code for font + font = "Fira Code Nerd Font 10"; + # Group by application + groupBy = "app-name"; + # Bottom right corner + anchor = "bottom-right"; + }; + }; }