isle/release.nix

57 lines
1.2 KiB
Nix
Raw Normal View History

2023-03-25 14:58:20 +00:00
{
releaseName ? "dev",
buildNumber ? "1",
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
build = ((import ./default.nix) {
inherit buildSystem hostSystem releaseName buildNumber;
}).build;
2023-03-25 14:58:20 +00:00
in pkgs.stdenv.mkDerivation {
name = "isle-release-${hostSystem}";
inherit releaseName buildNumber hostSystem;
appImage = build.appImage;
archPkg = build.archPkg;
2024-12-20 11:49:01 +00:00
debPkg = build.debPkg;
2023-03-25 14:58:20 +00:00
builder = builtins.toFile "build.sh" ''
source $stdenv/setup
mkdir -p "$out"/
cp "$appImage"/bin/isle "$out"/isle-$releaseName-$buildNumber-$hostSystem.AppImage
2024-12-20 11:49:01 +00:00
cp "$archPkg"/* "$out"/
cp "$debPkg"/* "$out"/
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"/* "$out"/
2023-03-25 14:58:20 +00:00
done
(cd "$out" && sha256sum * > sha256.txt)
'';
}