From 35c29a7c9556deeab3286e6d38337a4925906edd Mon Sep 17 00:00:00 2001
From: "Alexandre Cavalheiro S. Tiago da Silva" <contact@thewizard.link>
Date: Sat, 30 Dec 2023 12:54:44 -0300
Subject: [PATCH] chore: sync

I need to commit more, 'sync' means a butload of nothing.
---
 home-manager.nix              |  15 ++++-
 nixos.nix                     |  15 ++---
 programs/vkbasalt/default.nix |  47 ++++++++++++++
 programs/vkbasalt/shaders.nix | 115 ++++++++++++++++++++++++++++++++++
 4 files changed, 179 insertions(+), 13 deletions(-)
 create mode 100644 programs/vkbasalt/default.nix
 create mode 100644 programs/vkbasalt/shaders.nix

diff --git a/home-manager.nix b/home-manager.nix
index c22ebb2..b8cd64f 100644
--- a/home-manager.nix
+++ b/home-manager.nix
@@ -13,6 +13,7 @@
     ./programs/mangohud.nix
     ./programs/obs-studio.nix
     ./programs/rofi/default.nix
+    ./programs/vkbasalt/default.nix
     ./programs/waybar.nix
     ./programs/wezterm/config.nix
   ];
@@ -40,7 +41,10 @@
   #
   #  /etc/profiles/per-user/wizardlink/etc/profile.d/hm-session-vars.sh
     # if you don't want to manage your shell through Home Manager.
-  home.sessionVariables = { };
+  home.sessionVariables = {
+    EDITOR = "nvim";
+    NIXOS_OZONE_WL = "1";
+  };
 
   ##
   ## PACKAGES #
@@ -80,7 +84,6 @@
     brightnessctl
     discord
     firefox
-    logseq
     pavucontrol
     pulseaudio
     qbittorrent
@@ -101,15 +104,18 @@
 
     # Gaming
     dolphin-emu
+    mindustry-wayland
     path-of-building
     protontricks
+    vkbasalt
     wineWowPackages.stableFull
     winetricks
 
     ## Libraries
-    rnnoise-plugin
     libsForQt5.kdegraphics-thumbnailers
     libsForQt5.kio-extras
+    rnnoise-plugin
+    xwaylandvideobridge
 
     ## Development
     lazygit
@@ -117,6 +123,7 @@
     vscode-extensions.vadimcn.vscode-lldb
 
     ## Desktop environment
+    cliphist
     eww-wayland
     grim
     mako
@@ -212,6 +219,8 @@
     ".config/dxvk.conf".text = ''
       dxgi.tearFree = True
       dxvk.enableGraphicsPipelineLibrary = Auto
+
+      dxvk.enableAsync = True
     '';
 
     # My utility scripts
diff --git a/nixos.nix b/nixos.nix
index f3c568c..9a230d1 100644
--- a/nixos.nix
+++ b/nixos.nix
@@ -75,6 +75,7 @@
   networking.firewall = {
     allowedTCPPorts = [
       80     # HTTP
+      11753  # OpenRCT2
       443    # SSL
     ];
 
@@ -95,11 +96,7 @@
   # networking.firewall.enable = false;
 
   # Define system-wide variables.
-  environment.variables = {
-    AMD_VULKAN_ICD = "RADV";
-    EDITOR = "nvim";
-    NIXOS_OZONE_WL = "1";
-  };
+  environment.variables = { };
 
   # Set fish as the default shell for all users.
   users.defaultUserShell = pkgs.fish;
@@ -168,6 +165,9 @@
     users = [ "wizardlink" ];
   };
 
+  # Enable xpadneo support.
+  hardware.xpadneo.enable = true;
+
   ##
   ## DESKTOP ##
   ##
@@ -230,11 +230,6 @@
   # Allow unfree packages
   nixpkgs.config.allowUnfree = true;
 
-  # Allow installing electron 25.9 for LogSeq :(
-  nixpkgs.config.permittedInsecurePackages = [
-    "electron-25.9.0"
-  ];
-
   # Enable GPG.
   programs.gnupg.agent = {
     enable = true;
diff --git a/programs/vkbasalt/default.nix b/programs/vkbasalt/default.nix
new file mode 100644
index 0000000..eb5fe34
--- /dev/null
+++ b/programs/vkbasalt/default.nix
@@ -0,0 +1,47 @@
+{ pkgs, ... }:
+
+let
+  reshade-shaders = pkgs.callPackage ./shaders.nix {};
+in 
+{
+  home.packages = with pkgs; [
+    vkbasalt
+  ];
+
+  home.file = {
+    ".config/vkBasalt/vkBasalt.conf".text = ''
+      effects = cas:clarity:pcurved:pshadows:smaa:tonemap:vibrance
+
+      reshadeTexturePath = ${reshade-shaders}/Textures
+      reshadeIncludePath = ${reshade-shaders}/Shaders
+
+      toggleKey = Home
+
+      # FX
+      cas = "${reshade-shaders}/Shaders/CAS.fx"
+      clarity = "${reshade-shaders}/Shaders/Clarity.fx"
+      pcurved = "${reshade-shaders}/Shaders/PD80_03_Curved_Levels.fx"
+      pshadows = "${reshade-shaders}/Shaders/PD80_03_Shadows_Midtones_Highlights.fx"
+      smaa = "${reshade-shaders}/Shaders/SMAA.fx"
+      tonemap = "${reshade-shaders}/Shaders/Tonemap.fx"
+      vibrance = "${reshade-shaders}/Shaders/Vibrance.fx"
+
+      # Configure FX
+
+      # Vibrance
+      vibranceVibrance = 0.100000
+      vibranceVibranceRGBBalance = 1.000000,1.000000,1.000000
+
+      # Tonemap
+      tonemapDefog = 0.100000
+      tonemapBleach = 0.000000
+      tonemapGamma = 1.000000
+      tonemapExposure = 0.000000
+      tonemapSaturation = -0.150000
+      tonemapFogColor = 1.000000,1.000000,1.000000
+
+      # CAS
+      casSharpness = 0.40
+    '';
+  };
+}
diff --git a/programs/vkbasalt/shaders.nix b/programs/vkbasalt/shaders.nix
new file mode 100644
index 0000000..e11f683
--- /dev/null
+++ b/programs/vkbasalt/shaders.nix
@@ -0,0 +1,115 @@
+{
+  fetchFromGitHub,
+  stdenv
+}:
+
+let
+  pname = "reshade-shaders";
+  version = "3b5c595cf0338f02d74b2e72b9a036c211937dc3";
+
+  slim = fetchFromGitHub {
+    owner = "crosire";
+    repo = pname;
+    rev = version;
+    hash = "sha256-+kh9dlZ+sEwdvPjlNlueqFWDMJa+lJKtv5U4rCoAJ70=";
+  };
+
+  legacy = fetchFromGitHub {
+    owner = "crosire";
+    repo = pname;
+    rev = "08f5feb98dee8cc352cf404938edb73094ffdc36";
+    hash = "sha256-fZ4rDpp03yPMFiGneV5SW7MxC/iF8gkLE5neN89XZCE=";
+  };
+
+  sweetfx = fetchFromGitHub {
+    owner = "CeeJayDK";
+    repo = "SweetFX";
+    rev = "a792aee788c6203385a858ebdea82a77f81c67f0";
+    hash = "sha256-ZGJtPA5TSseuXwwcfGz8y+yP8VFzJUstsjHgdfi7eM8=";
+  };
+
+  qUINT = fetchFromGitHub {
+    owner = "martymcmodding";
+    repo = "qUINT";
+    rev = "98fed77b26669202027f575a6d8f590426c21ebd";
+    hash = "sha256-nPraJgxDm1N9FIhrv0msI3B3it8uyzk6YoX25WY27gE=";
+  };
+
+  depth3d = fetchFromGitHub {
+    owner = "BlueSkyDefender";
+    repo = "Depth3D";
+    rev = "274aeed86db084b14f766369bd551873fa62df3d";
+    hash = "sha256-ELrt7qB4ju1ZmgzZWpr6qIfpstvcslFsit5kADvyddU=";
+  };
+
+  astrayfx = fetchFromGitHub {
+    owner = "BlueSkyDefender";
+    repo = "AstrayFX";
+    rev = "910e3213a846b34dd65d94e84b61b61fca69dd6d";
+    hash = "sha256-QG2Plsq+Sh2eQDX5i7Y88sZYzsdnvf5do7rDPJ/lrDU=";
+  };
+
+  otisfx = fetchFromGitHub {
+    owner = "FransBouma";
+    repo = "OtisFX";
+    rev = "3e22b10b1a831a92ed146f9d694412014d0d47fb";
+    hash = "sha256-HWytT+8t/P1GNnpsYw/Wx7nXiWOme4gvZzooPZ12Za4=";
+  };
+
+  brussell = fetchFromGitHub {
+    owner = "brussell1";
+    repo = "Shaders";
+    rev = "f953d1e497ef257b2af05ae413bf432906cb8bd5";
+    hash = "sha256-cZAyG8PugVwJCOqle4rdUcVvYnMi5pnYVjOaceJMgXs=";
+  };
+
+  prod80 = fetchFromGitHub {
+    owner = "prod80";
+    repo = "prod80-ReShade-Repository";
+    rev = "1c2ed5b093b03c558bfa6aea45c2087052e99554";
+    hash = "sha256-EM9WxpbN0tUB9yjZFwWtY1l8um7jvMfC2eenEl2amF8=";
+  };
+
+  niceguy = fetchFromGitHub {
+    owner = "mj-ehsan";
+    repo = "NiceGuy-Shaders";
+    rev = "b81ce5699abcedaa889f044b6473f8569ab40570";
+    hash = "sha256-PogtDpZCrPfj7x6UP+IyCbrt+BkmsC526bplEBWXOIk=";
+  };
+in
+stdenv.mkDerivation rec {
+  inherit pname version;
+
+  src = slim;
+
+  installPhase = ''
+    mkdir -p $out
+    cp -r ./* $out
+
+    cp -r ${legacy}/Shaders $out
+    cp -r ${legacy}/Textures $out
+
+    cp -r ${sweetfx}/Shaders $out
+    cp -r ${sweetfx}/Textures $out
+
+    cp -r ${qUINT}/Shaders $out
+
+    cp -r ${depth3d}/Shaders $out
+    cp -r ${depth3d}/Textures $out
+
+    # Gotta copy only Clarity as Overwatch.fhx is causing problems :\
+    cp -r ${astrayfx}/Shaders/Clarity.fx $out/Shaders
+
+    cp -r ${otisfx}/Shaders $out
+    cp -r ${otisfx}/Textures $out
+
+    cp -r ${brussell}/Shaders $out
+    cp -r ${brussell}/Textures $out
+
+    cp -r ${prod80}/Shaders $out
+    cp -r ${prod80}/Textures $out
+
+    cp -r ${niceguy}/Shaders $out
+    cp -r ${niceguy}/Textures $out
+  '';
+}