78 lines
1.8 KiB
Nix
78 lines
1.8 KiB
Nix
{
|
|
lib,
|
|
fetchFromGitHub,
|
|
bash,
|
|
rustPlatform,
|
|
just,
|
|
dbus,
|
|
stdenv,
|
|
xdg-desktop-portal-cosmic,
|
|
nixosTests,
|
|
}:
|
|
|
|
rustPlatform.buildRustPackage (finalAttrs: {
|
|
pname = "cosmic-session";
|
|
version = "1.0.0-alpha.7";
|
|
|
|
# nixpkgs-update: no auto update
|
|
src = fetchFromGitHub {
|
|
owner = "pop-os";
|
|
repo = "cosmic-session";
|
|
tag = "epoch-${finalAttrs.version}";
|
|
hash = "sha256-vozm4vcXV3RB9Pk6om1UNCfGh80vIVJvSwbzwGDQw3Y=";
|
|
};
|
|
|
|
cargoHash = "sha256-68budhhbt8wPY7sfDqwIs4MWB/NBXsswK6HbC2AnHqE=";
|
|
|
|
postPatch = ''
|
|
substituteInPlace data/start-cosmic \
|
|
--replace-fail '/usr/bin/cosmic-session' "${placeholder "out"}/bin/cosmic-session" \
|
|
--replace-fail '/usr/bin/dbus-run-session' "${lib.getBin dbus}/bin/dbus-run-session"
|
|
substituteInPlace data/cosmic.desktop \
|
|
--replace-fail '/usr/bin/start-cosmic' "${placeholder "out"}/bin/start-cosmic"
|
|
'';
|
|
|
|
buildInputs = [ bash ];
|
|
nativeBuildInputs = [ just ];
|
|
|
|
dontUseJustBuild = true;
|
|
|
|
justFlags = [
|
|
"--set"
|
|
"prefix"
|
|
(placeholder "out")
|
|
"--set"
|
|
"cosmic_dconf_profile"
|
|
"${placeholder "out"}/etc/dconf/profile/cosmic"
|
|
"--set"
|
|
"cargo-target-dir"
|
|
"target/${stdenv.hostPlatform.rust.cargoShortTarget}"
|
|
];
|
|
|
|
env = {
|
|
XDP_COSMIC = "${xdg-desktop-portal-cosmic}/libexec/xdg-desktop-portal-cosmic";
|
|
ORCA = "orca"; # get orca from $PATH
|
|
};
|
|
|
|
passthru = {
|
|
providedSessions = [ "cosmic" ];
|
|
tests = {
|
|
inherit (nixosTests)
|
|
cosmic
|
|
cosmic-autologin
|
|
cosmic-noxwayland
|
|
cosmic-autologin-noxwayland
|
|
;
|
|
};
|
|
};
|
|
|
|
meta = {
|
|
homepage = "https://github.com/pop-os/cosmic-session";
|
|
description = "Session manager for the COSMIC desktop environment";
|
|
license = lib.licenses.gpl3Only;
|
|
mainProgram = "cosmic-session";
|
|
teams = [ lib.teams.cosmic ];
|
|
platforms = lib.platforms.linux;
|
|
};
|
|
})
|