home: convert mako to systemd service

This commit is contained in:
Aly Raffauf 2024-08-02 16:42:37 -04:00
parent 76fd89a217
commit 3eff37c8aa
8 changed files with 64 additions and 45 deletions

View file

@ -12,7 +12,6 @@
./kitty ./kitty
./keepassxc ./keepassxc
./librewolf ./librewolf
./mako
./nemo ./nemo
./rofi ./rofi
./swaylock ./swaylock

View file

@ -1,28 +0,0 @@
{
config,
lib,
...
}: {
config = lib.mkIf config.ar.home.apps.mako.enable {
services.mako = {
enable = true;
anchor = "top-center";
backgroundColor = "${config.ar.home.theme.colors.background}CC";
borderColor = "${config.ar.home.theme.colors.primary}EE";
borderSize = 2;
borderRadius = 10;
defaultTimeout = 10000;
font = "${config.gtk.font.name} Regular ${toString config.gtk.font.size}";
height = 300;
layer = "top";
padding = "15";
textColor = "${config.ar.home.theme.colors.text}";
width = 400;
margin = "20,0";
extraConfig = ''
[mode=do-not-disturb]
invisible=1
'';
};
};
}

View file

@ -126,7 +126,6 @@ in {
exec-once = exec-once =
[ [
"${pkgs.mate.mate-polkit}/libexec/polkit-mate-authentication-agent-1" "${pkgs.mate.mate-polkit}/libexec/polkit-mate-authentication-agent-1"
(lib.getExe pkgs.mako)
(lib.getExe pkgs.waybar) (lib.getExe pkgs.waybar)
(lib.getExe pkgs.wayland-pipewire-idle-inhibit) (lib.getExe pkgs.wayland-pipewire-idle-inhibit)
] ]

View file

@ -159,7 +159,6 @@ in {
[ [
{command = "${pkgs.mate.mate-polkit}/libexec/polkit-mate-authentication-agent-1";} {command = "${pkgs.mate.mate-polkit}/libexec/polkit-mate-authentication-agent-1";}
{command = lib.getExe pkgs.autotiling;} {command = lib.getExe pkgs.autotiling;}
{command = lib.getExe pkgs.mako;}
{command = lib.getExe pkgs.wayland-pipewire-idle-inhibit;} {command = lib.getExe pkgs.wayland-pipewire-idle-inhibit;}
] ]
++ lib.optional cfg.desktop.randomWallpaper {command = "${helpers.wallpaperD}";} ++ lib.optional cfg.desktop.randomWallpaper {command = "${helpers.wallpaperD}";}

View file

@ -8,13 +8,13 @@
ar.home = { ar.home = {
apps = { apps = {
kitty.enable = lib.mkDefault true; kitty.enable = lib.mkDefault true;
mako.enable = lib.mkDefault true;
rofi.enable = lib.mkDefault true; rofi.enable = lib.mkDefault true;
swaylock.enable = lib.mkDefault true; swaylock.enable = lib.mkDefault true;
waybar.enable = lib.mkDefault true; waybar.enable = lib.mkDefault true;
}; };
services = { services = {
mako.enable = lib.mkDefault true;
swayidle.enable = lib.mkDefault true; swayidle.enable = lib.mkDefault true;
}; };
}; };

View file

@ -53,7 +53,6 @@ in {
kitty.enable = lib.mkEnableOption "Kitty terminal."; kitty.enable = lib.mkEnableOption "Kitty terminal.";
librewolf.enable = lib.mkEnableOption "Librewolf web browser."; librewolf.enable = lib.mkEnableOption "Librewolf web browser.";
mako.enable = lib.mkEnableOption "Mako notification daemon.";
nemo.enable = lib.mkOption { nemo.enable = lib.mkOption {
description = "Cinnamon Nemo file manager."; description = "Cinnamon Nemo file manager.";
@ -196,18 +195,6 @@ in {
}; };
services = { services = {
mpd = {
enable = lib.mkEnableOption "MPD user service.";
musicDirectory = lib.mkOption {
description = "Name of music directory";
default = config.xdg.userDirs.music;
type = lib.types.str;
};
};
gammastep.enable = lib.mkEnableOption "Gammastep redshift daemon.";
easyeffects = { easyeffects = {
enable = lib.mkEnableOption "EasyEffects user service."; enable = lib.mkEnableOption "EasyEffects user service.";
@ -218,6 +205,19 @@ in {
}; };
}; };
gammastep.enable = lib.mkEnableOption "Gammastep redshift daemon.";
mako.enable = lib.mkEnableOption "Mako notification daemon.";
mpd = {
enable = lib.mkEnableOption "MPD user service.";
musicDirectory = lib.mkOption {
description = "Name of music directory";
default = config.xdg.userDirs.music;
type = lib.types.str;
};
};
swayidle.enable = lib.mkEnableOption "Swayidle idle daemon."; swayidle.enable = lib.mkEnableOption "Swayidle idle daemon.";
}; };

View file

@ -2,6 +2,7 @@
imports = [ imports = [
./easyeffects ./easyeffects
./gammastep ./gammastep
./mako
./mpd ./mpd
./swayidle ./swayidle
]; ];

View file

@ -0,0 +1,49 @@
{
config,
lib,
pkgs,
...
}: {
config = lib.mkIf config.ar.home.services.mako.enable {
services.mako = {
enable = true;
anchor = "top-center";
backgroundColor = "${config.ar.home.theme.colors.background}CC";
borderColor = "${config.ar.home.theme.colors.primary}EE";
borderSize = 2;
borderRadius = 10;
defaultTimeout = 10000;
font = "${config.gtk.font.name} Regular ${toString config.gtk.font.size}";
height = 300;
layer = "top";
padding = "15";
textColor = "${config.ar.home.theme.colors.text}";
width = 400;
margin = "20,0";
extraConfig = ''
[mode=do-not-disturb]
invisible=1
'';
};
systemd.user.services.mako = {
Unit = {
After = "graphical-session.target";
Description = "Lightweight Wayland notification daemon";
Documentation = "man:mako(1)";
PartOf = "graphical-session.target";
};
Service = {
BusName = "org.freedesktop.Notifications";
ExecReload = ''${lib.getExe' pkgs.mako "makoctl"} reload'';
ExecStart = "${lib.getExe pkgs.mako}";
Restart = "on-failure";
RestartSec = 5;
Type = "dbus";
};
Install.WantedBy = ["hyprland-session.target" "sway-session.target"];
};
};
}