{
  config,
  lib,
  pkgs,
  inputs,
  ...
}: {
  networking.hostName = "HACKSTATION";

  # Enable nix-ld to run unpatched binaries
  programs.nix-ld.enable = true;
  programs.nix-ld.libraries = with pkgs; [
    stdenv.cc.cc
    zlib
    libusb1
  ];

  # Add Samsung USB udev rules
  services.udev.extraRules = ''
    SUBSYSTEM=="usb", ATTR{idVendor}=="04e8", MODE="0666", GROUP="plugdev"
  '';

  hardware.amdgpu.initrd.enable = true;

  # Opengl and vulkan
  hardware.graphics = {
    enable = true;
    extraPackages = with pkgs; [
      libva-vdpau-driver
      libvdpau-va-gl
    ];
    enable32Bit = true;
  };

  hardware.amdgpu.opencl.enable = true;

  boot.kernelParams = [
    "amdgpu.ppfeaturemask=0xffffffff"
  ];

  # Wake on Lan
  networking.interfaces.enp5s0.wakeOnLan.enable = true;
  networking.firewall.enable = false;

  systemd.services.NetworkManager-wait-online.enable = false;

  services.displayManager = {
    autoLogin.enable = true;
    autoLogin.user = "user01";
    sddm = {
      enable = true;
    };
  };

  # Pipewire stuff
  services.pipewire.extraConfig.pipewire."97-null-sink" = {
    "context.objects" = [
      {
        factory = "adapter";
        args = {
          "factory.name" = "support.null-audio-sink";
          "node.name" = "Null-Sink";
          "node.description" = "Null Sink";
          "media.class" = "Audio/Sink";
          "audio.position" = "FL,FR";
        };
      }
      {
        factory = "adapter";
        args = {
          "factory.name" = "support.null-audio-sink";
          "node.name" = "Null-Source";
          "node.description" = "Null Source";
          "media.class" = "Audio/Source";
          "audio.position" = "FL,FR";
        };
      }
    ];
  };
  services.pipewire.extraConfig.pipewire."98-virtual-mic" = {
    "context.modules" = [
      {
        name = "libpipewire-module-loopback";
        args = {
          "audio.position" = "FL,FR";
          "node.description" = "Mumble as Microphone";
          "capture.props" = {
            # Mumble's output node name.
            "node.target" = "Mumble";
            "node.passive" = true;
          };
          "playback.props" = {
            "node.name" = "Virtual-Mumble-Microphone";
            "media.class" = "Audio/Source";
          };
        };
      }
    ];
  };

  # Mumble server
  services.murmur = {
    enable = true;
    bandwidth = 540000;
    bonjour = true;
    password = "mumblepass";
    autobanTime = 0;
  };

  # Local User
  users.users.user01 = {
    extraGroups = [
      "docker"
      "input"
      "udev"
      "wheel"
    ];
    packages = with pkgs; [
      bottles
      mumble
      gajim
      ferdium
      delfin
      docker
      orca-slicer
      ffmpeg
      inputs.norgolith.packages.${pkgs.stdenv.hostPlatform.system}.default
      inputs.cracked-davinci.packages.${pkgs.stdenv.hostPlatform.system}.default
      inputs.woomer.packages.${pkgs.stdenv.hostPlatform.system}.default

      # wine
      wineWow64Packages.stable
      winetricks
      wine
      wine64
      freetype
    ];
  };

  environment.systemPackages = [
    inputs.sls-steam.packages.${pkgs.stdenv.hostPlatform.system}.wrapped
  ];

  programs.obs-studio = {
    enable = true;
  };

  programs.wshowkeys = {
    enable = true;
    package = inputs.wshowkeys.packages.${pkgs.stdenv.hostPlatform.system}.default;
  };

  programs.steam = {
    enable = true;
    protontricks.enable = true;
    extraCompatPackages = with pkgs; [
      proton-ge-bin
    ];
    package = pkgs.steam.override {
      extraEnv = {
        LD_AUDIT = "${
          inputs.sls-steam.packages.${pkgs.stdenv.hostPlatform.system}.sls-steam
        }/library-inject.so:${
          inputs.sls-steam.packages.${pkgs.stdenv.hostPlatform.system}.sls-steam
        }/SLSsteam.so";
      };
    };
  };

  services.unbound = {
    enable = true;
  };

  services.wivrn = {
    enable = true;
    package = pkgs.unstable.wivrn;
    openFirewall = true;
  };

  virtualisation.docker = {
    enable = true;
    enableOnBoot = false;
  };
}
