Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
82 lines
1.9 KiB
Nix
82 lines
1.9 KiB
Nix
# SPDX-License-Identifier: MIT
|
|
# SPDX-FileCopyrightText: Lily Foster <lily@lily.flowers>
|
|
# Portions of this code are adapted from nixos-cosmic
|
|
# https://github.com/lilyinstarlight/nixos-cosmic
|
|
|
|
{
|
|
lib,
|
|
stdenv,
|
|
makeSetupHook,
|
|
makeBinaryWrapper,
|
|
pkg-config,
|
|
targetPackages,
|
|
libGL,
|
|
libxkbcommon,
|
|
xorg,
|
|
wayland,
|
|
vulkan-loader,
|
|
|
|
includeSettings ? true,
|
|
}:
|
|
|
|
makeSetupHook {
|
|
name = "libcosmic-app-hook";
|
|
|
|
propagatedBuildInputs = [
|
|
makeBinaryWrapper
|
|
pkg-config
|
|
];
|
|
|
|
# ensure deps for linking below are available
|
|
depsTargetTargetPropagated =
|
|
assert (lib.assertMsg (!targetPackages ? raw) "libcosmicAppHook must be in nativeBuildInputs");
|
|
[
|
|
libGL
|
|
libxkbcommon
|
|
xorg.libX11
|
|
xorg.libXcursor
|
|
xorg.libXi
|
|
xorg.libxcb
|
|
]
|
|
++ lib.optionals (!stdenv.hostPlatform.isDarwin) [
|
|
wayland
|
|
vulkan-loader
|
|
];
|
|
|
|
substitutions = {
|
|
fallbackXdgDirs = "${lib.optionalString includeSettings "${targetPackages.cosmic-settings}/share:"}${targetPackages.cosmic-icons}/share";
|
|
|
|
cargoLinkerVar = targetPackages.stdenv.hostPlatform.rust.cargoEnvVarTarget;
|
|
# force linking for all libraries that may be dlopen'd by libcosmic/iced apps
|
|
cargoLinkLibs = lib.escapeShellArgs (
|
|
[
|
|
# for wgpu-hal
|
|
"EGL"
|
|
# for xkbcommon-dl
|
|
"xkbcommon"
|
|
# for x11-dl, tiny-xlib, wgpu-hal
|
|
"X11"
|
|
# for x11-dl, tiny-xlib
|
|
"X11-xcb"
|
|
# for x11-dl
|
|
"Xcursor"
|
|
"Xi"
|
|
# for x11rb
|
|
"xcb"
|
|
]
|
|
++ lib.optionals (!stdenv.hostPlatform.isDarwin) [
|
|
# for wgpu-hal, wayland-sys
|
|
"wayland-client"
|
|
# for wgpu-hal
|
|
"wayland-egl"
|
|
"vulkan"
|
|
]
|
|
);
|
|
};
|
|
|
|
meta = {
|
|
description = "Setup hook for configuring and wrapping applications based on libcosmic";
|
|
teams = [ lib.teams.cosmic ];
|
|
};
|
|
} ./libcosmic-app-hook.sh
|