86 lines
1.9 KiB
Nix
86 lines
1.9 KiB
Nix
{
|
|
pkgs,
|
|
config,
|
|
lib,
|
|
...
|
|
}:
|
|
|
|
{
|
|
options.modules.hyprland = {
|
|
enable = lib.mkEnableOption "Enable Hyprland";
|
|
additionalPackages = lib.mkOption {
|
|
type = lib.types.listOf lib.types.package;
|
|
description = "Additional Hyprland-related packages to install";
|
|
default = [ ];
|
|
};
|
|
|
|
additionalConfig = lib.mkOption {
|
|
type = lib.types.attrs;
|
|
description = "Additional options for Hyprland config";
|
|
default = [ ];
|
|
};
|
|
|
|
plugins = lib.mkOption {
|
|
type = lib.types.listOf lib.types.package;
|
|
description = "Additional plugins for Hyprland";
|
|
default = [ ];
|
|
};
|
|
|
|
sourceFiles = lib.mkOption {
|
|
type = lib.types.listOf lib.types.str;
|
|
description = "Config files to source";
|
|
default = [ ];
|
|
};
|
|
};
|
|
|
|
config = lib.mkIf config.modules.hyprland.enable {
|
|
home.packages =
|
|
with pkgs;
|
|
[
|
|
hyprlock
|
|
hypridle
|
|
wl-clipboard
|
|
cliphist
|
|
swww
|
|
]
|
|
++ config.modules.hyprland.additionalPackages;
|
|
|
|
wayland.windowManager.hyprland = {
|
|
enable = true;
|
|
xwayland.enable = true;
|
|
plugins = config.modules.hyprland.plugins;
|
|
settings = config.modules.hyprland.additionalConfig // {
|
|
source = config.modules.hyprland.sourceFiles;
|
|
};
|
|
};
|
|
|
|
xdg.portal = {
|
|
enable = true;
|
|
config.common.default = "*";
|
|
extraPortals = with pkgs; [
|
|
xdg-desktop-portal-gtk
|
|
];
|
|
};
|
|
|
|
systemd.user.services.authentication-agent = {
|
|
Unit = {
|
|
Description = "GNOME Authentication Agent";
|
|
After = [ "graphical-session.target" ];
|
|
Wants = [ "graphical-session.target" ];
|
|
};
|
|
|
|
Install = {
|
|
WantedBy = [ "graphical-session.target" ];
|
|
};
|
|
|
|
Service = {
|
|
Type = "simple";
|
|
ExecStart = "${pkgs.hyprpolkitagent}/libexec/hyprpolkitagent";
|
|
Restart = "on-failure";
|
|
RestartSec = 1;
|
|
TimeoutStopSec = 10;
|
|
};
|
|
};
|
|
};
|
|
}
|