Add builder image
This commit is contained in:
+2
-1
@@ -1,4 +1,4 @@
|
||||
{ pkgs, ... }:
|
||||
{ pkgs, top, ... }:
|
||||
|
||||
let
|
||||
c = pkgs.callPackage;
|
||||
@@ -16,6 +16,7 @@ in
|
||||
inject-darwin = c ./inject-darwin.nix { };
|
||||
inject = c ./inject.nix { };
|
||||
img-bitwarden = c ./img-bitwarden.nix { };
|
||||
img-builder = c ./img-builder.nix { inherit top; };
|
||||
img-immich = c ./img-immich.nix { };
|
||||
qemu-hook = c ./qemu-hook.nix { };
|
||||
setup-ssh = c ./setup-ssh { };
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
{
|
||||
bashInteractive,
|
||||
dockerTools,
|
||||
git,
|
||||
lib,
|
||||
nix,
|
||||
pkgs,
|
||||
podman,
|
||||
top,
|
||||
writeShellApplication,
|
||||
...
|
||||
}:
|
||||
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 = "img-builder";
|
||||
tag = "latest";
|
||||
|
||||
bundleNixpkgs = false;
|
||||
Cmd = [
|
||||
(lib.getExe activate)
|
||||
];
|
||||
extraPkgs = [
|
||||
dockerTools.caCertificates
|
||||
podman
|
||||
];
|
||||
flake-registry = (pkgs.formats.json { }).generate "flake-registry.json" ({
|
||||
version = 2;
|
||||
flakes.nixpkgs = {
|
||||
exact = true;
|
||||
from = {
|
||||
id = "nixpkgs";
|
||||
type = "indirect";
|
||||
};
|
||||
to = "${top.nixunstable}";
|
||||
};
|
||||
});
|
||||
gitMinimal = git; # We want the full version in this
|
||||
maxLayers = 111;
|
||||
nixConf = {
|
||||
experimental-features = [
|
||||
"nix-command"
|
||||
"flakes"
|
||||
];
|
||||
};
|
||||
})
|
||||
Reference in New Issue
Block a user