nixos/global/oci/default.nix

27 lines
536 B
Nix
Raw Normal View History

2025-01-13 11:52:09 +08:00
{
pkgs,
lib,
config,
...
}:
with lib;
let
2024-01-11 13:59:55 +08:00
cfg = config.global.oci;
2025-01-13 11:52:09 +08:00
in
{
2024-01-11 13:59:55 +08:00
options.global.oci = {
enable = mkEnableOption "oci container runtime";
};
config = mkIf cfg.enable {
virtualisation.podman = {
enable = true;
2024-01-27 22:14:03 +08:00
enableNvidia = with config.global.gpu; mkDefault type == "prime" || type == "nvidia";
2024-01-11 13:59:55 +08:00
dockerCompat = true;
};
users.home.persist.directories = [ ".local/share/containers" ];
2024-02-02 07:33:48 +08:00
environment.persistence."/nix/persist/fhs".directories = [ "/var/lib/containers" ];
2024-01-11 13:59:55 +08:00
};
}