From 8b43e47c2ab96118a47b8c237066d35a16955a9b Mon Sep 17 00:00:00 2001 From: Mohammad Rafiq Date: Sat, 22 Feb 2025 16:09:55 +0800 Subject: [PATCH] feat(nixos): add Hyprland to home-manager --- flake.lock | 31 +++++++++++++++++++++++++++++++ home.nix | 28 +++++++++++++++++++++++++++- 2 files changed, 58 insertions(+), 1 deletion(-) diff --git a/flake.lock b/flake.lock index e982473..c5a3439 100644 --- a/flake.lock +++ b/flake.lock @@ -178,6 +178,36 @@ "type": "github" } }, + "hyprland-plugins": { + "inputs": { + "hyprland": [ + "hyprland" + ], + "nixpkgs": [ + "hyprland-plugins", + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland-plugins", + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1738966025, + "narHash": "sha256-MzgrF0jKlTNnNS33D8PwI5z2MJ1Tzf5MQVf/oms2pdw=", + "owner": "hyprwm", + "repo": "hyprland-plugins", + "rev": "4f48dbe12f3cbbeb4d31c91c67b21edbc5b4b451", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprland-plugins", + "type": "github" + } + }, "hyprland-protocols": { "inputs": { "nixpkgs": [ @@ -409,6 +439,7 @@ "inputs": { "home-manager": "home-manager", "hyprland": "hyprland", + "hyprland-plugins": "hyprland-plugins", "nixpkgs": "nixpkgs_2" } }, diff --git a/home.nix b/home.nix index c43caa3..122f450 100644 --- a/home.nix +++ b/home.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: +{ config, pkgs, inputs, ... }: { home.username = "rafiq"; @@ -35,6 +35,32 @@ }; }; + wayland.windowManager.hyprland = { + enable = true; + + # Set these to null to use the packages defined in the system config. + package = null; + portalPackage = null; + + plugins = with pkgs.hyprlandPlugins; [ + # borders-plus-plus + # inputs.hyprland-plugins.packages.${pkgs.stdenv.hostPlatform.system}. + # hypr-dynamic-cursors # requires notifications set up + ]; + + settings = { + "$mainMod" = "SUPER"; # Sets the modifier key to Windows key + "$terminal" = "kitty"; + bind = [ + "$mainMod, Q, exec, $terminal" + "$mainMod, W, killactive" + ]; + debug = { + disable_logs = false; + }; + }; + }; + home.stateVersion = "24.11"; programs.home-manager.enable = true; }