Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

81 lines
1.8 KiB
Nix
Raw Permalink Normal View History

2025-02-08 11:59:58 -03:00
# SPDX-License-Identifier: MIT
# SPDX-FileCopyrightText: Lily Foster <lily@lily.flowers>
# Portions of this code are adapted from nixos-cosmic
# https://github.com/lilyinstarlight/nixos-cosmic
{
lib,
stdenv,
rustPlatform,
fetchFromGitHub,
libcosmicAppHook,
just,
bash,
nix-update-script,
2025-04-09 02:29:30 +05:30
nixosTests,
2025-02-08 11:59:58 -03:00
}:
2025-03-24 15:15:23 +05:30
rustPlatform.buildRustPackage (finalAttrs: {
2025-02-08 11:59:58 -03:00
pname = "cosmic-idle";
version = "1.0.0-alpha.7";
2025-02-08 11:59:58 -03:00
# nixpkgs-update: no auto update
2025-02-08 11:59:58 -03:00
src = fetchFromGitHub {
owner = "pop-os";
repo = "cosmic-idle";
2025-03-24 15:15:23 +05:30
tag = "epoch-${finalAttrs.version}";
hash = "sha256-dRvcow+rZ4sJV6pBxRIw6SCmU3aXP9uVKtFEJ9vozzI=";
2025-02-08 11:59:58 -03:00
};
cargoHash = "sha256-iFR0kFyzawlXrWItzFQbG/tKGd3Snwk/0LYkPzCkJUQ=";
nativeBuildInputs = [
just
libcosmicAppHook
];
dontUseJustBuild = true;
dontUseJustCheck = true;
justFlags = [
"--set"
"prefix"
(placeholder "out")
"--set"
"bin-src"
"target/${stdenv.hostPlatform.rust.cargoShortTarget}/release/cosmic-idle"
];
postPatch = ''
substituteInPlace src/main.rs --replace-fail '"/bin/sh"' '"${lib.getExe' bash "sh"}"'
'';
2025-04-09 02:29:30 +05:30
passthru = {
tests = {
inherit (nixosTests)
cosmic
cosmic-autologin
cosmic-noxwayland
cosmic-autologin-noxwayland
;
};
updateScript = nix-update-script {
extraArgs = [
"--version"
"unstable"
"--version-regex"
"epoch-(.*)"
];
};
2025-02-08 11:59:58 -03:00
};
meta = {
description = "Idle daemon for the COSMIC Desktop Environment";
homepage = "https://github.com/pop-os/cosmic-idle";
license = lib.licenses.gpl3Only;
mainProgram = "cosmic-idle";
teams = [ lib.teams.cosmic ];
2025-02-08 11:59:58 -03:00
platforms = lib.platforms.linux;
sourceProvenance = [ lib.sourceTypes.fromSource ];
};
2025-03-24 15:15:23 +05:30
})