Files
ci-images/img/builder.nix
T
Greg Hellings 3adbc80cc6
Build images / Build (bitwarden) (push) Failing after 1m41s
Build images / Build (builder) (push) Failing after 0s
Build images / Build (immich) (push) Failing after 0s
Build images / Build (sword-container-builder) (push) Failing after 0s
Build images / Build (vm-test) (push) Failing after 0s
Build images in Gitea actions - pass 1
2025-12-29 19:47:30 -06:00

74 lines
1.3 KiB
Nix

{
bashInteractive,
buildah,
dockerTools,
git,
lib,
nix,
nix-output-monitor,
pkgs,
podman,
writeShellApplication,
name,
...
}:
let
policy = (
pkgs.writeTextFile {
name = "policy.json";
text = ''
{
"default": [{"type": "insecureAcceptAnything"}]
}
'';
destination = "/etc/containers/policy.json";
}
);
activate = writeShellApplication {
name = "activate";
runtimeInputs = [ bashInteractive ];
text = ''
mkdir -p /etc/containers
cp ${policy}/etc/containers/policy.json /etc/containers/policy.json;
bash "$@"
'';
};
in
(import "${nix.src.outPath}/docker.nix" {
inherit pkgs;
name = name "builder";
tag = "latest";
bundleNixpkgs = false;
Cmd = [
(lib.getExe activate)
];
extraPkgs = [
buildah
dockerTools.caCertificates
nix-output-monitor
podman
policy
];
flake-registry = (pkgs.formats.json { }).generate "flake-registry.json" ({
version = 2;
flakes.nixpkgs = {
exact = true;
from = {
id = "nixpkgs";
type = "indirect";
};
to = "${pkgs.path}";
};
});
gitMinimal = git; # We want the full version in this
maxLayers = 111;
nixConf = {
experimental-features = [
"nix-command"
"flakes"
];
};
})