40 lines
1.2 KiB
Nix
40 lines
1.2 KiB
Nix
# --- This file has been auto-generated. For permanent changes alter the appropriate block in the README.org. ---
|
|
{ lib, config, pkgs, flakeRoot, ... }:
|
|
let
|
|
username = config.defaultUser or "henrov";
|
|
assetPath = "${flakeRoot}/generated/.config/swaync";
|
|
in
|
|
{
|
|
environment.systemPackages = [ pkgs.swaynotificationcenter ];
|
|
|
|
home-manager.users.${username} = {
|
|
services.swaync.enable = true;
|
|
|
|
home.file = {
|
|
".config/swaync/config.json" = {
|
|
text = builtins.readFile "${assetPath}/config.json";
|
|
force = true;
|
|
};
|
|
".config/swaync/style.css" = {
|
|
text = builtins.readFile "${assetPath}/style.css";
|
|
force = true;
|
|
};
|
|
};
|
|
};
|
|
|
|
# Autostart swaync as a systemd user service instead
|
|
systemd.user.services.swaync = {
|
|
description = "SwayNotificationCenter";
|
|
after = [ "graphical-session.target" ];
|
|
serviceConfig = {
|
|
ExecStart = "${pkgs.swaynotificationcenter}/bin/swaync";
|
|
Restart = "always";
|
|
Environment = [
|
|
"WAYLAND_DISPLAY=${config.environment.sessionVariables.WAYLAND_DISPLAY or "wayland-0"}"
|
|
"XDG_CURRENT_DESKTOP=Hyprland"
|
|
];
|
|
};
|
|
wantedBy = [ "default.target" ];
|
|
};
|
|
}
|