{ config, pkgs, ... }:
let
    hasGui = config.services.dbus.implementation == "dbus";
    dotnet-combined = (with pkgs.dotnetCorePackages; combinePackages [
      sdk_8_0
      sdk_10_0
    ]).overrideAttrs (finalAttrs: previousAttrs: {
      # This is needed to install workload in $HOME
      # https://discourse.nixos.org/t/dotnet-maui-workload/20370/2

      postBuild = (previousAttrs.postBuild or '''') + ''

        for i in $out/sdk/*
        do
          i=$(basename $i)
          mkdir -p $out/metadata/workloads/''${i/-*}
          touch $out/metadata/workloads/''${i/-*}/userlocal
        done
      '';
    });
in
{
    environment.sessionVariables.DOTNET_ROOT = "${dotnet-combined}";
    environment.systemPackages = with pkgs; [
        # Languages
        nodejs
        python3
        go
        just
        nodejs
        gcc

        # Distrobox
        distrobox
        distrobox-tui
    ] ++ (if hasGui then with pkgs; [
        wireshark
        kontainer
    ] else []);
}
