nixpkgs/pkgs/by-name/co/cosmic-comp/package.nix
Silvan Mosberger 4f0dadbf38 treewide: format all inactive Nix files
After final improvements to the official formatter implementation,
this commit now performs the first treewide reformat of Nix files using it.
This is part of the implementation of RFC 166.

Only "inactive" files are reformatted, meaning only files that
aren't being touched by any PR with activity in the past 2 months.
This is to avoid conflicts for PRs that might soon be merged.
Later we can do a full treewide reformat to get the rest,
which should not cause as many conflicts.

A CI check has already been running for some time to ensure that new and
already-formatted files are formatted, so the files being reformatted here
should also stay formatted.

This commit was automatically created and can be verified using

    nix-build a08b3a4d19.tar.gz \
      --argstr baseRev b32a094368
    result/bin/apply-formatting $NIXPKGS_PATH
2024-12-10 20:26:33 +01:00

105 lines
2.2 KiB
Nix

{
lib,
stdenv,
rustPlatform,
fetchFromGitHub,
makeBinaryWrapper,
pixman,
pkg-config,
libinput,
libglvnd,
libxkbcommon,
mesa,
seatd,
udev,
xwayland,
wayland,
xorg,
useXWayland ? true,
systemd,
useSystemd ? lib.meta.availableOn stdenv.hostPlatform systemd,
}:
rustPlatform.buildRustPackage rec {
pname = "cosmic-comp";
version = "1.0.0-alpha.2";
src = fetchFromGitHub {
owner = "pop-os";
repo = "cosmic-comp";
rev = "epoch-${version}";
hash = "sha256-IbGMp+4nRg4v5yRvp3ujGx7+nJ6wJmly6dZBXbQAnr8=";
};
useFetchCargoVendor = true;
cargoHash = "sha256-4ahdQ0lQbG+lifGlsJE0yci4j8pR7tYVsMww9LyYyAA=";
separateDebugInfo = true;
nativeBuildInputs = [
makeBinaryWrapper
pkg-config
];
buildInputs = [
libglvnd
libinput
libxkbcommon
mesa
pixman
seatd
udev
wayland
] ++ lib.optional useSystemd systemd;
# Only default feature is systemd
buildNoDefaultFeatures = !useSystemd;
# Force linking to libEGL, which is always dlopen()ed, and to
# libwayland-client, which is always dlopen()ed except by the
# obscure winit backend.
RUSTFLAGS = map (a: "-C link-arg=${a}") [
"-Wl,--push-state,--no-as-needed"
"-lEGL"
"-lwayland-client"
"-Wl,--pop-state"
];
makeFlags = [
"prefix=$(out)"
"CARGO_TARGET_DIR=target/${stdenv.hostPlatform.rust.cargoShortTarget}"
];
dontCargoInstall = true;
# These libraries are only used by the X11 backend, which will not
# be the common case, so just make them available, don't link them.
postInstall =
''
wrapProgramArgs=(--prefix LD_LIBRARY_PATH : ${
lib.makeLibraryPath [
xorg.libX11
xorg.libXcursor
xorg.libXi
]
})
''
+ lib.optionalString useXWayland ''
wrapProgramArgs+=(--prefix PATH : ${lib.makeBinPath [ xwayland ]})
''
+ ''
wrapProgram $out/bin/cosmic-comp "''${wrapProgramArgs[@]}"
'';
meta = with lib; {
homepage = "https://github.com/pop-os/cosmic-comp";
description = "Compositor for the COSMIC Desktop Environment";
mainProgram = "cosmic-comp";
license = licenses.gpl3Only;
maintainers = with maintainers; [
qyliss
nyabinary
];
platforms = platforms.linux;
};
}