49 lines
1.4 KiB
Nix
49 lines
1.4 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";
|
|
basePath = "${flakeRoot}/generated/.config";
|
|
assetPath = "${flakeRoot}/generated/.config/hypr";
|
|
in
|
|
{
|
|
#################################
|
|
# Install hypridle system-wide
|
|
#################################
|
|
environment.systemPackages = [ pkgs.hypridle ];
|
|
|
|
#################################
|
|
# Deploy config
|
|
#################################
|
|
home-manager.users = {
|
|
${username} = {
|
|
home.file = {
|
|
".config/hypr/hypridle.conf" = {
|
|
text = builtins.readFile "${assetPath}/hypridle.conf";
|
|
force = true;
|
|
};
|
|
};
|
|
};
|
|
};
|
|
|
|
#################################
|
|
# Systemd user service
|
|
#################################
|
|
systemd.user.services.hypridle = {
|
|
description = "Hypridle (Hyprland idle daemon)";
|
|
after = [ "hyprland-session.target" ];
|
|
bindsTo = [ "hyprland-session.target" ];
|
|
serviceConfig = {
|
|
ExecStart = "${pkgs.hypridle}/bin/hypridle";
|
|
Restart = "on-failure";
|
|
RestartSec = "5s";
|
|
Environment = [
|
|
"HOME=/home/${username}"
|
|
"WAYLAND_DISPLAY=wayland-1"
|
|
"XDG_RUNTIME_DIR=/run/user/1000"
|
|
];
|
|
};
|
|
wantedBy = [ "hyprland-session.target" ];
|
|
};
|
|
}
|