You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
cryptic-net/release.nix

50 lines
1.1 KiB

{
releaseName,
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;
}).appImage;
in pkgs.stdenv.mkDerivation {
name = "cryptic-net-release-${hostSystem}";
inherit releaseName appImage hostSystem;
builder = builtins.toFile "build.sh" ''
source $stdenv/setup
mkdir -p "$out"/
cp "$appImage"/bin/cryptic-net "$out"/cryptic-net-$releaseName-$hostSystem
'';
};
releases = builtins.map mkRelease supportedSystems;
in
pkgs.stdenv.mkDerivation {
name = "cryptic-net-release-${releaseName}";
inherit releases;
nativeBuildInputs = [ pkgs.coreutils ];
builder = builtins.toFile "build.sh" ''
source $stdenv/setup
mkdir -p "$out"
for p in $releases; do
cp "$p"/cryptic-net-* "$out"/
done
(cd "$out" && sha256sum * > sha256.txt)
'';
}