From 15a093ff61bf0ee7614d810715ee7c57c782c183 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Wed, 12 Jan 2022 18:22:43 +0100 Subject: [PATCH] modules: system: add podman --- modules/system/default.nix | 1 + modules/system/podman/default.nix | 25 +++++++++++++++++++++++++ modules/system/users/default.nix | 1 + 3 files changed, 27 insertions(+) create mode 100644 modules/system/podman/default.nix diff --git a/modules/system/default.nix b/modules/system/default.nix index 5165e64..3c81cac 100644 --- a/modules/system/default.nix +++ b/modules/system/default.nix @@ -8,6 +8,7 @@ ./language ./nix ./packages + ./podman ./users ]; } diff --git a/modules/system/podman/default.nix b/modules/system/podman/default.nix new file mode 100644 index 0000000..c267ec6 --- /dev/null +++ b/modules/system/podman/default.nix @@ -0,0 +1,25 @@ +# Podman related settings +{ config, inputs, lib, options, pkgs, ... }: +let + cfg = config.my.system.podman; +in +{ + options.my.system.podman = with lib; { + enable = mkEnableOption "podman configuration"; + }; + + config = lib.mkIf cfg.enable { + virtualisation.podman = { + enable = true; + + # Use fake `docker` command to redirect to `podman` + dockerCompat = true; + + # Expose a docker-like socket + dockerSocket.enable = true; + + # Allow DNS resolution in the default network + defaultNetwork.dnsname.enable = true; + }; + }; +} diff --git a/modules/system/users/default.nix b/modules/system/users/default.nix index b36114f..3fa5b2e 100644 --- a/modules/system/users/default.nix +++ b/modules/system/users/default.nix @@ -30,6 +30,7 @@ in "media" # access to media files "networkmanager" # wireless configuration "plugdev" # usage of ZSA keyboard tools + "podman" # usage of `podman` socket "video" # screen control "wheel" # `sudo` for the user. ];