Skip to content

Commit

Permalink
Switch to new version of containers/skopeo#2277
Browse files Browse the repository at this point in the history
  • Loading branch information
Atry committed Apr 3, 2024
1 parent bb2014a commit 5f75419
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 21 deletions.
26 changes: 12 additions & 14 deletions flake-modules/kubernetes.nix
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,15 @@ topLevel@{ flake-parts-lib, inputs, lib, ... }: {
];
options.perSystem = flake-parts-lib.mkPerSystemOption (
perSystem@{ pkgs, system, inputs', ... }: {
packages.skopeo-nix2container = inputs'.nix2container.packages.skopeo-nix2container.overrideAttrs (old: {
patches = old.patches or [ ] ++ [
(pkgs.fetchpatch {
# Add --image-parallel-copies flag
url = "https://github.com/Atry/skopeo/commit/db8701ceb6c88da8def345d539e67c27e026a04b.patch";
hash = "sha256-VTG/uf2yw+AiGHgyjKHkrFoEO+0Ne9wtjICmBomTHss=";
})
];
});
ml-ops.runtime = runtime: {
config.launcher = launcher: {
options.kubernetes = lib.mkOption {
Expand Down Expand Up @@ -201,26 +210,15 @@ topLevel@{ flake-parts-lib, inputs, lib, ... }: {
default = [ ];
};
config.base-package =
let
skopeo-nix2container = inputs.nix2container.packages.${system}.skopeo-nix2container.overrideAttrs (old: {
patches = old.patches or [ ] ++ [
(pkgs.fetchpatch {
# Add --max-parallel-downloads flag
url = "https://github.com/Atry/skopeo/commit/98312aa4a3137728162d12706e621a4cb5b35787.patch";
hash = "sha256-wXO5FovWLe4Ghaq10NPDkfnJPYp8hBz0M1Zk51Lq/gw=";
})
];
});
in
pkgs.writeShellScriptBin
"${runtime.config._module.args.name}-push-image-to-registry.sh"
''
read -a skopeoCopyArgsArray <<< "$SKOPEO_ARGS"
${lib.escapeShellArgs [
"${skopeo-nix2container}/bin/skopeo"
"${perSystem.config.packages.skopeo-nix2container}/bin/skopeo"
"--insecure-policy"
"copy"
"--max-parallel-downloads"
"--image-parallel-copies"
"64"
]} \
${
Expand Down Expand Up @@ -458,7 +456,7 @@ topLevel@{ flake-parts-lib, inputs, lib, ... }: {
ml-ops.devcontainer.devenvShellModule = {
packages = [
pkgs.kubectl
inputs'.nix2container.packages.skopeo-nix2container
perSystem.config.packages.skopeo-nix2container
];
};
}
Expand Down
11 changes: 5 additions & 6 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
url = "github:rrbutani/nix-mk-shell-bin";
};
nix2container = {
url = "github:Atry/nix2container/max-parallel-downloads-64";
url = "github:nlewo/nix2container";
inputs.nixpkgs.follows = "nixpkgs";
};
nixos-generators = {
Expand Down

0 comments on commit 5f75419

Please sign in to comment.