Anthony Rodriguez
6ab835555c
As my NixOS configuration kept growing, I noticed that I don't need home-manager as much as I did before. A lot of what I need is just a way to map nix attrsets to the program's respective configuration format, which is something that I can now do myself, as my nix knowledge got more extensive. After all of this, I decided to completely get rid of home-manager, and switch to a simpler solution called hjem, which just lets me write files to my home directory that are automatically symlinked using `systemd-tmpfiles`. This allows me to simplify my configuration, remove the separation between NixOS and home-manager modules, and cut my eval times by quite a lot (which allows for faster `nixos-rebuild switch`!).
52 lines
1.6 KiB
Nix
52 lines
1.6 KiB
Nix
{
|
|
lib,
|
|
pkgs,
|
|
config,
|
|
lib',
|
|
...
|
|
}: let
|
|
inherit (builtins) toJSON;
|
|
inherit (config.local.systemVars) username;
|
|
inherit (lib') generateGtkColors;
|
|
in {
|
|
config = lib.mkIf config.local.modules.hyprland.enable {
|
|
hjem.users.${username} = {
|
|
files = {
|
|
".config/swaync/config.json".text = toJSON {
|
|
positionX = "right";
|
|
positionY = "top";
|
|
layer = "overlay";
|
|
control-center-layer = "top";
|
|
layer-shell = true;
|
|
cssPriority = "application";
|
|
control-center-margin-top = 0;
|
|
control-center-margin-bottom = 0;
|
|
control-center-margin-right = 0;
|
|
control-center-margin-left = 0;
|
|
notification-2fa-action = true;
|
|
notification-inline-replies = false;
|
|
notification-icon-size = 64;
|
|
notification-body-image-height = 100;
|
|
notification-body-image-width = 200;
|
|
};
|
|
".config/swaync/style.css".text = (generateGtkColors config.local.style.scheme.palette) + builtins.readFile ./style.css;
|
|
};
|
|
|
|
packages = [pkgs.swaynotificationcenter];
|
|
};
|
|
|
|
systemd.user.services.swaync = {
|
|
description = "Swaync notification daemon";
|
|
documentation = ["https://github.com/ErikReider/SwayNotificationCenter"];
|
|
after = ["graphical-session.target"];
|
|
partOf = ["graphical-session.target"];
|
|
wantedBy = ["graphical-session.target"];
|
|
serviceConfig = {
|
|
BusName = "org.freedesktop.Notifications";
|
|
ExecStart = "${pkgs.swaynotificationcenter}/bin/swaync";
|
|
Restart = "on-failure";
|
|
Type = "dbus";
|
|
};
|
|
};
|
|
};
|
|
}
|