2025-07-26 11:39:35 +02:00

80 lines
1.7 KiB
Nix

{
lib,
stdenv,
fetchFromGitHub,
rustPlatform,
cosmic-wallpapers,
libcosmicAppHook,
just,
nasm,
nix-update-script,
nixosTests,
}:
rustPlatform.buildRustPackage (finalAttrs: {
pname = "cosmic-bg";
version = "1.0.0-alpha.7";
# nixpkgs-update: no auto update
src = fetchFromGitHub {
owner = "pop-os";
repo = "cosmic-bg";
tag = "epoch-${finalAttrs.version}";
hash = "sha256-KMP7TmamtbycF/nKctjYozMJwVr9zdp4A8AWriswo2g=";
};
postPatch = ''
substituteInPlace config/src/lib.rs data/v1/all \
--replace-fail '/usr/share/backgrounds/cosmic/orion_nebula_nasa_heic0601a.jpg' \
"${cosmic-wallpapers}/share/backgrounds/cosmic/orion_nebula_nasa_heic0601a.jpg"
'';
cargoHash = "sha256-GLXooTjcGq4MsBNnlpHBBUJGNs5UjKMQJGJuj9UO2wk=";
nativeBuildInputs = [
just
libcosmicAppHook
nasm
];
dontUseJustBuild = true;
dontUseJustCheck = true;
justFlags = [
"--set"
"prefix"
(placeholder "out")
"--set"
"bin-src"
"target/${stdenv.hostPlatform.rust.cargoShortTarget}/release/cosmic-bg"
];
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-bg";
description = "Applies Background for the COSMIC Desktop Environment";
license = lib.licenses.mpl20;
teams = [ lib.teams.cosmic ];
platforms = lib.platforms.linux;
mainProgram = "cosmic-bg";
};
})