{ config, pkgs, ... }:

{

  services = {
    # Enable the X11 windowing system
    xserver = {
      enable = true;     
      xkb.layout = "de";
      xkb.variant = "";
      xkb.options = "eurosign:e";
      exportConfiguration = true;
      enableCtrlAltBackspace = true;
      #wacom.enable = true;

      # Enable Lightdm
      displayManager = {
        lightdm.enable = true;
        lightdm.background = /etc/nixos/home/wallpaper/5120x2880.jpg;
        lightdm.greeters.slick.theme.name = "Arc-Dark";
        lightdm.greeters.slick.iconTheme.name = "Papirus-Dark";
        lightdm.greeters.slick.cursorTheme.name = "Numix-Cursor";
        lightdm.greeters.slick.extraConfig = "activate-numlock=true";
      };

      # Enable the Cinnamon Desktop Environment
      desktopManager = {
        xterm.enable = false;
        cinnamon.enable = true;
        };
      };

      displayManager.defaultSession = "cinnamon";
      #bamf.enable = true;
      libinput.enable = false;
    };

  # Enable Programs
  programs = {
    dconf.enable = true;
    geary.enable = false;
    system-config-printer.enable = true;
  };

  # Enable xdg portal
  xdg.portal = {
    enable = true;
    extraPortals = [ pkgs.xdg-desktop-portal-xapp ];
  };

  # Environment variables
  environment.variables = {
    EDITOR = "nano";
    BROWSER = "firefox";
    QT_QPA_PLATFORM = "xcb";
    #QT_QPA_PLATFORMTHEME = lib.mkForce "qt5ct";
  };

  environment.sessionVariables = rec {
    XDG_CACHE_HOME  = "$HOME/.cache";
    XDG_CONFIG_HOME = "$HOME/.config";
    XDG_DATA_HOME   = "$HOME/.local/share";
    XDG_STATE_HOME  = "$HOME/.local/state";
    XDG_BIN_HOME    = "$HOME/.local/bin";
    PATH = [ 
      "${XDG_BIN_HOME}"
    ];
  };

  environment.systemPackages = with pkgs; [
    conky
    clipit
    nemo-emblems
    nemo-with-extensions
    nemo-fileroller
    nemo-python
    bulky
    file-roller
    gnome-system-monitor
    gnome-disk-utility
    tilda
    system-config-printer
    # plank
    numlockx
  ];

  environment.cinnamon.excludePackages = with pkgs; [
    #nemo
    onboard
    hexchat
    xterm
  ];

  networking.firewall = {
   allowedTCPPorts = [
     42000  # Warpinator used for transfer
     42001  # Warpinator authentication port
   ];

   allowedUDPPorts = [
     42000  # Warpinator used for transfer
     42001  # Warpinator authentication port
   ];
  };

}
