nix-config/nixos/_mixins/virt/podman.nix

39 lines
956 B
Nix
Raw Normal View History

2023-10-16 18:46:06 +00:00
{ config, desktop, lib, pkgs, ... }:
#let
# dockerEnabled = config.virtualisation.docker.enable;
#in
2023-10-16 18:46:06 +00:00
{
imports = lib.optional (builtins.isString desktop) ./desktop.nix;
2023-10-16 18:46:06 +00:00
#https://nixos.wiki/wiki/Podman
2023-10-16 18:46:06 +00:00
environment.systemPackages = with pkgs; [
buildah
distrobox
fuse-overlayfs
2023-10-16 18:46:06 +00:00
podman-compose
podman-tui
];
virtualisation = {
podman = {
defaultNetwork.settings = {
dns_enabled = true;
};
dockerCompat = true; #!dockerEnabled;
#dockerSocket.enable = !dockerEnabled;
enable = true;
enableNvidia = lib.elem "nvidia" config.services.xserver.videoDrivers;
};
2023-10-16 18:46:06 +00:00
};
# virtualisation.oci-containers.backend = lib.mkIf (!dockerEnabled) "podman";
2023-10-16 18:46:06 +00:00
# environment.extraInit = lib.mkIf (!dockerEnabled)
# ''
# if [ -z "$DOCKER_HOST" -a -n "$XDG_RUNTIME_DIR" ]; then
# export DOCKER_HOST="unix://$XDG_RUNTIME_DIR/podman/podman.sock"
# fi
# '';
2023-10-16 18:46:06 +00:00
}