summaryrefslogtreecommitdiff
path: root/modules/nixos/features/virtualisation.nix
blob: 2c9c5279d3850df84e2f36cf20b5f51cb43869ed (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.virtualisation;
in {
  options.features.virtualisation = {
    enable = lib.mkEnableOption "enable podman";
  };

  config.virtualisation = lib.mkIf cfg.enable {
    podman = {
      enable = true;
      enableNvidia = lib.mkDefault (config.hardware.nvidia.enable or false);
      extraPackages = with pkgs; [podman-compose];
      autoPrune.enable = true;
    };

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