mirror of
https://github.com/CHN-beta/nixos.git
synced 2026-01-12 06:49:24 +08:00
28 lines
971 B
Nix
28 lines
971 B
Nix
inputs:
|
|
{
|
|
options.nixos.services.podman = let inherit (inputs.lib) mkOption types; in mkOption
|
|
{ type = types.nullOr (types.submodule {}); default = null; };
|
|
config = let inherit (inputs.config.nixos.services) podman; in inputs.lib.mkIf (podman != null)
|
|
{
|
|
virtualisation =
|
|
{
|
|
containers =
|
|
{
|
|
enable = true;
|
|
containersConf.settings.network.firewall_driver = "nftables";
|
|
};
|
|
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;
|
|
extraPackages = [ inputs.pkgs.nftables ];
|
|
};
|
|
};
|
|
hardware.nvidia-container-toolkit.enable = inputs.lib.mkIf (inputs.config.nixos.system.nixpkgs.cuda != null) true;
|
|
networking.firewall.trustedInterfaces = [ "podman0" ];
|
|
};
|
|
}
|