From 263e5c08a399edffce8ba60ac4d694c2e3e8d5b0 Mon Sep 17 00:00:00 2001 From: pazpi Date: Sun, 15 Feb 2026 23:20:55 +0100 Subject: [PATCH] Fix docker and podman module (also enable podman in colmena for dev) --- hosts/colmena/default.nix | 9 ++++++++- hosts/docker/default.nix | 1 + modules/utils/server-node-users.nix | 2 +- modules/virtualisation/docker.nix | 7 ++----- modules/virtualisation/podman.nix | 19 ++++++++++++++++--- 5 files changed, 28 insertions(+), 10 deletions(-) diff --git a/hosts/colmena/default.nix b/hosts/colmena/default.nix index 55fcb5b..0661433 100644 --- a/hosts/colmena/default.nix +++ b/hosts/colmena/default.nix @@ -32,13 +32,20 @@ in lxc-standard.enable = true; }; - virtualisation.proxmox.enable = true; + virtualisation = { + proxmox.enable = true; + podman.enable = true; + }; }; programs = { nix-ld.enable = true; }; + environment.systemPackages = with pkgs; [ + just-lsp + ]; + home-manager = { useGlobalPkgs = true; useUserPackages = true; diff --git a/hosts/docker/default.nix b/hosts/docker/default.nix index 9f7dc74..a4b0b00 100644 --- a/hosts/docker/default.nix +++ b/hosts/docker/default.nix @@ -14,6 +14,7 @@ virtualisation = { proxmox.enable = true; + docker.enable = true; }; }; diff --git a/modules/utils/server-node-users.nix b/modules/utils/server-node-users.nix index 0a9c7fb..753ebf5 100644 --- a/modules/utils/server-node-users.nix +++ b/modules/utils/server-node-users.nix @@ -32,7 +32,7 @@ in isNormalUser = true; hashedPassword = "$y$j9T$oWLCV1hnGPyOGabMfAS3p1$/iwouRZGwQXcv6IHnLuT3I9.pmeXNpcHxq.b8xfitr1"; shell = pkgs.bash; - extraGroups = [ "wheel" ]; + extraGroups = [ "wheel" ] ++ lib.optionals config.virtualisation.docker.enable [ "docker" ]; openssh.authorizedKeys.keys = sshKeys.infra-core; }; diff --git a/modules/virtualisation/docker.nix b/modules/virtualisation/docker.nix index dccd6f2..dfebbbe 100644 --- a/modules/virtualisation/docker.nix +++ b/modules/virtualisation/docker.nix @@ -14,13 +14,10 @@ in config = lib.mkIf cfg.enable { virtualisation = { - docker = { - storageDriver = "overlay2"; - }; - + docker.enable = true; oci-containers.backend = "docker"; - }; + }; } diff --git a/modules/virtualisation/podman.nix b/modules/virtualisation/podman.nix index 5966847..b4d7b91 100644 --- a/modules/virtualisation/podman.nix +++ b/modules/virtualisation/podman.nix @@ -13,15 +13,28 @@ in }; config = lib.mkIf cfg.enable { + # Enable common container config files in /etc/containers + virtualisation.containers.enable = true; virtualisation = { - podman = { enable = true; - }; - oci-containers.backend = "podman"; + # Create a `docker` alias for podman, to use it as a drop-in replacement + dockerCompat = true; + + # Required for containers under podman-compose to be able to talk to each other. + defaultNetwork.settings.dns_enabled = true; + }; }; + # Useful other development tools + environment.systemPackages = with pkgs; [ + dive # look into docker image layers + podman-tui # status of containers in the terminal + docker-compose # start group of containers for dev + podman-compose # start group of containers for dev + ]; + # Depending on the host filesystem # virtualisation.containers.storage.settings = { # storage = {