summaryrefslogtreecommitdiff
path: root/modules/nixos/features/containers.nix
blob: 290f7b0432082930851a1378d618626b5806705f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
{
  config,
  lib,
  pkgs,
  ...
}: let
  cfg = config.features.containers;
in {
  options.features.containers = {
    enable = lib.mkEnableOption "containers support";
  };

  config.virtualisation = lib.mkIf cfg.enable {
    podman = {
      enable = true;
      enableNvidia = lib.mkDefault (builtins.elem "nvidia" (config.services.xserver.videoDrivers or []));
      extraPackages = with pkgs; [podman-compose];
      autoPrune.enable = true;
    };

    oci-containers.backend = "podman";
  };
}