Install waycorner

- Waycorner is a hot corners application for wayland
- It currently appears to be broken some of the time, this needs more
  investigation
diff --git a/modules/waycorner.nix b/modules/waycorner.nix
new file mode 100644
index 0000000..a84466e
--- /dev/null
+++ b/modules/waycorner.nix
@@ -0,0 +1,22 @@
+{pkgs, ...}: let
+  config = {
+    left = {
+      enter_command = [./systemd-inhibit/inhibit-idle.sh];
+      exit_command = [./systemd-inhibit/stop-inhibiting-idle.sh];
+      locations = ["bottom_right" "bottom_left"];
+      size = 10;
+      timeout_ms = 250;
+    };
+    "left.output".description = "";
+  };
+in {
+  home = {
+    home = {
+      packages = [pkgs.waycorner];
+      file.".config/waycorner/config.toml".source = (pkgs.formats.toml {}).generate "config.toml" config;
+    };
+    wayland.windowManager.sway.config.startup = [
+      {command = "${pkgs.waycorner}/bin/waycorner";}
+    ];
+  };
+}
diff --git a/packages/waycorner.nix b/packages/waycorner.nix
new file mode 100644
index 0000000..122b600
--- /dev/null
+++ b/packages/waycorner.nix
@@ -0,0 +1,40 @@
+{
+  rustPlatform,
+  fetchFromGitHub,
+  cmake,
+  pkg-config,
+  freetype,
+  fontconfig,
+  expat,
+  wayland,
+  system
+}:
+rustPlatform.buildRustPackage rec {
+  pname = "waycorner";
+  version = builtins.substring 0 7 src.rev;
+
+  src = fetchFromGitHub {
+    owner = "Minion3665";
+    repo = "waycorner";
+    rev = "4a42d986cffa66c535082b3f8fb1c7e7bf278272";
+    sha256 = "sha256-OjQPYWtR3a9HZ6h1yXutHlMAfK0G2aRCdtSg9LZh1I0=";
+  };
+
+  cargoLock.lockFile = "${src}/Cargo.lock";
+
+  nativeBuildInputs = [
+    cmake
+    pkg-config
+  ];
+  
+  buildInputs = [
+    freetype
+    fontconfig
+    expat
+    wayland
+  ];
+
+  postFixup = ''
+    patchelf --add-needed ${wayland}/lib/libwayland-client.so $out/bin/waycorner
+  '';
+}