flocon/modules/programs/hypr/paper.nix
Anthony Rodriguez fc876b2ea5
treewide: update options API
The options API has been updated, in order for a more flexible setup
with `local.modules.desktop.enable` being replaced with an enum of
desktops at `local.systemVars.desktop`, which allows for switching
desktop environments by changing a single option. This is so that we can
switch to cosmic and only enable the programs we need (i.e. disable
greetd because we use cosmic-greeter and enable terminals since that is
desktop related). This is simpler than having a different module per
desktop.
2025-02-06 18:47:01 +01:00

42 lines
1.2 KiB
Nix

{
lib,
lib',
inputs,
pkgs,
config,
...
}: let
inherit (lib'.generators) toHyprConf;
inherit (config.local.systemVars) username;
inherit (config.local.style) wallpaper;
inherit (inputs.hyprpaper.packages.${pkgs.system}) hyprpaper;
in {
config = lib.mkIf (config.local.systemVars.desktop == "Hyprland") {
hjem.users.${username} = {
packages = [hyprpaper];
files = {
".config/hypr/hyprpaper.conf".text = toHyprConf {
attrs = {
preload = ["${wallpaper}"];
wallpaper = [", ${wallpaper}"];
};
};
};
};
systemd.user.services.hyprpaper = {
name = "hyprpaper";
after = ["graphical-session.target"];
description = "Fast, IPC-controlled wallpaper utility for Hyprland.";
documentation = ["https://wiki.hyprland.org/Hypr-Ecosystem/hyprpaper/"];
wantedBy = ["graphical-session.target"];
restartTriggers = ["${config.hjem.users.${username}.files.".config/hypr/hyprpaper.conf".text}"];
serviceConfig = {
Type = "simple";
ExecStart = "${hyprpaper}/bin/hyprpaper";
Restart = "on-failure";
Slice = "background-graphical.slice";
};
};
};
}