20 useSystemd ? lib.meta.availableOn stdenv.hostPlatform systemd,
23 rustPlatform.buildRustPackage rec {
24 pname = "cosmic-comp";
25 version = "1.0.0-alpha.2";
27 src = fetchFromGitHub {
30 rev = "epoch-${version}";
31 hash = "sha256-IbGMp+4nRg4v5yRvp3ujGx7+nJ6wJmly6dZBXbQAnr8=";
34 useFetchCargoVendor = true;
35 cargoHash = "sha256-4ahdQ0lQbG+lifGlsJE0yci4j8pR7tYVsMww9LyYyAA=";
37 separateDebugInfo = true;
52 ] ++ lib.optional useSystemd systemd;
54 # Only default feature is systemd
55 buildNoDefaultFeatures = !useSystemd;
57 # Force linking to libEGL, which is always dlopen()ed, and to
58 # libwayland-client, which is always dlopen()ed except by the
59 # obscure winit backend.
60 RUSTFLAGS = map (a: "-C link-arg=${a}") [
61 "-Wl,--push-state,--no-as-needed"
69 "CARGO_TARGET_DIR=target/${stdenv.hostPlatform.rust.cargoShortTarget}"
72 dontCargoInstall = true;
74 # These libraries are only used by the X11 backend, which will not
75 # be the common case, so just make them available, don't link them.
78 wrapProgramArgs=(--prefix LD_LIBRARY_PATH : ${
86 + lib.optionalString useXWayland ''
87 wrapProgramArgs+=(--prefix PATH : ${lib.makeBinPath [ xwayland ]})
90 wrapProgram $out/bin/cosmic-comp "''${wrapProgramArgs[@]}"
94 homepage = "https://github.com/pop-os/cosmic-comp";
95 description = "Compositor for the COSMIC Desktop Environment";
96 mainProgram = "cosmic-comp";
97 license = licenses.gpl3Only;
98 maintainers = with maintainers; [
102 platforms = platforms.linux;