nixconf/modules/nixos/containers/default.nix

38 lines
627 B
Nix
Raw Normal View History

2024-01-15 22:30:41 +00:00
{ config
, lib
, options
, pkgs
, ...
}:
let
inherit (lib) types;
cfg = config.mtxyz.containers;
in
{
options.mtxyz.podman = {
enable = lib.mkOption {
type = types.bool;
default = false;
};
};
config = lib.mkIf cfg.enable {
environment.systemPackages = with pkgs; [
podman-compose
];
virtualisation.podman = {
enable = true;
dockerSocket.enable = true;
dockerCompat = true;
defaultNetwork.settings = {
dns_enabled = true;
};
};
systemd.services."user@".serviceConfig = {
Delegate= "cpu cpuset io memory pids";
};
};
}