{ config, lib, pkgs, namespace, ... }: let cfg = config.${namespace}.development; in { options.${namespace}.development = { enable = lib.mkEnableOption "Common development tools and packages"; includeLanguages = lib.mkOption { type = lib.types.listOf ( lib.types.enum [ "python" "c" "rust" "nodejs" ] ); default = [ "python" "c" ]; description = "Programming languages to include tools for"; }; includeContainers = lib.mkOption { type = lib.types.bool; default = false; description = "Include container development tools"; }; }; config = lib.mkIf cfg.enable { environment.systemPackages = with pkgs; [ # Version control git # Build tools cmake ninja binutils # System utilities jq # Text processing ] ++ lib.optionals (builtins.elem "python" cfg.includeLanguages) [ python3 python3Packages.pip ] ++ lib.optionals (builtins.elem "c" cfg.includeLanguages) [ gcc gdb ] ++ lib.optionals (builtins.elem "rust" cfg.includeLanguages) [ rustc cargo ] ++ lib.optionals (builtins.elem "nodejs" cfg.includeLanguages) [ nodejs npm ] ++ lib.optionals cfg.includeContainers [ docker-compose podman-compose ]; # Enable container support if requested virtualisation.podman = lib.mkIf cfg.includeContainers { enable = true; dockerCompat = true; autoPrune.enable = true; defaultNetwork.settings = { dns_enabled = true; }; }; }; }