[nix-improvements] use kaniko and manifest-tools from nixpkgs, simplify

This commit is contained in:
Alex 2024-02-09 11:15:52 +01:00
parent 9900368380
commit d35d4599de
Signed by untrusted user: lx
GPG key ID: 0E496D15096376BE
4 changed files with 2 additions and 83 deletions

View file

@ -1,24 +0,0 @@
pkgs:
pkgs.buildGoModule rec {
pname = "kaniko";
version = "1.9.2";
src = pkgs.fetchFromGitHub {
owner = "GoogleContainerTools";
repo = "kaniko";
rev = "v${version}";
sha256 = "dXQ0/o1qISv+sjNVIpfF85bkbM9sGOGwqVbWZpMWfMY=";
};
vendorSha256 = null;
checkPhase = "true";
meta = with pkgs.lib; {
description =
"kaniko is a tool to build container images from a Dockerfile, inside a container or Kubernetes cluster.";
homepage = "https://github.com/GoogleContainerTools/kaniko";
license = licenses.asl20;
platforms = platforms.linux;
};
}

View file

@ -1,24 +0,0 @@
pkgs:
pkgs.buildGoModule rec {
pname = "manifest-tool";
version = "2.0.5";
src = pkgs.fetchFromGitHub {
owner = "estesp";
repo = "manifest-tool";
rev = "v${version}";
sha256 = "hjCGKnE0yrlnF/VIzOwcDzmQX3Wft+21KCny/opqdLg=";
} + "/v2";
vendorSha256 = null;
checkPhase = "true";
meta = with pkgs.lib; {
description =
"Command line tool to create and query container image manifest list/indexes";
homepage = "https://github.com/estesp/manifest-tool";
license = licenses.asl20;
platforms = platforms.linux;
};
}

View file

@ -1,11 +0,0 @@
{ system ? builtins.currentSystem, }:
with import ./common.nix;
let
pkgsHost = import pkgsSrc { };
kaniko = (import ./kaniko.nix) pkgsHost;
winscp = (import ./winscp.nix) pkgsHost;
manifestTool = (import ./manifest-tool.nix) pkgsHost;
in [ kaniko winscp manifestTool ]

View file

@ -6,8 +6,6 @@ let
pkgs = import pkgsSrc { pkgs = import pkgsSrc {
inherit system; inherit system;
}; };
kaniko = (import ./nix/kaniko.nix) pkgs;
manifest-tool = (import ./nix/manifest-tool.nix) pkgs;
winscp = (import ./nix/winscp.nix) pkgs; winscp = (import ./nix/winscp.nix) pkgs;
in in
{ {
@ -18,10 +16,10 @@ in
# The shell used for all CI jobs (along with devShell) # The shell used for all CI jobs (along with devShell)
ci = pkgs.mkShell { ci = pkgs.mkShell {
nativeBuildInputs = with pkgs; [ nativeBuildInputs = with pkgs; [
kaniko
manifest-tool
winscp winscp
kaniko
manifest-tool
awscli2 awscli2
file file
s3cmd s3cmd
@ -123,15 +121,6 @@ in
# A shell for refreshing caches # A shell for refreshing caches
cache = pkgs.mkShell { cache = pkgs.mkShell {
shellHook = '' shellHook = ''
function refresh_toolchain {
pass show deuxfleurs/nix_priv_key > /tmp/nix-signing-key.sec
nix copy -j8 \
--to 's3://nix?endpoint=garage.deuxfleurs.fr&region=garage&secret-key=/tmp/nix-signing-key.sec' \
$(nix-store -qR \
$(nix-build -j8 --no-build-output --no-out-link nix/toolchain.nix))
rm /tmp/nix-signing-key.sec
}
function refresh_cache { function refresh_cache {
pass show deuxfleurs/nix_priv_key > /tmp/nix-signing-key.sec pass show deuxfleurs/nix_priv_key > /tmp/nix-signing-key.sec
for attr in clippy.amd64 test.amd64 pkgs.{amd64,i386,arm,arm64}.release; do for attr in clippy.amd64 test.amd64 pkgs.{amd64,i386,arm,arm64}.release; do
@ -143,17 +132,6 @@ in
done done
rm /tmp/nix-signing-key.sec rm /tmp/nix-signing-key.sec
} }
function refresh_flake_cache {
pass show deuxfleurs/nix_priv_key > /tmp/nix-signing-key.sec
for attr in packages.x86_64-linux.default devShells.x86_64-linux.default; do
echo "Updating cache for ''${attr}"
nix copy -j8 \
--to 's3://nix?endpoint=garage.deuxfleurs.fr&region=garage&secret-key=/tmp/nix-signing-key.sec' \
".#''${attr}"
done
rm /tmp/nix-signing-key.sec
}
''; '';
}; };
} }