pinwheel: Add enable option for podman

This commit is contained in:
Alexander Heldt
2023-10-02 22:56:31 +02:00
parent eef533741f
commit 6c2a356b51
2 changed files with 26 additions and 12 deletions

View File

@@ -143,6 +143,7 @@
openvpn.enable = true;
go.enable = true;
keyboard.enable = true;
podman.enable = false;
};
# This value determines the NixOS release from which the default

View File

@@ -1,18 +1,31 @@
{ pkgs, ... }:
{ pkgs, lib, config, ... }:
let
enabled = config.mod.podman.enable;
in
{
virtualisation = {
podman = {
enable = true;
# Create a `docker` alias for podman, to use it as a drop-in replacement
dockerCompat = true;
# Required for containers under podman-compose to be able to talk to each other.
defaultNetwork.settings.dns_enabled = true;
options = {
mod.podman = {
enable = lib.mkEnableOption "enable podman module";
};
};
home-manager.users.alex = {
home.packages = [ pkgs.podman-compose ];
config = lib.mkIf enabled {
virtualisation = {
podman = {
enable = true;
# Create a `docker` alias for podman, to use it as a drop-in replacement
dockerCompat = true;
# Required for containers under podman-compose to be able to talk to each other.
defaultNetwork.settings = {
dns_enabled = true;
};
};
};
home-manager.users.alex = {
home.packages = [ pkgs.podman-compose ];
};
};
}