nixos: configure xdg-desktop-portal

This commit is contained in:
Alexandre Cavalheiro 2024-06-15 22:56:54 -03:00
parent dc7acf7a43
commit f626840f77
Signed by: wizardlink
GPG key ID: A5767B54367CFBDF
2 changed files with 30 additions and 11 deletions

View file

@ -1,9 +1,11 @@
{ lib, stdenv, fetchFromGitHub, kernel, kmod }: { lib, stdenv, fetchFromGitHub, kernel, kmod }:
let kernelDirectory = "${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"; let
in stdenv.mkDerivation { kernelDirectory = "${kernel.dev}/lib/modules/${kernel.modDirVersion}/build";
in
stdenv.mkDerivation {
pname = "zenergy"; pname = "zenergy";
version = "a3e124477ee8197015481156b90100d49fa3cd84"; version = "0-unstable-2024-05-19";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "BoukeHaarsma23"; owner = "BoukeHaarsma23";
@ -12,29 +14,29 @@ in stdenv.mkDerivation {
hash = "sha256-10hiUHJvLTG3WGrr4WXMo/mCoJGFqWk2l5PryjNhcHg="; hash = "sha256-10hiUHJvLTG3WGrr4WXMo/mCoJGFqWk2l5PryjNhcHg=";
}; };
nativeBuildInputs = [ kmod ] ++ kernel.moduleBuildDependencies;
hardeningDisable = [ "format" "pic" ]; hardeningDisable = [ "format" "pic" ];
makeFlags = kernel.makeFlags ++ [ "KDIR=${kernelDirectory}" ]; makeFlags = kernel.makeFlags ++ [
"KDIR=${kernelDirectory}"
];
makeTargets = [ "modules_install" ];
preBuild = '' preBuild = ''
substituteInPlace Makefile --replace-fail "PWD modules_install" "PWD INSTALL_MOD_PATH=$out modules_install" substituteInPlace Makefile --replace-fail "PWD modules_install" "PWD INSTALL_MOD_PATH=$out modules_install"
''; '';
nativeBuildInputs = [ kmod ] ++ kernel.moduleBuildDependencies;
installPhase = '' installPhase = ''
make modules_install KDIR=${kernelDirectory} make modules_install KDIR=${kernelDirectory}
''; '';
outputs = [ "out" ];
meta = with lib; { meta = with lib; {
description = description = "Based on AMD_ENERGY driver, but with some jiffies added so non-root users can read it safely.";
"Based on AMD_ENERGY driver, but with some jiffies added so non-root users can read it safely.";
homepage = "https://github.com/BoukeHaarsma23/zenergy"; homepage = "https://github.com/BoukeHaarsma23/zenergy";
license = licenses.gpl2Only; license = licenses.gpl2Only;
maintainers = with maintainers; [ wizardlink ]; maintainers = with maintainers; [ wizardlink ];
platforms = platforms.linux; platforms = platforms.linux;
outputsToInstall = [ "out" ];
}; };
} }

View file

@ -210,6 +210,23 @@
# Enable Hyprland # Enable Hyprland
programs.hyprland.enable = true; programs.hyprland.enable = true;
# Enable XDG Desktop Portals.
xdg.portal = {
enable = true;
extraPortals = with pkgs; [
xdg-desktop-portal-hyprland
];
config = {
common = {
default = [
"hyprland"
];
};
};
};
# Enable OpenGL. # Enable OpenGL.
hardware.opengl = { hardware.opengl = {
enable = true; enable = true;