From a4cc50b909eeee79a047bc53d850948f04cda149 Mon Sep 17 00:00:00 2001 From: James Patrick Date: Thu, 2 Dec 2021 00:09:25 -0500 Subject: [PATCH] Added Mako & Waybar. --- modules/applications/mako.nix | 55 +++++++++++++++++++++++++++++++++ modules/applications/waybar.nix | 3 ++ modules/sway.nix | 16 +++++++--- 3 files changed, 70 insertions(+), 4 deletions(-) create mode 100644 modules/applications/mako.nix create mode 100644 modules/applications/waybar.nix diff --git a/modules/applications/mako.nix b/modules/applications/mako.nix new file mode 100644 index 0000000..892aa08 --- /dev/null +++ b/modules/applications/mako.nix @@ -0,0 +1,55 @@ +{ config, lib, pkgs, ... }: { + + home-manager.users.james = { + programs.mako = { + enable = true; + width = 450; + padding = "20,20"; + backgroundColor = "#161720ee"; + borderColor = "#12151a"; + textColor = "#d6e5fb"; + defaultTimeout = 8000; + progressColor = "over #d6e5fb"; + layer = "overlay"; + groupBy = "summary"; + extraConfig = '' + [hidden] + background-color=#bfbfbfff + format=+ %h + + [urgency=high] + background-color=#1f212eee + border-color=#f0185a00 + text-color=#f0185a + ignore-timeout=true + default-timeout=0 + + [!expiring] + background-color=#555555ff + text-color=#eeeeeeff + + [grouped] + format=%s ✖ %g\n%b + ''; + }; + + home.packages = with pkgs; [ libnotify ]; + }; + + systemd.user.services.mako = { + enable = true; + description = "Mako - Notificaitons for Wayland"; + documentation = [ "man:mako(5)" ]; + partOf = [ "sway-session.target" ]; + bindsTo = [ "sway-session.target" ]; + environment.PATH = lib.mkForce null; + serviceConfig = { + ExecStart = "${pkgs.mako}/bin/mako"; + Restart = "on-failure"; + RestartSec = 1; + TimeoutStopSec = 10; + Type = "simple"; + }; + }; + +} diff --git a/modules/applications/waybar.nix b/modules/applications/waybar.nix new file mode 100644 index 0000000..9b05363 --- /dev/null +++ b/modules/applications/waybar.nix @@ -0,0 +1,3 @@ +{ config, pkgs, ... }: { + home-manager.users.james = { home.packages = with pkgs; [ waybar ]; }; +} diff --git a/modules/sway.nix b/modules/sway.nix index b801583..9e47050 100644 --- a/modules/sway.nix +++ b/modules/sway.nix @@ -5,6 +5,10 @@ }; home-manager.users.james = { + home.sessionVariables = { + MOZ_ENABLE_WAYLAND = 1; + XDG_CURRENT_DESKTOP = "sway"; + }; home.packages = with pkgs; [ autotiling @@ -51,15 +55,19 @@ # systemctl --user import-environment in startsway environment.PATH = lib.mkForce null; serviceConfig = { - Type = "simple"; - ExecStart = '' - ${pkgs.dbus}/bin/dbus-run-session ${pkgs.sway}/bin/sway --debug - ''; + ExecStart = + "${pkgs.dbus}/bin/dbus-run-session ${pkgs.sway}/bin/sway --debug"; + ExecStopPost = + "/usr/bin/systemctl --user unset-environment SWAYSOCK DISPLAY I3SOCK WAYLAND_DISPLAY"; + NotifyAccess = "all"; Restart = "on-failure"; RestartSec = 1; TimeoutStopSec = 10; + Type = "simple"; }; }; users.users.james.extraGroups = [ "video" "audio" ]; + + imports = [ ./applications/mako.nix ./applications/waybar.nix ]; }