isle/release.nix

52 lines
1.1 KiB
Nix
Raw Normal View History

2023-03-25 14:58:20 +00:00
{
releaseName,
revision,
2023-03-25 14:58:20 +00:00
buildSystem ? builtins.currentSystem,
pkgsNix ? (import ./nix/pkgs.nix),
supportedSystems ? pkgsNix.supportedSystems,
}: let
pkgs = pkgsNix.default { inherit buildSystem; };
mkRelease = hostSystem: let
appImage = ((import ./default.nix) {
inherit buildSystem hostSystem releaseName revision;
2023-03-25 14:58:20 +00:00
}).appImage;
in pkgs.stdenv.mkDerivation {
name = "isle-release-${hostSystem}";
2023-03-25 14:58:20 +00:00
inherit releaseName appImage hostSystem;
builder = builtins.toFile "build.sh" ''
source $stdenv/setup
mkdir -p "$out"/
cp "$appImage"/bin/isle "$out"/isle-$releaseName-$hostSystem
2023-03-25 14:58:20 +00:00
'';
};
releases = builtins.map mkRelease supportedSystems;
in
pkgs.stdenv.mkDerivation {
name = "isle-release-${releaseName}";
2023-03-25 14:58:20 +00:00
inherit releases;
nativeBuildInputs = [ pkgs.coreutils ];
builder = builtins.toFile "build.sh" ''
source $stdenv/setup
mkdir -p "$out"
for p in $releases; do
cp "$p"/isle-* "$out"/
2023-03-25 14:58:20 +00:00
done
(cd "$out" && sha256sum * > sha256.txt)
'';
}