chack
This commit is contained in:
5
packages/proton-cachyos/cachyos-v2-version.json
Normal file
5
packages/proton-cachyos/cachyos-v2-version.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"base": "10.0",
|
||||
"release": "20251222",
|
||||
"hash": "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="
|
||||
}
|
||||
5
packages/proton-cachyos/cachyos-v3-version.json
Normal file
5
packages/proton-cachyos/cachyos-v3-version.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"base": "10.0",
|
||||
"release": "20251222",
|
||||
"hash": "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="
|
||||
}
|
||||
5
packages/proton-cachyos/cachyos-v4-version.json
Normal file
5
packages/proton-cachyos/cachyos-v4-version.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"base": "10.0",
|
||||
"release": "20251222",
|
||||
"hash": "sha256-1+6nCUc93vVZg3j4oSwuM7DYOZ2bNbLIjbH+8OUOSAQ="
|
||||
}
|
||||
5
packages/proton-cachyos/cachyos-version.json
Normal file
5
packages/proton-cachyos/cachyos-version.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"base": "10.0",
|
||||
"release": "20251222",
|
||||
"hash": "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="
|
||||
}
|
||||
82
packages/proton-cachyos/default.nix
Normal file
82
packages/proton-cachyos/default.nix
Normal file
@@ -0,0 +1,82 @@
|
||||
{
|
||||
callPackage,
|
||||
stdenvNoCC,
|
||||
lib,
|
||||
fetchurl,
|
||||
fetchzip,
|
||||
# Required
|
||||
versionFilename ? "cachyos-v4-version.json",
|
||||
owner ? "CachyOS",
|
||||
repo ? "proton-cachyos",
|
||||
# Optional
|
||||
withUpdateScript ? true,
|
||||
toolTitle ? null,
|
||||
toolPattern ? "proton-.*",
|
||||
tarballPrefix ? "proton-",
|
||||
tarballSuffix ? "-x86_64_v4.tar.xz",
|
||||
releasePrefix ? "cachyos-",
|
||||
releaseSuffix ? "-slr",
|
||||
version ? lib.trivial.importJSON ./${versionFilename},
|
||||
releaseVersion ? "${releasePrefix}${version.base}-${version.release}${releaseSuffix}",
|
||||
homepage ? "https://github.com/${owner}/${repo}",
|
||||
url ? "${homepage}/releases/download/${releaseVersion}/${tarballPrefix}${releaseVersion}${tarballSuffix}",
|
||||
}:
|
||||
let
|
||||
intake =
|
||||
if lib.strings.hasSuffix ".zip" url then
|
||||
{
|
||||
fetcher = fetchzip;
|
||||
input = "$src/*.tar.xz";
|
||||
}
|
||||
else
|
||||
{
|
||||
fetcher = fetchurl;
|
||||
input = "$src";
|
||||
};
|
||||
in
|
||||
stdenvNoCC.mkDerivation {
|
||||
name = repo;
|
||||
version = "${version.base}.${version.release}";
|
||||
|
||||
src = intake.fetcher {
|
||||
inherit url;
|
||||
inherit (version) hash;
|
||||
};
|
||||
|
||||
buildCommand = ''
|
||||
mkdir -p $out/bin
|
||||
tar -C $out/bin --strip=1 -x -f ${intake.input}
|
||||
''
|
||||
# Allow to keep the same name between updates
|
||||
+ lib.strings.optionalString (toolTitle != null) ''
|
||||
sed -i -r 's|"${toolPattern}"|"${toolTitle}"|' $out/bin/compatibilitytool.vdf
|
||||
'';
|
||||
|
||||
passthru =
|
||||
if withUpdateScript then
|
||||
{
|
||||
updateScript = callPackage ./update.nix {
|
||||
inherit
|
||||
tarballPrefix
|
||||
tarballSuffix
|
||||
releasePrefix
|
||||
releaseSuffix
|
||||
versionFilename
|
||||
owner
|
||||
repo
|
||||
;
|
||||
};
|
||||
}
|
||||
else
|
||||
{ };
|
||||
|
||||
meta = with lib; {
|
||||
inherit homepage;
|
||||
description = "Compatibility tool for Steam Play based on Wine and additional components (patched and built by ${owner})";
|
||||
license = licenses.bsd3;
|
||||
platforms = [ "x86_64-linux" ];
|
||||
maintainers = with maintainers; [
|
||||
pedrohlc
|
||||
];
|
||||
};
|
||||
}
|
||||
5
packages/proton-cachyos/ge-version.json
Normal file
5
packages/proton-cachyos/ge-version.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"base": "10",
|
||||
"release": "26",
|
||||
"hash": "sha256-4v/Z0qHs4wtdo9PcnO2qgodQCNHJhLXvx2ZsAoID+ds="
|
||||
}
|
||||
63
packages/proton-cachyos/update.nix
Normal file
63
packages/proton-cachyos/update.nix
Normal file
@@ -0,0 +1,63 @@
|
||||
{
|
||||
writeShellScript,
|
||||
lib,
|
||||
coreutils,
|
||||
findutils,
|
||||
gnugrep,
|
||||
curl,
|
||||
jq,
|
||||
git,
|
||||
nix,
|
||||
nix-prefetch-git,
|
||||
moreutils,
|
||||
yq,
|
||||
# Config
|
||||
tarballPrefix,
|
||||
tarballSuffix,
|
||||
releasePrefix,
|
||||
releaseSuffix,
|
||||
versionFilename,
|
||||
owner,
|
||||
repo,
|
||||
}:
|
||||
let
|
||||
path = lib.makeBinPath [
|
||||
coreutils
|
||||
curl
|
||||
findutils
|
||||
gnugrep
|
||||
jq
|
||||
moreutils
|
||||
git
|
||||
nix-prefetch-git
|
||||
nix
|
||||
yq
|
||||
];
|
||||
in
|
||||
writeShellScript "update-${repo}" ''
|
||||
set -euo pipefail
|
||||
PATH=${path}
|
||||
|
||||
srcJson=pkgs/proton-bin/${versionFilename}
|
||||
localBase=$(jq -r .base < $srcJson)
|
||||
localRelease=$(jq -r .release < $srcJson)
|
||||
|
||||
latestVer=$(curl 'https://github.com/${owner}/${repo}/releases.atom' | xq -r '.feed.entry[].link."@href"' | grep -Po '(?<=/)${releasePrefix}[^/]+${releaseSuffix}$' | head -n 1)
|
||||
|
||||
if [ "${releasePrefix}''${localBase}-''${localRelease}${releaseSuffix}" == "$latestVer" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
latestBase=$(echo $latestVer | grep -Po '(?<=^${releasePrefix})[^-]+')
|
||||
latestRelease=$(echo $latestVer | grep -Po '(?<=-)[^-]+(?=${releaseSuffix}$)')
|
||||
latestSha256=$(nix-prefetch-url --type sha256 "https://github.com/${owner}/${repo}/releases/download/''${latestVer}/${tarballPrefix}''${latestVer}${tarballSuffix}")
|
||||
latestHash=$(nix-hash --to-sri --type sha256 $latestSha256)
|
||||
|
||||
jq \
|
||||
--arg latestBase "$latestBase" --arg latestRelease "$latestRelease" --arg latestHash "$latestHash" \
|
||||
'.base = $latestBase | .release = $latestRelease | .hash = $latestHash' \
|
||||
"$srcJson" | sponge "$srcJson"
|
||||
|
||||
git add $srcJson
|
||||
git commit -m "${repo}: ''${localBase}.''${localRelease} -> ''${latestBase}.''${latestRelease}"
|
||||
''
|
||||
Reference in New Issue
Block a user