{ pkgs, ... }:

{
  imports = [
    # Import hardware configuration
    ./hardware-configuration.nix

    # Import modules
    ../../modules/system
  ];

  settings = {
    hostname = "ti-clt-lpt01";
    display-manager = "cosmic-greeter";
    desktop-environments = {
      cosmic.enable = true;
      hyprland.enable = true;
      gnome.enable = false;
    };
    applications = {
      common.enable = true;
      steam.enable = true;
      thunar.enable = true;
    };
    services = {
      docker.enable = false;
      quickemu.enable = true;
      sunshine.enable = false;
      garbage-collection.enable = true;
      incus.enable = true;
    };
    hardware = {
      fprint.enable = true;
      printing.enable = true;
      bluetooth.enable = true;
      firewall.enable = true;
      locale.enable = true;
      nvidia.enable = false;
    };
  };

  # Users
  users.users.xeovalyte = {
    isNormalUser = true;
    description = "Timo Boomers";
    extraGroups = [ "networkmanager" "wheel" "dialout" ];
  };
  
  # Boot.
  boot.loader.efi.canTouchEfiVariables = true;
  boot.loader.grub = {
    enable = true;
    efiSupport = true;
    device = "nodev";
    configurationLimit = 32;
  };
  boot.kernelPackages = pkgs.linuxPackages_latest;
  boot.supportedFilesystems = [ "nfs" ];

  # Networking
  networking.hosts = {
    "127.0.0.1" = [
      "tbmrs.nl"
      "auth.tbmrs.nl"
      "git.tbmrs.nl"
      "photos.tbmrs.nl"
      "home.tbmrs.nl"
      "uptime.tbmrs.nl"
      "share.tbmrs.nl"
      "vault.local.tbmrs.nl"
      "paperless.local.tbmrs.nl"
      "monitor.local.tbmrs.nl"
    ];
  };

  # Create samba share
  services.samba = {
    enable = true;
    securityType = "user";
    openFirewall = true;
    settings = {
      "public" = {
        "path" = "/home/xeovalyte/Public";
        "browseable" = "yes";
        "read only" = "no";
        "guest ok" = "yes";
        "create mask" = "0644";
        "directory mask" = "0755";
        "force user" = "xeovalyte";
        "force group" = "xeovalyte";
      };
    };
  };

  services.samba-wsdd = {
    enable = true;
    openFirewall = true;
  };

  networking.firewall = {
    enable = true;
    allowedTCPPorts = [ 22 80 443 53 ];
    allowedUDPPorts = [ 80 443 53 ];
  };

  # Obs
  programs.obs-studio = {
    enable = true;

    # optional Nvidia hardware acceleration
    package = (
      pkgs.obs-studio.override {
        cudaSupport = true;
      }
    );

    plugins = with pkgs.obs-studio-plugins; [
      wlrobs
      obs-vaapi #optional AMD hardware acceleration
      obs-gstreamer
      obs-vkcapture
    ];
  };

  system.stateVersion = "24.05";
}
