This repository has been archived on 2024-10-13. You can view files and clone it, but cannot push or open issues or pull requests.
nix-packages/scripts/clean-s3-cache.nix

32 lines
665 B
Nix
Raw Normal View History

2022-06-11 15:04:50 +01:00
{
2022-09-30 15:34:31 +01:00
python3,
boto3,
aiohttp,
2022-09-30 15:34:31 +01:00
stdenvNoCC,
lib,
}: let
2022-09-30 16:36:20 +01:00
clean-s3-cache-env = python3.buildEnv.override {
extraLibs = [boto3 aiohttp];
2022-06-11 13:55:50 +01:00
};
2022-09-30 16:37:09 +01:00
in
stdenvNoCC.mkDerivation {
2022-09-30 15:34:31 +01:00
name = "clean-s3-cache";
src = ./clean-s3-cache.py;
python = clean-s3-cache-env;
2022-09-30 15:34:31 +01:00
unpackPhase = ''
cp $src clean-s3-cache.py
'';
2022-06-11 13:55:50 +01:00
buildPhase = ''
substituteAllInPlace clean-s3-cache.py
2022-06-11 13:55:50 +01:00
'';
installPhase = ''
mkdir -p $out/bin
cp clean-s3-cache.py $out/bin
chmod +x $out/bin/clean-s3-cache.py
'';
2022-09-30 15:34:31 +01:00
meta = {
description = "Scriept for cleaning a nix s3 binary cache";
license = lib.licenses.bsd2;
};
2022-09-30 16:37:09 +01:00
}