Files
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

112 lines
2.6 KiB
Nix

{
lib,
stdenv,
rustPlatform,
fetchFromGitHub,
fetchpatch2,
just,
libcosmicAppHook,
libinput,
openssl,
udev,
nixosTests,
nix-update-script,
}:
rustPlatform.buildRustPackage (finalAttrs: {
pname = "cosmic-initial-setup";
version = "1.0.0-beta.1.1";
src = fetchFromGitHub {
owner = "pop-os";
repo = "cosmic-initial-setup";
tag = "epoch-${finalAttrs.version}";
hash = "sha256-kjJqGNcIlnzEsfA4eQ9D23ZGgRcmWQyWheAlwpjfALA=";
};
cargoHash = "sha256-orwK9gcFXK4/+sfwRubcz0PP6YAFqsENRHnlSLttLxM=";
buildFeatures = [ "nixos" ];
# cargo-auditable fails during the build when compiling the `crabtime::function`
# procedural macro. It panics because the `--out-dir` flag is not passed to
# the rustc wrapper.
#
# Reported this issue upstream in:
# https://github.com/rust-secure-code/cargo-auditable/issues/225
auditable = false;
nativeBuildInputs = [
libcosmicAppHook
just
];
buildInputs = [
libinput
openssl
udev
];
# These are not needed for NixOS
patches = [
./disable-language-page.patch
./disable-timezone-page.patch
# TODO: Remove in next update
(fetchpatch2 {
name = "fix-layout-and-themes-page.patch";
url = "https://patch-diff.githubusercontent.com/raw/pop-os/cosmic-initial-setup/pull/53.diff?full_index=1";
hash = "sha256-081qyQnPhh+FRPU/JKJVCK+l3SKjHAIV5b6/7WN6lb8=";
})
];
postPatch = ''
# Installs in $out/etc/xdg/autostart instead of /etc/xdg/autostart
substituteInPlace justfile \
--replace-fail \
"autostart-dst := rootdir / 'etc' / 'xdg' / 'autostart' / desktop-entry" \
"autostart-dst := prefix / 'etc' / 'xdg' / 'autostart' / desktop-entry"
'';
dontUseJustBuild = true;
dontUseJustCheck = true;
justFlags = [
"--set"
"prefix"
(placeholder "out")
"--set"
"cargo-target-dir"
"target/${stdenv.hostPlatform.rust.cargoShortTarget}"
];
env.DISABLE_IF_EXISTS = "/iso/nix-store.squashfs";
passthru = {
tests = {
inherit (nixosTests)
cosmic
cosmic-autologin
cosmic-noxwayland
cosmic-autologin-noxwayland
;
};
updateScript = nix-update-script {
extraArgs = [
"--version"
"unstable"
"--version-regex"
"epoch-(.*)"
];
};
};
meta = {
description = "COSMIC Initial Setup";
homepage = "https://github.com/pop-os/cosmic-initial-setup";
license = lib.licenses.gpl3Only;
mainProgram = "cosmic-initial-setup";
platforms = lib.platforms.linux;
teams = [ lib.teams.cosmic ];
};
})