techmino: add update script

This commit is contained in:
chayleaf 2024-08-04 03:51:48 +07:00
parent e54d9c2f7c
commit aed489629d
No known key found for this signature in database
GPG Key ID: 78171AD46227E68E
3 changed files with 12 additions and 9 deletions

View File

@ -13,7 +13,8 @@ stdenv.mkDerivation rec {
owner = "26F-Studio"; owner = "26F-Studio";
repo = "cold_clear_ai_love2d_wrapper"; repo = "cold_clear_ai_love2d_wrapper";
rev = version; rev = version;
hash = "sha256-zfTSMWqjFrAKW5m+9q3K2Je8bbSyhC6pC/vPAWDGCNg="; fetchSubmodules = true;
hash = "sha256-sguV+Dw+etZH43tXZYL46NAdsI/qvyvGWCPUiTEjhy4=";
}; };
buildInputs = [ libcoldclear luajit ]; buildInputs = [ libcoldclear luajit ];

View File

@ -1,6 +1,7 @@
{ lib { lib
, rustPlatform , rustPlatform
, fetchFromGitHub , fetchFromGitHub
, ccloader
}: }:
let let
@ -17,12 +18,7 @@ rustPlatform.buildRustPackage {
pname = "libcoldclear"; pname = "libcoldclear";
version = "0.1.0"; version = "0.1.0";
src = fetchFromGitHub { src = "${ccloader.src}/cold-clear";
owner = "26F-Studio";
repo = "cold-clear";
rev = "1564ce9ad14aa60f32bf9a5120594933b3501548";
hash = "sha256-6fZpKHEJ0dsOTp755GLnxa/befCUJhjqA3Zna5UkKVo=";
};
# remove workspace cargo.toml so we don't load all of workspace's deps # remove workspace cargo.toml so we don't load all of workspace's deps
postPatch = '' postPatch = ''

View File

@ -6,7 +6,9 @@
, makeDesktopItem , makeDesktopItem
, love , love
, luajit , luajit
, libcoldclear ? callPackage ./libcoldclear.nix { } , writeShellScript
, nix-update
, libcoldclear ? callPackage ./libcoldclear.nix { inherit ccloader; }
, ccloader ? callPackage ./ccloader.nix { inherit libcoldclear luajit; } , ccloader ? callPackage ./ccloader.nix { inherit libcoldclear luajit; }
}: }:
@ -39,7 +41,6 @@ stdenv.mkDerivation rec {
}; };
nativeBuildInputs = [ makeWrapper ]; nativeBuildInputs = [ makeWrapper ];
buildInputs = [ love ccloader ];
dontUnpack = true; dontUnpack = true;
@ -62,6 +63,11 @@ stdenv.mkDerivation rec {
passthru = { passthru = {
inherit ccloader libcoldclear; inherit ccloader libcoldclear;
updateScript = writeShellScript "update-script.sh" ''
if ${lib.getExe nix-update} techmino | grep "Packages updated"; then
${lib.getExe nix-update} techmino.ccloader
fi
'';
}; };
meta = with lib; { meta = with lib; {