Fix how revision is embedded so that AppImage isn't always recompiled

This commit is contained in:
Brian Picciano 2023-08-30 18:24:09 +02:00
parent e66f67da4a
commit 2876b56afb
3 changed files with 6 additions and 8 deletions

View File

@ -4,7 +4,7 @@
hostSystem ? buildSystem,
pkgsNix ? (import ./nix/pkgs.nix),
revision ? "",
revision ? "dev",
releaseName ? "dev",
bootstrap ? null,
@ -28,7 +28,6 @@ in rec {
name = "isle-version";
inherit buildSystem hostSystem revision releaseName;
repoSrc = ./.;
nativeBuildInputs = [ pkgsNative.git ];
@ -41,11 +40,6 @@ in rec {
versionFile=version
if [ "$revision" = "" ]; then
cp -r "$repoSrc" repoSrcCp
revision="$(cd repoSrcCp && git rev-parse HEAD)"
fi
echo "Release: $releaseName" >> "$versionFile"
echo "Platform: $hostSystem" >> "$versionFile"
echo "Git Revision: $revision" >> "$versionFile"

View File

@ -1,5 +1,6 @@
{
releaseName,
revision,
buildSystem ? builtins.currentSystem,
pkgsNix ? (import ./nix/pkgs.nix),
@ -12,7 +13,7 @@
mkRelease = hostSystem: let
appImage = ((import ./default.nix) {
inherit buildSystem hostSystem releaseName;
inherit buildSystem hostSystem releaseName revision;
}).appImage;
in pkgs.stdenv.mkDerivation {

View File

@ -19,7 +19,10 @@ if [ -e "$out" ]; then
exit 1
fi
revision=$(git rev-parse HEAD)
result=$(nix-build \
--argstr revision "$revision" \
--argstr releaseName "$releaseName" \
--no-out-link \
release.nix \