27 lines
536 B
Nix
27 lines
536 B
Nix
{
|
|
pkgs,
|
|
lib,
|
|
config,
|
|
...
|
|
}:
|
|
with lib;
|
|
let
|
|
cfg = config.global.oci;
|
|
in
|
|
{
|
|
options.global.oci = {
|
|
enable = mkEnableOption "oci container runtime";
|
|
};
|
|
|
|
config = mkIf cfg.enable {
|
|
virtualisation.podman = {
|
|
enable = true;
|
|
enableNvidia = with config.global.gpu; mkDefault type == "prime" || type == "nvidia";
|
|
dockerCompat = true;
|
|
};
|
|
|
|
users.home.persist.directories = [ ".local/share/containers" ];
|
|
environment.persistence."/nix/persist/fhs".directories = [ "/var/lib/containers" ];
|
|
};
|
|
}
|