Add podman to deck
This commit is contained in:
73
users/deck/podman.nix
Normal file
73
users/deck/podman.nix
Normal file
@@ -0,0 +1,73 @@
|
||||
{pkgs, config, ...}: let
|
||||
PODMAN_VERSION = "4.5.1";
|
||||
podman-static = pkgs.stdenv.mkDerivation {
|
||||
name = "podman-static";
|
||||
src = pkgs.fetchzip {
|
||||
url = "https://github.com/mgoltzsche/podman-static/releases/download/v${PODMAN_VERSION}/podman-linux-amd64.tar.gz";
|
||||
hash = "sha256-66eReaToPuusoQI+Ooh+3bKQi39dA46etwX9REwApRc=";
|
||||
};
|
||||
|
||||
runtimeDependencies = with pkgs; [
|
||||
conmon
|
||||
crun
|
||||
slirp4netns
|
||||
fuse-overlayfs
|
||||
];
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out
|
||||
cp -r usr/local/bin $out
|
||||
cp -r usr/local/lib $out
|
||||
cp -r etc $out
|
||||
rm $out/etc/containers/containers.conf
|
||||
|
||||
substituteInPlace $out/etc/containers/storage.conf \
|
||||
--replace "/var" "${config.home.homeDirectory}/.local/share"
|
||||
|
||||
sed -i "s|mount_program =.*|mount_program = \"${pkgs.fuse-overlayfs}/bin/fuse-overlayfs\"|g" \
|
||||
"$out/etc/containers/storage.conf"
|
||||
'';
|
||||
|
||||
};
|
||||
|
||||
dest_path = ".local/podman";
|
||||
|
||||
configuration = ''
|
||||
# See https://github.com/containers/common/blob/master/pkg/config/containers.conf
|
||||
[engine]
|
||||
infra_image="k8s.gcr.io/pause:3.8"
|
||||
# can be croupfs, systemd
|
||||
cgroup_manager = "systemd"
|
||||
# can be file, journald
|
||||
events_logger="file"
|
||||
exit_command_delay = 10
|
||||
# can be runc, crun
|
||||
runtime = "crun"
|
||||
stop_timeout = 5
|
||||
conmon_path = [ "${pkgs.conmon}/bin/conmon" ]
|
||||
helper_binaries_dir = [ "${podman-static}/lib/podman" ]
|
||||
static_dir = "${config.home.homeDirectory}/.local/share/containers/storage/libpod"
|
||||
volume_path = "${config.home.homeDirectory}/local/share/containers/storage/volumes"
|
||||
[engine.runtimes]
|
||||
crun = [ "${pkgs.crun}/bin/crun" ]
|
||||
[network]
|
||||
cni_plugin_dirs = [ "${podman-static}/lib/cni" ]
|
||||
'';
|
||||
|
||||
conf_path = ".config/containers";
|
||||
|
||||
in
|
||||
{
|
||||
home.packages = [
|
||||
podman-static
|
||||
pkgs.podman-compose
|
||||
];
|
||||
|
||||
home.file = {
|
||||
"${conf_path}" = {
|
||||
source = "${podman-static}/etc/containers";
|
||||
recursive = true;
|
||||
};
|
||||
"${conf_path}/containers.conf".text = configuration;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user