104 lines
2.2 KiB
Nix
104 lines
2.2 KiB
Nix
{
|
|
lib,
|
|
stdenv,
|
|
fetchFromGitHub,
|
|
rustPlatform,
|
|
libcosmicAppHook,
|
|
cmake,
|
|
just,
|
|
libinput,
|
|
linux-pam,
|
|
udev,
|
|
coreutils,
|
|
xkeyboard_config,
|
|
nix-update-script,
|
|
nixosTests,
|
|
}:
|
|
|
|
rustPlatform.buildRustPackage (finalAttrs: {
|
|
pname = "cosmic-greeter";
|
|
version = "1.0.0-alpha.7";
|
|
|
|
# nixpkgs-update: no auto update
|
|
src = fetchFromGitHub {
|
|
owner = "pop-os";
|
|
repo = "cosmic-greeter";
|
|
tag = "epoch-${finalAttrs.version}";
|
|
hash = "sha256-o9ZoRHi+k+HCSGfRz1lQFAeJMCqcTQEHf5rf9wn3qqY=";
|
|
};
|
|
|
|
cargoHash = "sha256-hUHkyz/avFu9g1FMdC+4vz6xM75CauurrarhouuVZXc=";
|
|
|
|
env.VERGEN_GIT_COMMIT_DATE = "2025-04-25";
|
|
env.VERGEN_GIT_SHA = finalAttrs.src.tag;
|
|
|
|
cargoBuildFlags = [ "--all" ];
|
|
|
|
nativeBuildInputs = [
|
|
rustPlatform.bindgenHook
|
|
cmake
|
|
just
|
|
libcosmicAppHook
|
|
];
|
|
|
|
buildInputs = [
|
|
libinput
|
|
linux-pam
|
|
udev
|
|
];
|
|
|
|
dontUseJustBuild = true;
|
|
dontUseJustCheck = true;
|
|
|
|
justFlags = [
|
|
"--set"
|
|
"prefix"
|
|
(placeholder "out")
|
|
"--set"
|
|
"bin-src"
|
|
"target/${stdenv.hostPlatform.rust.cargoShortTarget}/release/cosmic-greeter"
|
|
"--set"
|
|
"daemon-src"
|
|
"target/${stdenv.hostPlatform.rust.cargoShortTarget}/release/cosmic-greeter-daemon"
|
|
];
|
|
|
|
postPatch = ''
|
|
substituteInPlace src/greeter.rs --replace-fail '/usr/bin/env' '${lib.getExe' coreutils "env"}'
|
|
'';
|
|
|
|
preFixup = ''
|
|
libcosmicAppWrapperArgs+=(
|
|
--set-default X11_BASE_RULES_XML ${xkeyboard_config}/share/X11/xkb/rules/base.xml
|
|
--set-default X11_BASE_EXTRA_RULES_XML ${xkeyboard_config}/share/X11/xkb/rules/extra.xml
|
|
)
|
|
'';
|
|
|
|
passthru = {
|
|
tests = {
|
|
inherit (nixosTests)
|
|
cosmic
|
|
cosmic-autologin
|
|
cosmic-noxwayland
|
|
cosmic-autologin-noxwayland
|
|
;
|
|
};
|
|
updateScript = nix-update-script {
|
|
extraArgs = [
|
|
"--version"
|
|
"unstable"
|
|
"--version-regex"
|
|
"epoch-(.*)"
|
|
];
|
|
};
|
|
};
|
|
|
|
meta = {
|
|
homepage = "https://github.com/pop-os/cosmic-greeter";
|
|
description = "Greeter for the COSMIC Desktop Environment";
|
|
mainProgram = "cosmic-greeter";
|
|
license = lib.licenses.gpl3Only;
|
|
teams = [ lib.teams.cosmic ];
|
|
platforms = lib.platforms.linux;
|
|
};
|
|
})
|