Files
dotfiles/nix/modules/hyprland/nixos.nix

49 lines
1.3 KiB
Nix

{
inputs,
pkgs,
lib,
config,
...
}:
let
cfg = config.modules.Hyprland;
in
{
options.modules.Hyprland = {
enable = lib.mkEnableOption "Hyprland";
};
config = lib.mkIf cfg.enable {
programs.xwayland.enable = true;
boot.kernelParams = [
"resume=UUID=d9b81619-5772-4ac4-bcd5-552e1e784f9e"
"resume_offset=141042944"
];
boot.resumeDevice = "/dev/disk/by-uuid/d9b81619-5772-4ac4-bcd5-552e1e784f9e";
powerManagement.enable = true;
swapDevices = [
# [[ Hibernate ]]
{
device = "/var/lib/swapfile";
size = 48 * 1024; # 48GB in MB
}
];
programs.hyprland = {
enable = true;
# set the flake package
package = inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.hyprland;
# make sure to also set the portal package, so that they are in sync
portalPackage =
inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.xdg-desktop-portal-hyprland;
};
xdg.portal = {
enable = true;
extraPortals = with pkgs; [ xdg-desktop-portal-gtk ];
};
environment.sessionVariables.NIXOS_OZONE_WL = "1";
nix.settings = {
substituters = [ "https://hyprland.cachix.org" ];
trusted-public-keys = [ "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" ];
};
};
}