mirror of
https://github.com/elwrcl/copnix.git
synced 2026-10-31 06:18:03 +03:00
hope this works
This commit is contained in:
6 files changed
+220
-51
No files matched your search
+15
-1
@@ -31,6 +31,20 @@ with pkgs;
|
||||
loupe
|
||||
wine
|
||||
|
||||
# some kde stuff
|
||||
kdePackages.kdegraphics-thumbnailers
|
||||
kdePackages.plasma-integration
|
||||
kdePackages.breeze-icons
|
||||
kdePackages.kio-extras
|
||||
kdePackages.qtwayland
|
||||
kdePackages.kio-admin
|
||||
kdePackages.kio-fuse
|
||||
kdePackages.kservice
|
||||
kdePackages.dolphin
|
||||
kdePackages.qtsvg
|
||||
kdePackages.kio
|
||||
kdePackages.kdf
|
||||
|
||||
# qol-hyprland
|
||||
gpu-screen-recorder
|
||||
wl-clipboard
|
||||
@@ -134,7 +148,7 @@ with pkgs;
|
||||
uv
|
||||
|
||||
# editors
|
||||
zed-editor-fhs
|
||||
zed-editor-fhs_git
|
||||
neovim
|
||||
vscode
|
||||
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
{ ... }:
|
||||
{
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
imports = [
|
||||
@@ -7,44 +10,55 @@
|
||||
./audio
|
||||
];
|
||||
|
||||
xdg.mime = {
|
||||
enable = true;
|
||||
defaultApplications = {
|
||||
# gui
|
||||
"text/html" = "zen-beta.desktop";
|
||||
"x-scheme-handler/http" = "zen-beta.desktop";
|
||||
"x-scheme-handler/https" = "zen-beta.desktop";
|
||||
"x-scheme-handler/about" = "zen-beta.desktop";
|
||||
"x-scheme-handler/unknown" = "zen-beta.desktop";
|
||||
"x-scheme-handler/steam" = "steam.desktop";
|
||||
xdg = {
|
||||
mime = {
|
||||
enable = true;
|
||||
|
||||
# media
|
||||
"image/png" = "org.gnome.Loupe.desktop";
|
||||
"image/jpeg" = "org.gnome.Loupe.desktop";
|
||||
"image/gif" = "org.gnome.Loupe.desktop";
|
||||
"image/bmp" = "org.gnome.Loupe.desktop";
|
||||
"image/svg+xml" = "org.gnome.Loupe.desktop";
|
||||
"image/webp" = "org.gnome.Loupe.desktop";
|
||||
"image/tiff" = "org.gnome.Loupe.desktop";
|
||||
"video/mp4" = "mpv.desktop";
|
||||
"video/x-matroska" = "mpv.desktop";
|
||||
"video/webm" = "mpv.desktop";
|
||||
"video/avi" = "mpv.desktop";
|
||||
"video/quicktime" = "mpv.desktop";
|
||||
"audio/mpeg" = "mpv.desktop";
|
||||
"audio/flac" = "mpv.desktop";
|
||||
"audio/ogg" = "mpv.desktop";
|
||||
defaultApplications = {
|
||||
# gui
|
||||
"text/html" = "zen-beta.desktop";
|
||||
"x-scheme-handler/http" = "zen-beta.desktop";
|
||||
"x-scheme-handler/https" = "zen-beta.desktop";
|
||||
"x-scheme-handler/about" = "zen-beta.desktop";
|
||||
"x-scheme-handler/unknown" = "zen-beta.desktop";
|
||||
"x-scheme-handler/steam" = "steam.desktop";
|
||||
|
||||
# code
|
||||
"text/plain" = "zeditor.desktop";
|
||||
"text/x-rust" = "zeditor.desktop";
|
||||
"text/x-nix" = "zeditor.desktop";
|
||||
"text/x-csrc" = "zeditor.desktop";
|
||||
"text/x-chdr" = "zeditor.desktop";
|
||||
"text/x-python" = "zeditor.desktop";
|
||||
"text/x-shellscript" = "zeditor.desktop";
|
||||
"application/json" = "zeditor.desktop";
|
||||
"application/x-shellscript" = "zeditor.desktop";
|
||||
# media
|
||||
"image/png" = "org.gnome.Loupe.desktop";
|
||||
"image/jpeg" = "org.gnome.Loupe.desktop";
|
||||
"image/gif" = "org.gnome.Loupe.desktop";
|
||||
"image/bmp" = "org.gnome.Loupe.desktop";
|
||||
"image/svg+xml" = "org.gnome.Loupe.desktop";
|
||||
"image/webp" = "org.gnome.Loupe.desktop";
|
||||
"image/tiff" = "org.gnome.Loupe.desktop";
|
||||
|
||||
"video/mp4" = "mpv.desktop";
|
||||
"video/x-matroska" = "mpv.desktop";
|
||||
"video/webm" = "mpv.desktop";
|
||||
"video/avi" = "mpv.desktop";
|
||||
"video/quicktime" = "mpv.desktop";
|
||||
|
||||
"audio/mpeg" = "mpv.desktop";
|
||||
"audio/flac" = "mpv.desktop";
|
||||
"audio/ogg" = "mpv.desktop";
|
||||
|
||||
# code
|
||||
"text/plain" = "zeditor.desktop";
|
||||
"text/x-rust" = "zeditor.desktop";
|
||||
"text/x-nix" = "zeditor.desktop";
|
||||
"text/x-csrc" = "zeditor.desktop";
|
||||
"text/x-chdr" = "zeditor.desktop";
|
||||
"text/x-python" = "zeditor.desktop";
|
||||
"text/x-shellscript" = "zeditor.desktop";
|
||||
"application/json" = "zeditor.desktop";
|
||||
"application/x-shellscript" = "zeditor.desktop";
|
||||
};
|
||||
};
|
||||
|
||||
menus.enable = true;
|
||||
};
|
||||
}
|
||||
|
||||
environment.etc."xdg/menus/applications.menu".text =
|
||||
builtins.readFile
|
||||
"${pkgs.kdePackages.plasma-workspace}/etc/xdg/menus/plasma-applications.menu";
|
||||
}
|
||||
@@ -21,22 +21,12 @@ let
|
||||
hash = "sha256-tZ1rZ+4bRxarcFQhP8V2Mfz0sJ5rBgHYLu2ulrQwL+U=";
|
||||
};
|
||||
});
|
||||
custom-mesa = pkgs.mesa.overrideAttrs (oldAttrs: {
|
||||
patches = (oldAttrs.patches or []) ++ [
|
||||
../../../../patches/hd4000-hasvk13.patch
|
||||
];
|
||||
});
|
||||
custom-mesa-32 = pkgs.pkgsi686Linux.mesa.overrideAttrs (oldAttrs: {
|
||||
patches = (oldAttrs.patches or []) ++ [
|
||||
../../../../patches/hd4000-hasvk13.patch
|
||||
];
|
||||
});
|
||||
hasvk13-layer = pkgs.callPackage ./hasvk13-layer {};
|
||||
in
|
||||
{
|
||||
hardware.graphics = {
|
||||
package = custom-mesa;
|
||||
package32 = custom-mesa-32;
|
||||
extraPackages = [
|
||||
hasvk13-layer
|
||||
wayland-intel-vaapi-driver
|
||||
pkgs.libvdpau-va-gl
|
||||
pkgs.intel-ocl
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
{ pkgs }:
|
||||
|
||||
pkgs.stdenv.mkDerivation {
|
||||
name = "vulkan-layer-hasvk13";
|
||||
src = ./.;
|
||||
|
||||
buildInputs = [ pkgs.vulkan-headers ];
|
||||
|
||||
buildPhase = ''
|
||||
$CC -shared -fPIC -O2 -o libVkLayer_hasvk13.so hasvk13_layer.c \
|
||||
-I${pkgs.vulkan-headers}/include
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/lib $out/share/vulkan/implicit_layer.d
|
||||
cp libVkLayer_hasvk13.so $out/lib/
|
||||
|
||||
substitute hasvk13_layer.json \
|
||||
$out/share/vulkan/implicit_layer.d/hasvk13_layer.json \
|
||||
--subst-var out
|
||||
'';
|
||||
}
|
||||
@@ -0,0 +1,115 @@
|
||||
/*
|
||||
* Vulkan implicit layer forces VK 1.3.348
|
||||
*/
|
||||
|
||||
#include <vulkan/vulkan.h>
|
||||
#include <vulkan/vk_layer.h>
|
||||
#include <string.h>
|
||||
|
||||
static PFN_vkGetInstanceProcAddr g_next_gipa = NULL;
|
||||
static PFN_vkGetPhysicalDeviceProperties g_next_gdp = NULL;
|
||||
static PFN_vkGetPhysicalDeviceProperties2 g_next_gdp2 = NULL;
|
||||
|
||||
#define HASVK13_API_VERSION VK_MAKE_API_VERSION(0, 1, 3, VK_HEADER_VERSION)
|
||||
#define INTEL_VENDOR_ID 0x8086
|
||||
|
||||
static int is_intel_below_13(uint32_t vendorID, uint32_t apiVersion)
|
||||
{
|
||||
return vendorID == INTEL_VENDOR_ID
|
||||
&& VK_API_VERSION_MAJOR(apiVersion) == 1
|
||||
&& VK_API_VERSION_MINOR(apiVersion) < 3;
|
||||
}
|
||||
|
||||
VKAPI_ATTR VkResult VKAPI_CALL
|
||||
HaVK13_EnumerateInstanceVersion(uint32_t *pApiVersion)
|
||||
{
|
||||
*pApiVersion = HASVK13_API_VERSION;
|
||||
return VK_SUCCESS;
|
||||
}
|
||||
|
||||
VKAPI_ATTR VkResult VKAPI_CALL
|
||||
HaVK13_CreateInstance(const VkInstanceCreateInfo *pCreateInfo,
|
||||
const VkAllocationCallbacks *pAllocator,
|
||||
VkInstance *pInstance)
|
||||
{
|
||||
VkLayerInstanceCreateInfo *link =
|
||||
(VkLayerInstanceCreateInfo *)pCreateInfo->pNext;
|
||||
|
||||
while (link &&
|
||||
!(link->sType == VK_STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO &&
|
||||
link->function == VK_LAYER_LINK_INFO))
|
||||
link = (VkLayerInstanceCreateInfo *)link->pNext;
|
||||
|
||||
if (!link) return VK_ERROR_INITIALIZATION_FAILED;
|
||||
|
||||
g_next_gipa = link->u.pLayerInfo->pfnNextGetInstanceProcAddr;
|
||||
link->u.pLayerInfo = link->u.pLayerInfo->pNext;
|
||||
|
||||
PFN_vkCreateInstance next_ci =
|
||||
(PFN_vkCreateInstance)g_next_gipa(NULL, "vkCreateInstance");
|
||||
|
||||
VkResult res = next_ci(pCreateInfo, pAllocator, pInstance);
|
||||
if (res != VK_SUCCESS) return res;
|
||||
|
||||
g_next_gdp = (PFN_vkGetPhysicalDeviceProperties)
|
||||
g_next_gipa(*pInstance, "vkGetPhysicalDeviceProperties");
|
||||
g_next_gdp2 = (PFN_vkGetPhysicalDeviceProperties2)
|
||||
g_next_gipa(*pInstance, "vkGetPhysicalDeviceProperties2");
|
||||
|
||||
return VK_SUCCESS;
|
||||
}
|
||||
|
||||
VKAPI_ATTR void VKAPI_CALL
|
||||
HaVK13_GetPhysicalDeviceProperties(VkPhysicalDevice device,
|
||||
VkPhysicalDeviceProperties *props)
|
||||
{
|
||||
if (g_next_gdp) g_next_gdp(device, props);
|
||||
|
||||
if (props && is_intel_below_13(props->vendorID, props->apiVersion))
|
||||
props->apiVersion = HASVK13_API_VERSION;
|
||||
}
|
||||
|
||||
VKAPI_ATTR void VKAPI_CALL
|
||||
HaVK13_GetPhysicalDeviceProperties2(VkPhysicalDevice device,
|
||||
VkPhysicalDeviceProperties2 *props2)
|
||||
{
|
||||
if (g_next_gdp2) g_next_gdp2(device, props2);
|
||||
|
||||
if (!props2) return;
|
||||
|
||||
VkPhysicalDeviceProperties *props = &props2->properties;
|
||||
if (!is_intel_below_13(props->vendorID, props->apiVersion)) return;
|
||||
|
||||
props->apiVersion = HASVK13_API_VERSION;
|
||||
|
||||
VkBaseOutStructure *s = (VkBaseOutStructure *)props2->pNext;
|
||||
while (s) {
|
||||
if (s->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_PROPERTIES) {
|
||||
VkPhysicalDeviceVulkan12Properties *p12 =
|
||||
(VkPhysicalDeviceVulkan12Properties *)s;
|
||||
p12->conformanceVersion = (VkConformanceVersion){ 1, 3, 0, 0 };
|
||||
}
|
||||
if (s->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES) {
|
||||
VkPhysicalDeviceDriverProperties *drv =
|
||||
(VkPhysicalDeviceDriverProperties *)s;
|
||||
drv->conformanceVersion = (VkConformanceVersion){ 1, 3, 0, 0 };
|
||||
}
|
||||
s = s->pNext;
|
||||
}
|
||||
}
|
||||
|
||||
VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL
|
||||
HaVK13_GetInstanceProcAddr(VkInstance instance, const char *pName)
|
||||
{
|
||||
#define INTERCEPT(fn) \
|
||||
if (strcmp(pName, #fn) == 0) return (PFN_vkVoidFunction)HaVK13_##fn;
|
||||
|
||||
INTERCEPT(GetInstanceProcAddr)
|
||||
INTERCEPT(EnumerateInstanceVersion)
|
||||
INTERCEPT(CreateInstance)
|
||||
INTERCEPT(GetPhysicalDeviceProperties)
|
||||
INTERCEPT(GetPhysicalDeviceProperties2)
|
||||
#undef INTERCEPT
|
||||
|
||||
return g_next_gipa ? g_next_gipa(instance, pName) : NULL;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"file_format_version": "1.1.2",
|
||||
"layer": {
|
||||
"name": "VK_LAYER_hasvk13_version_override",
|
||||
"type": "GLOBAL",
|
||||
"library_path": "@out@/lib/libVkLayer_hasvk13.so",
|
||||
"api_version": "1.3.0",
|
||||
"implementation_version": "1",
|
||||
"description": "Vulkan 1.3.348 implict layer.",
|
||||
"disable_environment": {
|
||||
"DISABLE_HASVK13_LAYER": "1"
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user