From 08dbe67a1e1ea90aacd36cc17166a69f02929c9f Mon Sep 17 00:00:00 2001 From: Mihai Fufezan Date: Sun, 1 Sep 2024 20:42:51 +0300 Subject: [PATCH] Nix: add info about portalPackage --- pages/Nix/Hyprland on Home Manager.md | 29 +++++++++++++-------------- pages/Nix/Hyprland on NixOS.md | 6 ++++++ 2 files changed, 20 insertions(+), 15 deletions(-) diff --git a/pages/Nix/Hyprland on Home Manager.md b/pages/Nix/Hyprland on Home Manager.md index de50ba7..44e09c1 100644 --- a/pages/Nix/Hyprland on Home Manager.md +++ b/pages/Nix/Hyprland on Home Manager.md @@ -40,16 +40,8 @@ For a list of available options, check the {{< tab "Flakes" >}} -{{< callout >}} - -The flake module is merely an extension to the Home Manager downstream module. -It is mainly used as a staging area for new options, so unless you're a tester -you should use the downstream Home Manager module. - -{{< /callout >}} - The following snippet of code tries to show how to bring the Hyprland flake from -the flake input and import it into the module system. Feel free to make any +the flake input and use its packages with Home Manager. Feel free to make any adjustment for your setup. Don't forget to replace `user@hostname` with your username and hostname! @@ -74,9 +66,14 @@ Don't forget to replace `user@hostname` with your username and hostname! pkgs = nixpkgs.legacyPackages.x86_64-linux; modules = [ - hyprland.homeManagerModules.default { - wayland.windowManager.hyprland.enable = true; + wayland.windowManager.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; + }; } # ... ]; @@ -87,7 +84,7 @@ Don't forget to replace `user@hostname` with your username and hostname! {{< /tab >}} -{{< tab "No flakes (with flake-compat)" >}} +{{< tab "Nix stable (with flake-compat)" >}} {{< callout >}} @@ -107,7 +104,7 @@ make any adjustment for your setup. {pkgs, ...}: let flake-compat = builtins.fetchTarball "https://github.com/edolstra/flake-compat/archive/master.tar.gz"; - hyprland-flake = (import flake-compat { + hyprland = (import flake-compat { # we're not using pkgs.fetchgit as that requires a hash to be provided src = builtins.fetchGit { url = "https://github.com/hyprwm/Hyprland.git"; @@ -117,8 +114,10 @@ make any adjustment for your setup. in { wayland.windowManager.hyprland = { enable = true; - - package = hyprland-flake.packages.${pkgs.stdenv.hostPlatform.system}.hyprland; + # set the flake package + package = hyprland.packages.${pkgs.stdenv.hostPlatform.system}.hyprland; + # make sure to also set the portal package, so that they are in sync + portalPackage = hyprland.packages.${pkgs.stdenv.hostPlatform.system}.xdg-desktop-portal-hyprland; } } ``` diff --git a/pages/Nix/Hyprland on NixOS.md b/pages/Nix/Hyprland on NixOS.md index b73719a..6bc3201 100644 --- a/pages/Nix/Hyprland on NixOS.md +++ b/pages/Nix/Hyprland on NixOS.md @@ -82,7 +82,10 @@ this: {inputs, pkgs, ...}: { 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; }; } ``` @@ -139,7 +142,10 @@ have to compile Hyprland yourself. in { programs.hyprland = { enable = true; + # set the flake package package = hyprland.packages.${pkgs.stdenv.hostPlatform.system}.hyprland; + # make sure to also set the portal package, so that they are in sync + portalPackage = hyprland.packages.${pkgs.stdenv.hostPlatform.system}.xdg-desktop-portal-hyprland; }; } ```