19 , useSystemd ? lib.meta.availableOn stdenv.hostPlatform systemd
22 rustPlatform.buildRustPackage rec {
23 pname = "cosmic-comp";
24 version = "1.0.0-alpha.2";
26 src = fetchFromGitHub {
29 rev = "epoch-${version}";
30 hash = "sha256-IbGMp+4nRg4v5yRvp3ujGx7+nJ6wJmly6dZBXbQAnr8=";
34 lockFile = ./Cargo.lock;
36 "atomicwrites-0.4.2" = "sha256-QZSuGPrJXh+svMeFWqAXoqZQxLq/WfIiamqvjJNVhxA=";
37 "clipboard_macos-0.1.0" = "sha256-cG5vnkiyDlQnbEfV2sPbmBYKv1hd3pjJrymfZb8ziKk=";
38 "cosmic-config-0.1.0" = "sha256-MZLjSIhPz+cpaSHA1R1S+9FD60ys+tHaJ+2Cz+2B/uE=";
39 "cosmic-protocols-0.1.0" = "sha256-6XM6kcM2CEGAziCkal4uO0EL1nEWOKb3rFs7hFh6r7Y=";
40 "cosmic-settings-config-0.1.0" = "sha256-j4tAclYoenNM+iBwk8iHOj4baIXc4wkclPl5RZsADGI=";
41 "cosmic-text-0.12.1" = "sha256-3opGta6Co8l+hIQRVGkfSy6IqJXq/N8ZzqF+YGQADmI=";
42 "d3d12-0.19.0" = "sha256-usrxQXWLGJDjmIdw1LBXtBvX+CchZDvE8fHC0LjvhD4=";
43 "glyphon-0.5.0" = "sha256-j1HrbEpUBqazWqNfJhpyjWuxYAxkvbXzRKeSouUoPWg=";
44 "iced-0.12.0" = "sha256-1RSl5Zd6pkSdAD0zkjL8mzgBbCuc0AE564uI8zrNCyc=";
45 "id_tree-1.8.0" = "sha256-uKdKHRfPGt3vagOjhnri3aYY5ar7O3rp2/ivTfM2jT0=";
46 "smithay-0.3.0" = "sha256-vep0/Hv1E5YvnHFV91+4Y3CTxOYCAndEnguw/XJ3sNM=";
47 "smithay-clipboard-0.8.0" = "sha256-4InFXm0ahrqFrtNLeqIuE3yeOpxKZJZx+Bc0yQDtv34=";
48 "smithay-egui-0.1.0" = "sha256-i8Rlo221v8G7QUAVVBtBNdOtQv1Drv2oj+EhTBak25g=";
49 "softbuffer-0.4.1" = "sha256-a0bUFz6O8CWRweNt/OxTvflnPYwO5nm6vsyc/WcXyNg=";
50 "taffy-0.3.11" = "sha256-SCx9GEIJjWdoNVyq+RZAGn0N71qraKZxf9ZWhvyzLaI=";
54 separateDebugInfo = true;
56 nativeBuildInputs = [ makeBinaryWrapper pkg-config ];
66 ] ++ lib.optional useSystemd systemd;
68 # Only default feature is systemd
69 buildNoDefaultFeatures = !useSystemd;
71 # Force linking to libEGL, which is always dlopen()ed, and to
72 # libwayland-client, which is always dlopen()ed except by the
73 # obscure winit backend.
74 RUSTFLAGS = map (a: "-C link-arg=${a}") [
75 "-Wl,--push-state,--no-as-needed"
83 "CARGO_TARGET_DIR=target/${stdenv.hostPlatform.rust.cargoShortTarget}"
86 dontCargoInstall = true;
88 # These libraries are only used by the X11 backend, which will not
89 # be the common case, so just make them available, don't link them.
91 wrapProgramArgs=(--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [
92 xorg.libX11 xorg.libXcursor xorg.libXi
94 '' + lib.optionalString useXWayland ''
95 wrapProgramArgs+=(--prefix PATH : ${lib.makeBinPath [ xwayland ]})
97 wrapProgram $out/bin/cosmic-comp "''${wrapProgramArgs[@]}"
101 homepage = "https://github.com/pop-os/cosmic-comp";
102 description = "Compositor for the COSMIC Desktop Environment";
103 mainProgram = "cosmic-comp";
104 license = licenses.gpl3Only;
105 maintainers = with maintainers; [ qyliss nyabinary ];
106 platforms = platforms.linux;