about summary refs log tree commit diff
path: root/overlays
diff options
context:
space:
mode:
Diffstat (limited to 'overlays')
-rw-r--r--overlays/patches/cgit/default.nix12
-rw-r--r--overlays/patches/cgit/ui-commit-use-Git-raw-note-format.patch195
-rw-r--r--overlays/patches/cgit/ui-shared-add-this-commit-option-to-switch-form.patch57
-rw-r--r--overlays/patches/default.nix19
-rw-r--r--overlays/patches/dino/0001-add-an-option-to-enable-omemo-by-default-in-new-conv.patch115
-rw-r--r--overlays/patches/dino/default.nix16
-rw-r--r--overlays/patches/firefox/beta/D6695.diff281
-rw-r--r--overlays/patches/firefox/nightly/D6695.diff159
-rw-r--r--overlays/patches/firefox/packages.nix27
-rw-r--r--overlays/patches/firefox/profiles.ini8
-rw-r--r--overlays/patches/firefox/release/D6695.diff282
-rw-r--r--overlays/patches/firefox/user.js1
-rw-r--r--overlays/patches/gnupg/VERY-BAD-allow-signing-with-expired-keys.patch60
-rw-r--r--overlays/patches/gnupg/default.nix8
-rwxr-xr-xoverlays/patches/nixpkgs-wayland/.ci/prep.sh13
-rw-r--r--overlays/patches/nixpkgs-wayland/.ci/srht-job.yaml18
-rwxr-xr-xoverlays/patches/nixpkgs-wayland/.ci/srht-submit.sh26
-rw-r--r--overlays/patches/nixpkgs-wayland/.envrc1
-rw-r--r--overlays/patches/nixpkgs-wayland/.gitignore5
-rw-r--r--overlays/patches/nixpkgs-wayland/README.md167
-rw-r--r--overlays/patches/nixpkgs-wayland/default.nix71
-rw-r--r--overlays/patches/nixpkgs-wayland/demo/README.md9
-rw-r--r--overlays/patches/nixpkgs-wayland/demo/configuration.nix37
-rw-r--r--overlays/patches/nixpkgs-wayland/demo/home/i3status-rs.toml66
-rw-r--r--overlays/patches/nixpkgs-wayland/demo/home/profile.nix52
-rw-r--r--overlays/patches/nixpkgs-wayland/demo/home/sway-config243
-rw-r--r--overlays/patches/nixpkgs-wayland/demo/home/wallpaper.jpgbin0 -> 194238 bytes
-rw-r--r--overlays/patches/nixpkgs-wayland/demo/profile.nix66
-rwxr-xr-xoverlays/patches/nixpkgs-wayland/demo/vm-build.sh4
-rwxr-xr-xoverlays/patches/nixpkgs-wayland/demo/vm-run.sh8
-rw-r--r--overlays/patches/nixpkgs-wayland/docs/sway-on-ubuntu/README.md136
-rwxr-xr-xoverlays/patches/nixpkgs-wayland/docs/sway-on-ubuntu/execute.sh57
-rw-r--r--overlays/patches/nixpkgs-wayland/flake.lock77
-rw-r--r--overlays/patches/nixpkgs-wayland/flake.nix89
-rw-r--r--overlays/patches/nixpkgs-wayland/nixpkgs/nixos-unstable/default.nix7
-rw-r--r--overlays/patches/nixpkgs-wayland/nixpkgs/nixos-unstable/metadata.nix8
-rw-r--r--overlays/patches/nixpkgs-wayland/packages.nix9
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs-temp/wlroots-0-9-x/default.nix60
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs-temp/wlroots/default.nix60
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs.nix0
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs/aml/default.nix42
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs/aml/metadata.nix7
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs/bspwc/default.nix38
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs/bspwc/metadata.nix8
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs/cage/default.nix38
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs/cage/metadata.nix7
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs/clipman/default.nix23
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs/clipman/metadata.nix8
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs/drm_info/default.nix33
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs/drm_info/metadata.nix7
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs/emacs/default.nix22
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs/emacs/metadata.nix8
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs/gebaar-libinput/default.nix36
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs/gebaar-libinput/metadata.nix7
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs/glpaper/default.nix37
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs/glpaper/metadata.nix7
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs/grim/default.nix35
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs/grim/metadata.nix7
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs/gtk-layer-shell/default.nix35
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs/gtk-layer-shell/metadata.nix7
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs/i3status-rust/default.nix35
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs/i3status-rust/metadata.nix8
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs/imv/default.nix62
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs/imv/metadata.nix8
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs/kanshi/default.nix40
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs/kanshi/metadata.nix7
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs/lavalauncher/default.nix40
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs/lavalauncher/metadata.nix7
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs/mako/default.nix38
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs/mako/metadata.nix7
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs/neatvnc/default.nix44
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs/neatvnc/metadata.nix7
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs/obs-studio/default.nix105
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs/obs-studio/fix-search-path.patch13
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs/obs-studio/hardcode-ndi-path.patch17
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs/obs-studio/linuxbrowser.nix49
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs/obs-studio/metadata.nix7
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs/obs-studio/obs-ndi.nix41
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs/obs-studio/wlrobs.nix42
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs/obs-wlrobs/default.nix40
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs/obs-wlrobs/metadata.nix7
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs/oguri/default.nix33
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs/oguri/metadata.nix7
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs/redshift-wayland/575.patch51
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs/redshift-wayland/default.nix90
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs/redshift-wayland/metadata.nix7
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs/rootbar/default.nix39
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs/rootbar/metadata.nix7
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs/slurp/default.nix40
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs/slurp/metadata.nix7
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs/sway/default.nix56
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs/sway/load-configuration-from-etc.patch43
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs/sway/metadata.nix8
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs/sway/sway-config-no-nix-store-references.patch21
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs/swaybg/default.nix42
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs/swaybg/metadata.nix7
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs/swayidle/default.nix51
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs/swayidle/metadata.nix7
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs/swaylock/default.nix52
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs/swaylock/metadata.nix7
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs/waybar/default.nix61
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs/waybar/metadata.nix7
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs/waybox/default.nix40
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs/waybox/metadata.nix7
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs/wayfire/default.nix55
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs/wayfire/metadata.nix7
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs/waypipe/default.nix40
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs/waypipe/metadata.nix7
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs/wayvnc/default.nix44
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs/wayvnc/metadata.nix7
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs/wdisplays/default.nix36
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs/wdisplays/metadata.nix7
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs/wev/default.nix40
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs/wev/metadata.nix7
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs/wf-recorder/default.nix31
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs/wf-recorder/metadata.nix7
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs/wl-clipboard/default.nix33
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs/wl-clipboard/metadata.nix7
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs/wl-gammactl/default.nix38
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs/wl-gammactl/metadata.nix7
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs/wlay/default.nix43
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs/wlay/metadata.nix7
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs/wldash/default.nix41
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs/wldash/metadata.nix8
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs/wlfreerdp/default.nix81
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs/wlfreerdp/metadata.nix7
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs/wlogout/default.nix52
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs/wlogout/metadata.nix7
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs/wlr-randr/default.nix31
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs/wlr-randr/metadata.nix7
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs/wlroots/default.nix59
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs/wlroots/metadata.nix7
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs/wltrunk/default.nix39
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs/wltrunk/metadata.nix8
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs/wofi/default.nix52
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs/wofi/metadata.nix7
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs/wtype/default.nix36
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs/wtype/metadata.nix7
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs/xdg-desktop-portal-wlr/default.nix34
-rw-r--r--overlays/patches/nixpkgs-wayland/pkgs/xdg-desktop-portal-wlr/metadata.nix7
-rw-r--r--overlays/patches/nixpkgs-wayland/shell.nix6
-rwxr-xr-xoverlays/patches/nixpkgs-wayland/update.sh195
-rw-r--r--overlays/patches/public-inbox/0003-view-don-t-show-page-if-no-links-follow-it.patch27
-rw-r--r--overlays/patches/public-inbox/0004-view-don-t-500-if-no-mail-received-yet.patch25
-rw-r--r--overlays/patches/public-inbox/0005-wwwstream-make-source-info-configurable.patch112
-rw-r--r--overlays/patches/public-inbox/default.nix9
-rw-r--r--overlays/patches/python/default.nix11
-rw-r--r--overlays/patches/python/packages/hyperkitty/0001-Improve-look-of-fixed-width-messages.patch29
-rw-r--r--overlays/patches/python/packages/hyperkitty/default.nix7
-rw-r--r--overlays/patches/tmux/default.nix7
-rw-r--r--overlays/scripts/choose/choose.in20
-rw-r--r--overlays/scripts/choose/choosebin.in17
-rw-r--r--overlays/scripts/choose/default.nix8
-rw-r--r--overlays/scripts/default.nix3
154 files changed, 5644 insertions, 0 deletions
diff --git a/overlays/patches/cgit/default.nix b/overlays/patches/cgit/default.nix
new file mode 100644
index 000000000000..c570abe448f0
--- /dev/null
+++ b/overlays/patches/cgit/default.nix
@@ -0,0 +1,12 @@
+{ cgit, fetchpatch }:
+
+cgit.overrideAttrs ({ patches ? [], ... }: {
+  patches = patches ++ [
+    ./ui-commit-use-Git-raw-note-format.patch
+    ./ui-shared-add-this-commit-option-to-switch-form.patch
+    (fetchpatch {
+      url = "https://git.causal.agency/cgit/patch/?id=e65d3eb446294520e2aee50966e5070661d09671";
+      sha256 = "0wvckndjmxar3vgqdc3jdnpzy0xgrdlqgfaasixl3x87sdnf4kg7";
+    })
+  ];
+})
diff --git a/overlays/patches/cgit/ui-commit-use-Git-raw-note-format.patch b/overlays/patches/cgit/ui-commit-use-Git-raw-note-format.patch
new file mode 100644
index 000000000000..ce1a5aa559cc
--- /dev/null
+++ b/overlays/patches/cgit/ui-commit-use-Git-raw-note-format.patch
@@ -0,0 +1,195 @@
+Return-Path: <cgit-bounces@lists.zx2c4.com>
+Received: from compute4.internal (compute4.nyi.internal [10.202.2.44])
+	 by sloti36d2t04 (Cyrus 3.1.6-553-gc304556-fmstable-20190524v1) with LMTPA;
+	 Sun, 26 May 2019 12:57:16 -0400
+X-Cyrus-Session-Id: sloti36d2t04-1558889836-2458433-2-14112916921354509248
+X-Sieve: CMU Sieve 3.0
+X-Spam-known-sender: no
+X-Spam-score: 0.0
+X-Spam-hits: BAYES_00 -1.9, FORGED_GMAIL_RCVD 1, FREEMAIL_FORGED_FROMDOMAIN 0.001,
+  FREEMAIL_FROM 0.001, HEADER_FROM_DIFFERENT_DOMAINS 0.001,
+  MAILING_LIST_MULTI -1, ME_ZS_CLEAN -0.001, RCVD_IN_DNSWL_NONE -0.0001,
+  SPF_HELO_NONE 0.001, SPF_PASS -0.001, LANGUAGES enfr, BAYES_USED user,
+  SA_VERSION 3.4.2
+X-Spam-source: IP='192.95.5.69', Host='krantz.zx2c4.com', Country='US', FromHeader='com',
+  MailFrom='com'
+X-Spam-charsets: plain='us-ascii'
+X-Resolved-to: alyssa@fastmail.com
+X-Delivered-to: hi@alyssa.is
+X-Mail-from: cgit-bounces@lists.zx2c4.com
+Received: from mx6 ([10.202.2.205])
+  by compute4.internal (LMTPProxy); Sun, 26 May 2019 12:57:16 -0400
+Received: from mx6.messagingengine.com (localhost [127.0.0.1])
+	by mailmx.nyi.internal (Postfix) with ESMTP id C0158A2008C
+	for <hi@alyssa.is>; Sun, 26 May 2019 12:57:15 -0400 (EDT)
+Received: from mx6.messagingengine.com (localhost [127.0.0.1])
+    by mx6.messagingengine.com (Authentication Milter) with ESMTP
+    id D6950A237B8;
+    Sun, 26 May 2019 12:57:15 -0400
+ARC-Seal: i=1; a=rsa-sha256; cv=none; d=messagingengine.com; s=fm2; t=
+    1558889835; b=B7I3OXdhlHrdrasWp1rFG7Jjk+h0sxqdku2fN7+USIl8d3vp12
+    muXmMQxDMOOsEoeVd4hI8tipG7pGUmZSW8zetR+jYztp8rQATypbIbixctfVxwls
+    s0Ef0IPTEpyFn9YFOOQKLat5Ul7Qr5z5XGBjVi8LYocsnJBTSk5yHHeRrJBWWl5V
+    RGqLWse1Ldf8qEOy/b/th18XGbRpJFCVPxV9jZkoaSiF585wGKkEeoI4dfNJ3SRh
+    vktPXDJqVoU72cDyIa71fhxlWR/hOaf2Ca9n27URIPFxBuBz3b6s6faf2pEsFY2E
+    5dM2DH1WwTTf1Mooe5t2RrZWOKshkEL3Tojw==
+ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=
+    messagingengine.com; h=from:to:subject:date:message-id
+    :mime-version:list-id:list-unsubscribe:list-archive:list-post
+    :list-help:list-subscribe:content-type:content-transfer-encoding
+    :sender; s=fm2; t=1558889835; bh=VlVjl7sSy403Efad4r51sLCJz3cq/zu
+    Le82anVQc3Yk=; b=TkUYZjyqgEFkmEI5GSiRJq1ELkPP0WKcVMOuI/01v2lkWeu
+    wU/i8o4QxKYxpDTwvk8Y+OmaqTW3MJ9YoRAcIgbaaMz7NgD54BuZi7zb8QJTUQtH
+    WGycNVev/OZEoN8//53TZMTVzPtA41l32/cIQ6cZW6IhMSQ1HgTBX8hhyOjlUY6c
+    rzq2e/e0Jvuv2Z5xIOjGNOBRbmsJ4liQOJmW7oDLX83EKP+87DzlB6chPIqwhZ9E
+    XOaX0uCRdj2GaOJAF4/RD8hzG4Ya8fI3zpK28qonZN6XDentjWtIRb+kBSCsGYm6
+    iD7X9tYrNk192KU1jGasGCQpDhkt0EMk18Axd6Q==
+ARC-Authentication-Results: i=1; mx6.messagingengine.com; arc=none (no signatures found);
+    dkim=none (no signatures found);
+    dmarc=fail policy.published-domain-policy=none
+    policy.published-subdomain-policy=quarantine
+    policy.applied-disposition=none policy.evaluated-disposition=none
+    policy.override-reason=mailing_list policy.arc-aware-result=fail
+    (p=none,sp=quarantine,has-list-id=yes,d=none,d.eval=none,override=mailing_list,arc_aware_result=fail)
+    policy.policy-from=p header.from=gmail.com;
+    iprev=pass smtp.remote-ip=192.95.5.69 (krantz.zx2c4.com);
+    spf=pass smtp.mailfrom=cgit-bounces@lists.zx2c4.com
+    smtp.helo=krantz.zx2c4.com;
+    x-aligned-from=fail;
+    x-ptr=pass smtp.helo=krantz.zx2c4.com policy.ptr=krantz.zx2c4.com;
+    x-return-mx=pass header.domain=gmail.com policy.is_org=yes
+    (MX Record found);
+    x-return-mx=pass smtp.domain=lists.zx2c4.com policy.org_domain=zx2c4.com
+    policy.is_org=no (MX Record found);
+    x-tls=pass smtp.version=TLSv1.2 smtp.cipher=ECDHE-RSA-AES128-GCM-SHA256
+    smtp.bits=128/128;
+    x-vs=clean score=0 state=0;
+    x-zs=clean
+Authentication-Results: mx6.messagingengine.com;
+    arc=none (no signatures found);
+    dkim=none (no signatures found);
+    dmarc=fail policy.published-domain-policy=none
+      policy.published-subdomain-policy=quarantine
+      policy.applied-disposition=none policy.evaluated-disposition=none
+      policy.override-reason=mailing_list policy.arc-aware-result=fail
+      (p=none,sp=quarantine,has-list-id=yes,d=none,d.eval=none,override=mailing_list,arc_aware_result=fail)
+      policy.policy-from=p header.from=gmail.com;
+    iprev=pass smtp.remote-ip=192.95.5.69 (krantz.zx2c4.com);
+    spf=pass smtp.mailfrom=cgit-bounces@lists.zx2c4.com
+      smtp.helo=krantz.zx2c4.com;
+    x-aligned-from=fail;
+    x-ptr=pass smtp.helo=krantz.zx2c4.com policy.ptr=krantz.zx2c4.com;
+    x-return-mx=pass header.domain=gmail.com policy.is_org=yes
+      (MX Record found);
+    x-return-mx=pass smtp.domain=lists.zx2c4.com policy.org_domain=zx2c4.com
+      policy.is_org=no (MX Record found);
+    x-tls=pass smtp.version=TLSv1.2 smtp.cipher=ECDHE-RSA-AES128-GCM-SHA256
+      smtp.bits=128/128;
+    x-vs=clean score=0 state=0;
+    x-zs=clean
+X-ME-VSSU: VW5zdWI9bWFpbHRvOmNnaXQtcmVxdWVzdEBsaXN0cy56eDJjNC5jb20_c3ViamVjdD11bn
+    N1YnNjcmliZQ
+X-ME-VSSU: VW5zdWI9aHR0cHM6Ly9saXN0cy56eDJjNC5jb20vbWFpbG1hbi9vcHRpb25zL2NnaXQ
+X-ME-VSCause: gggruggvucftvghtrhhoucdtuddrgeduuddruddvtddguddtkecutefuodetggdotefrod
+    ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp
+    uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecunecujfgurhephffvuf
+    ffkffogghpjefjgedufedttgfgvghssehtjeertdertddvnecuhfhrohhmpeevhhhrihhs
+    ucforgihohcuoegrkhhlhhhfvgigsehgmhgrihhlrdgtohhmqeenucffohhmrghinhepii
+    igvdgtgedrtghomhenucfkphepudelvddrleehrdehrdeiledpvddtledrleefrddufeej
+    rddvtdelnecurfgrrhgrmhepihhnvghtpeduledvrdelhedrhedrieelpdhhvghlohepkh
+    hrrghnthiirdiigidvtgegrdgtohhmpdhmrghilhhfrhhomhepoegtghhithdqsghouhhn
+    tggvsheslhhishhtshdriiigvdgtgedrtghomheqnecuvehluhhsthgvrhfuihiivgeptd
+X-ME-VSScore: 0
+X-ME-VSCategory: clean
+X-ME-ZSResult: clean
+Received-SPF: pass
+    (lists.zx2c4.com: 192.95.5.69 is authorized to use 'cgit-bounces@lists.zx2c4.com' in 'mfrom' identity (mechanism 'mx' matched))
+    receiver=mx6.messagingengine.com;
+    identity=mailfrom;
+    envelope-from="cgit-bounces@lists.zx2c4.com";
+    helo=krantz.zx2c4.com;
+    client-ip=192.95.5.69
+Received: from krantz.zx2c4.com (krantz.zx2c4.com [192.95.5.69])
+	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
+	(No client certificate requested)
+	by mx6.messagingengine.com (Postfix) with ESMTPS
+	for <hi@alyssa.is>; Sun, 26 May 2019 12:57:13 -0400 (EDT)
+Received: from krantz.zx2c4.com (localhost [IPv6:::1])
+	by krantz.zx2c4.com (ZX2C4 Mail Server) with ESMTP id 6360ad08;
+	Sun, 26 May 2019 16:57:12 +0000 (UTC)
+X-Remote-Delivered-To: cgit@lists.zx2c4.com
+Received: from krantz.zx2c4.com (localhost [127.0.0.1])
+ by krantz.zx2c4.com (ZX2C4 Mail Server) with ESMTP id 94ab4c5e
+ for <cgit@lists.zx2c4.com>; Sun, 26 May 2019 16:57:10 +0000 (UTC)
+Received: from avasout02.plus.net (avasout02.plus.net [212.159.14.17])
+ by krantz.zx2c4.com (ZX2C4 Mail Server) with ESMTP id 151b7cee
+ for <cgit@lists.zx2c4.com>; Sun, 26 May 2019 16:57:10 +0000 (UTC)
+Received: from mailserver ([209.93.137.209]) by smtp with ESMTP
+ id UwSFhu7pnpYZWUwSGhosYl; Sun, 26 May 2019 17:57:06 +0100
+X-CM-Score: 0.00
+X-CNFS-Analysis: v=2.3 cv=cd2sUULM c=1 sm=1 tr=0
+ a=u68OYVRc/Z2sxEGkPHj3Dw==:117 a=u68OYVRc/Z2sxEGkPHj3Dw==:17
+ a=x7bEGLp0ZPQA:10 a=YbTMELGUhT8A:10 a=pGLkceISAAAA:8 a=HzQmFnjoOBWeq84yEp4A:9
+From: Chris Mayo <aklhfex@gmail.com>
+To: cgit@lists.zx2c4.com
+Subject: [PATCH] ui-commit: use Git raw note format
+Date: Sun, 26 May 2019 17:57:01 +0100
+Message-Id: <20190526165701.28904-1-aklhfex@gmail.com>
+X-Mailer: git-send-email 2.21.0
+MIME-Version: 1.0
+X-CMAE-Envelope: MS4wfP0CKvHqBVrlItMYLboOh+RL0e032hTB6uaiaMMwhAjdzE++e0bjO/pa6p0htCiM3UnX4Z2U0JMo1hqMzjz6Fvn9UDKX/K3SZq+SO3in/Ef8asqzdu/i
+ +D4sjBdxh3JSqvmeqsDZQIthJNuQTPajW0uaVQrKRHhx3qXMtgNqpj1J
+X-BeenThere: cgit@lists.zx2c4.com
+X-Mailman-Version: 2.1.15
+Precedence: list
+List-Id: List for cgit developers and users <cgit.lists.zx2c4.com>
+List-Unsubscribe: <https://lists.zx2c4.com/mailman/options/cgit>,
+ <mailto:cgit-request@lists.zx2c4.com?subject=unsubscribe>
+List-Archive: <http://lists.zx2c4.com/pipermail/cgit/>
+List-Post: <mailto:cgit@lists.zx2c4.com>
+List-Help: <mailto:cgit-request@lists.zx2c4.com?subject=help>
+List-Subscribe: <https://lists.zx2c4.com/mailman/listinfo/cgit>,
+ <mailto:cgit-request@lists.zx2c4.com?subject=subscribe>
+Content-Type: text/plain; charset="us-ascii"
+Content-Transfer-Encoding: 7bit
+Errors-To: cgit-bounces@lists.zx2c4.com
+Sender: "CGit" <cgit-bounces@lists.zx2c4.com>
+X-TUID: seh0e1Lgy6q2
+
+Currently a commit note is shown as:
+
+Notes
+
+  Notes:
+      <note text>
+
+Change to:
+
+Notes
+  <note text>
+
+Signed-off-by: Chris Mayo <aklhfex@gmail.com>
+---
+ ui-commit.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/ui-commit.c b/ui-commit.c
+index 9a47b54..52b4c2a 100644
+--- a/ui-commit.c
++++ b/ui-commit.c
+@@ -39,7 +39,7 @@ void cgit_print_commit(char *hex, const char *prefix)
+ 	}
+ 	info = cgit_parse_commit(commit);
+ 
+-	format_display_notes(&oid, &notes, PAGE_ENCODING, 0);
++	format_display_notes(&oid, &notes, PAGE_ENCODING, 1);
+ 
+ 	load_ref_decorations(NULL, DECORATE_FULL_REFS);
+ 
+-- 
+2.21.0
+
+_______________________________________________
+CGit mailing list
+CGit@lists.zx2c4.com
+https://lists.zx2c4.com/mailman/listinfo/cgit
diff --git a/overlays/patches/cgit/ui-shared-add-this-commit-option-to-switch-form.patch b/overlays/patches/cgit/ui-shared-add-this-commit-option-to-switch-form.patch
new file mode 100644
index 000000000000..79ea36e4b8ce
--- /dev/null
+++ b/overlays/patches/cgit/ui-shared-add-this-commit-option-to-switch-form.patch
@@ -0,0 +1,57 @@
+From 5a682008b4b46f762d96725e69e6e1473cd7102e Mon Sep 17 00:00:00 2001
+From: Alyssa Ross <hi@alyssa.is>
+Date: Thu, 23 Jul 2020 19:54:13 +0000
+Subject: [PATCH] ui-shared: add "this commit" option to switch form
+
+Branches are grouped into their own section to make the "this commit"
+option visually distinct.
+
+Adding this option will result in two options being marked as selected
+if a branch has the same name as a commit oid.  But that would cause
+all sorts of other problems anyway (attempting to switch to the branch
+would actually give you the commit, etc.), so let's not worry about
+that.
+
+A "permalink" link on the blob view next to the "plain" link would
+probably be more discoverable, but that would only work for the blob
+view.  The switch UI is visible everywhere.
+---
+ ui-shared.c | 12 ++++++++++++
+ 1 file changed, 12 insertions(+)
+
+diff --git a/ui-shared.c b/ui-shared.c
+index d2358f2..e1a3603 100644
+--- a/ui-shared.c
++++ b/ui-shared.c
+@@ -893,6 +893,15 @@ void cgit_add_clone_urls(void (*fn)(const char *))
+ 		add_clone_urls(fn, ctx.cfg.clone_prefix, ctx.repo->url);
+ }
+ 
++static int print_this_commit_option(void)
++{
++	struct object_id oid;
++	if (get_oid(ctx.qry.head, &oid))
++		return 1;
++	html_option(oid_to_hex(&oid), "this commit", ctx.qry.head);
++	return 0;
++}
++
+ static int print_branch_option(const char *refname, const struct object_id *oid,
+ 			       int flags, void *cb_data)
+ {
+@@ -1000,9 +1009,12 @@ static void print_header(void)
+ 			html("<form method='get'>\n");
+ 			cgit_add_hidden_formfields(0, 1, ctx.qry.page);
+ 			html("<select name='h' onchange='this.form.submit();'>\n");
++			print_this_commit_option();
++			html("<optgroup label='branches'>");
+ 			for_each_branch_ref(print_branch_option, ctx.qry.head);
+ 			if (ctx.repo->enable_remote_branches)
+ 				for_each_remote_ref(print_branch_option, ctx.qry.head);
++			html("</optgroup>");
+ 			html("</select> ");
+ 			html("<input type='submit' value='switch'/>");
+ 			html("</form>");
+-- 
+2.27.0
+
diff --git a/overlays/patches/default.nix b/overlays/patches/default.nix
new file mode 100644
index 000000000000..9635f42f169f
--- /dev/null
+++ b/overlays/patches/default.nix
@@ -0,0 +1,19 @@
+self: super: {
+  cgit = self.callPackage ./cgit { inherit (super) cgit; };
+
+  dino = self.callPackage ./dino { inherit (super) dino; };
+
+  firefoxPackages = self.callPackage ./firefox/packages.nix {
+    inherit (super) firefoxPackages;
+  };
+
+  gnupg = self.callPackage ./gnupg { inherit (super) gnupg; };
+
+  public-inbox = self.callPackage ./public-inbox {
+    inherit (super) public-inbox;
+  };
+
+  python3 = self.callPackage ./python { python = super.python3; };
+
+  tmux = self.callPackage ./tmux { inherit (super) tmux; };
+}
diff --git a/overlays/patches/dino/0001-add-an-option-to-enable-omemo-by-default-in-new-conv.patch b/overlays/patches/dino/0001-add-an-option-to-enable-omemo-by-default-in-new-conv.patch
new file mode 100644
index 000000000000..030c165d87b8
--- /dev/null
+++ b/overlays/patches/dino/0001-add-an-option-to-enable-omemo-by-default-in-new-conv.patch
@@ -0,0 +1,115 @@
+From cee5e27b157081a3ce55869bd5f649560a6127ea Mon Sep 17 00:00:00 2001
+From: lumi <lumi@pew.im>
+Date: Thu, 17 Oct 2019 16:43:40 +0200
+Subject: [PATCH] add an option to enable omemo by default in new conversations
+
+---
+ libdino/src/entity/settings.vala              | 10 ++++++++++
+ libdino/src/service/conversation_manager.vala |  5 +++++
+ main/data/settings_dialog.ui                  | 12 ++++++++++++
+ main/src/ui/settings_dialog.vala              |  3 +++
+ 4 files changed, 30 insertions(+)
+
+diff --git a/libdino/src/entity/settings.vala b/libdino/src/entity/settings.vala
+index bf1ebed..f9cd734 100644
+--- a/libdino/src/entity/settings.vala
++++ b/libdino/src/entity/settings.vala
+@@ -11,6 +11,7 @@ public class Settings : Object {
+         send_marker_ = col_to_bool_or_default("send_marker", true);
+         notifications_ = col_to_bool_or_default("notifications", true);
+         convert_utf8_smileys_ = col_to_bool_or_default("convert_utf8_smileys", true);
++        omemo_default_ = col_to_bool_or_default("omemo_default", false);
+     }
+ 
+     private bool col_to_bool_or_default(string key, bool def) {
+@@ -53,6 +54,15 @@ public class Settings : Object {
+             convert_utf8_smileys_ = value;
+         }
+     }
++
++    private bool omemo_default_;
++    public bool omemo_default {
++        get { return omemo_default_; }
++        set {
++            db.settings.insert().or("REPLACE").value(db.settings.key, "omemo_default").value(db.settings.value, value.to_string()).perform();
++            omemo_default_ = value;
++        }
++    }
+ }
+ 
+ }
+diff --git a/libdino/src/service/conversation_manager.vala b/libdino/src/service/conversation_manager.vala
+index c473ea7..e980e08 100644
+--- a/libdino/src/service/conversation_manager.vala
++++ b/libdino/src/service/conversation_manager.vala
+@@ -8,6 +8,8 @@ public class ConversationManager : StreamInteractionModule, Object {
+     public static ModuleIdentity<ConversationManager> IDENTITY = new ModuleIdentity<ConversationManager>("conversation_manager");
+     public string id { get { return IDENTITY.id; } }
+ 
++    private Dino.Entities.Settings settings = Dino.Application.get_default().settings;
++
+     public signal void conversation_activated(Conversation conversation);
+     public signal void conversation_deactivated(Conversation conversation);
+ 
+@@ -46,6 +48,9 @@ public class ConversationManager : StreamInteractionModule, Object {
+ 
+         // Create a new converation
+         Conversation conversation = new Conversation(jid, account, type);
++        if (settings.omemo_default) {
++            conversation.encryption = Encryption.OMEMO;
++        }
+         add_conversation(conversation);
+         conversation.persist(db);
+         return conversation;
+diff --git a/main/data/settings_dialog.ui b/main/data/settings_dialog.ui
+index c76f347..23ee7b8 100644
+--- a/main/data/settings_dialog.ui
++++ b/main/data/settings_dialog.ui
+@@ -65,6 +65,18 @@
+                                 <property name="height">1</property>
+                             </packing>
+                         </child>
++                        <child>
++                          <object class="GtkCheckButton" id="omemo_default_checkbutton">
++                            <property name="label" translatable="yes">Enable OMEMO by default</property>
++                            <property name="visible">True</property>
++                          </object>
++                          <packing>
++                              <property name="left_attach">0</property>
++                              <property name="top_attach">4</property>
++                              <property name="width">1</property>
++                              <property name="height">1</property>
++                          </packing>
++                        </child>
+                     </object>
+                 </child>
+             </object>
+diff --git a/main/src/ui/settings_dialog.vala b/main/src/ui/settings_dialog.vala
+index 68c711d..6401a2d 100644
+--- a/main/src/ui/settings_dialog.vala
++++ b/main/src/ui/settings_dialog.vala
+@@ -9,6 +9,7 @@ class SettingsDialog : Dialog {
+     [GtkChild] private CheckButton marker_checkbutton;
+     [GtkChild] private CheckButton notification_checkbutton;
+     [GtkChild] private CheckButton emoji_checkbutton;
++    [GtkChild] private CheckButton omemo_default_checkbutton;
+ 
+     Dino.Entities.Settings settings = Dino.Application.get_default().settings;
+ 
+@@ -19,11 +20,13 @@ class SettingsDialog : Dialog {
+         marker_checkbutton.active = settings.send_marker;
+         notification_checkbutton.active = settings.notifications;
+         emoji_checkbutton.active = settings.convert_utf8_smileys;
++        omemo_default_checkbutton.active = settings.omemo_default;
+ 
+         typing_checkbutton.toggled.connect(() => { settings.send_typing = typing_checkbutton.active; } );
+         marker_checkbutton.toggled.connect(() => { settings.send_marker = marker_checkbutton.active; } );
+         notification_checkbutton.toggled.connect(() => { settings.notifications = notification_checkbutton.active; } );
+         emoji_checkbutton.toggled.connect(() => { settings.convert_utf8_smileys = emoji_checkbutton.active; });
++        omemo_default_checkbutton.toggled.connect(() => { settings.omemo_default = omemo_default_checkbutton.active; });
+     }
+ }
+ 
+-- 
+2.23.0
+
diff --git a/overlays/patches/dino/default.nix b/overlays/patches/dino/default.nix
new file mode 100644
index 000000000000..2a23ee5e0cc9
--- /dev/null
+++ b/overlays/patches/dino/default.nix
@@ -0,0 +1,16 @@
+{ dino, fetchpatch }:
+
+dino.overrideAttrs ({ patches ? [], ... }: {
+  patches = patches ++ [
+    ./0001-add-an-option-to-enable-omemo-by-default-in-new-conv.patch
+    (fetchpatch {
+      url = "https://github.com/dino/dino/commit/f85bf7af3d355794a2a5208aea21efeb5b6e529d.patch";
+      sha256 = "0y8dldydvj75i2n53brki9czvzw1qwlk5646k3xrx5pnl31c7p5b";
+    })
+  ];
+
+  postInstall = ''
+    mkdir -p $out/share/man/man1
+    mv ../doc/dino.1 $out/share/man/man1
+  '';
+})
diff --git a/overlays/patches/firefox/beta/D6695.diff b/overlays/patches/firefox/beta/D6695.diff
new file mode 100644
index 000000000000..f8a8deeb8581
--- /dev/null
+++ b/overlays/patches/firefox/beta/D6695.diff
@@ -0,0 +1,281 @@
+diff --git a/toolkit/moz.build b/toolkit/moz.build
+index 109fb2c..0b871d9 100644
+--- a/toolkit/moz.build
++++ b/toolkit/moz.build
+@@ -72,3 +72,5 @@ with Files('mozapps/preferences/**'):
+ with Files('pluginproblem/**'):
+     BUG_COMPONENT = ('Core', 'Plug-ins')
+ 
++if CONFIG['ENABLE_TESTS']:
++    DIRS += ['tests/gtest']
+diff --git a/toolkit/xre/nsXREDirProvider.cpp b/toolkit/xre/nsXREDirProvider.cpp
+index aafe82e..2d850fe 100644
+--- a/toolkit/xre/nsXREDirProvider.cpp
++++ b/toolkit/xre/nsXREDirProvider.cpp
+@@ -390,13 +390,6 @@ nsXREDirProvider::GetFile(const char* aProperty, bool* aPersistent,
+     nsCOMPtr<nsIFile> localDir;
+     rv = GetUserDataDirectoryHome(getter_AddRefs(localDir), false);
+     if (NS_SUCCEEDED(rv)) {
+-#if defined(XP_MACOSX)
+-      rv = localDir->AppendNative(NS_LITERAL_CSTRING("Mozilla"));
+-#else
+-      rv = localDir->AppendNative(NS_LITERAL_CSTRING(".mozilla"));
+-#endif
+-    }
+-    if (NS_SUCCEEDED(rv)) {
+       localDir.swap(file);
+     }
+   }
+@@ -1238,7 +1231,8 @@ nsresult nsXREDirProvider::GetUpdateRootDir(nsIFile** aResult,
+             nsDependentCString(hasVendor ? GetAppVendor() : GetAppName())))) {
+       return NS_ERROR_FAILURE;
+     }
+-  } else if (NS_FAILED(localDir->AppendNative(NS_LITERAL_CSTRING("Mozilla")))) {
++  }
++  else if (NS_FAILED(localDir->AppendNative(NS_LITERAL_CSTRING("Mozilla")))) {
+     return NS_ERROR_FAILURE;
+   }
+ 
+@@ -1367,6 +1361,9 @@ nsresult nsXREDirProvider::GetUserDataDirectoryHome(nsIFile** aFile,
+   NS_ENSURE_SUCCESS(rv, rv);
+ 
+   localDir = dirFileMac;
++
++  rv = localDir->AppendRelativeNativePath(nsDependentCString("Mozilla"));
++  NS_ENSURE_SUCCESS(rv, rv);
+ #elif defined(XP_IOS)
+   nsAutoCString userDir;
+   if (GetUIKitDirectory(aLocal, userDir)) {
+@@ -1390,6 +1387,9 @@ nsresult nsXREDirProvider::GetUserDataDirectoryHome(nsIFile** aFile,
+   NS_ENSURE_SUCCESS(rv, rv);
+ 
+   rv = NS_NewLocalFile(path, true, getter_AddRefs(localDir));
++  NS_ENSURE_SUCCESS(rv, rv);
++  rv = localDir->AppendRelativeNativePath(nsDependentCString("Mozilla"));
++  NS_ENSURE_SUCCESS(rv, rv);
+ #elif defined(XP_UNIX)
+   const char* homeDir = getenv("HOME");
+   if (!homeDir || !*homeDir) return NS_ERROR_FAILURE;
+@@ -1411,8 +1411,51 @@ nsresult nsXREDirProvider::GetUserDataDirectoryHome(nsIFile** aFile,
+         rv = localDir->AppendNative(NS_LITERAL_CSTRING(".cache"));
+     }
+   } else {
++    bool exists;
++    // check old config ~/.mozilla
+     rv = NS_NewNativeLocalFile(nsDependentCString(homeDir), true,
+                                getter_AddRefs(localDir));
++    NS_ENSURE_SUCCESS(rv, rv);
++    rv = localDir->AppendRelativeNativePath(nsDependentCString(".mozilla"));
++    NS_ENSURE_SUCCESS(rv, rv);
++    rv = localDir->Exists(&exists);
++    NS_ENSURE_SUCCESS(rv, rv);
++    // otherwise, use new config
++    if (!exists) {
++      const char* xdghomedir = getenv("XDG_DATA_HOME");
++      if (!xdghomedir || !*xdghomedir) {
++        rv = NS_NewNativeLocalFile(nsDependentCString(homeDir), true,
++                                   getter_AddRefs(localDir));
++        NS_ENSURE_SUCCESS(rv, rv);
++        rv = localDir->AppendRelativeNativePath(nsDependentCString(".local"));
++        NS_ENSURE_SUCCESS(rv, rv);
++        rv = localDir->Exists(&exists);
++        if (NS_SUCCEEDED(rv) && !exists) {
++          rv = localDir->Create(nsIFile::DIRECTORY_TYPE, 0755);
++          NS_ENSURE_SUCCESS(rv, rv);
++        }
++        rv = localDir->AppendRelativeNativePath(nsDependentCString("share"));
++        NS_ENSURE_SUCCESS(rv, rv);
++        rv = localDir->Exists(&exists);
++        if (NS_SUCCEEDED(rv) && !exists) {
++          rv = localDir->Create(nsIFile::DIRECTORY_TYPE, 0755);
++        }
++      }
++      else {
++        rv = NS_NewNativeLocalFile(nsDependentCString(xdghomedir), true,
++                               getter_AddRefs(localDir));
++      }
++      NS_ENSURE_SUCCESS(rv, rv);
++
++      rv = localDir->AppendRelativeNativePath(nsDependentCString("mozilla"));
++      NS_ENSURE_SUCCESS(rv, rv);
++      rv = localDir->Exists(&exists);
++      NS_ENSURE_SUCCESS(rv, rv);
++      if (NS_SUCCEEDED(rv) && !exists) {
++        rv = localDir->Create(nsIFile::DIRECTORY_TYPE, 0700);
++        NS_ENSURE_SUCCESS(rv, rv);
++      }
++    }
+   }
+ #else
+ #error "Don't know how to get product dir on your platform"
+@@ -1523,20 +1566,12 @@ nsresult nsXREDirProvider::AppendSysUserExtensionPath(nsIFile* aFile) {
+ 
+ #if defined(XP_MACOSX) || defined(XP_WIN)
+ 
+-  static const char* const sXR = "Mozilla";
+-  rv = aFile->AppendNative(nsDependentCString(sXR));
+-  NS_ENSURE_SUCCESS(rv, rv);
+-
+   static const char* const sExtensions = "Extensions";
+   rv = aFile->AppendNative(nsDependentCString(sExtensions));
+   NS_ENSURE_SUCCESS(rv, rv);
+ 
+ #elif defined(XP_UNIX)
+ 
+-  static const char* const sXR = ".mozilla";
+-  rv = aFile->AppendNative(nsDependentCString(sXR));
+-  NS_ENSURE_SUCCESS(rv, rv);
+-
+   static const char* const sExtensions = "extensions";
+   rv = aFile->AppendNative(nsDependentCString(sExtensions));
+   NS_ENSURE_SUCCESS(rv, rv);
+@@ -1554,20 +1589,12 @@ nsresult nsXREDirProvider::AppendSysUserExtensionsDevPath(nsIFile* aFile) {
+ 
+ #if defined(XP_MACOSX) || defined(XP_WIN)
+ 
+-  static const char* const sXR = "Mozilla";
+-  rv = aFile->AppendNative(nsDependentCString(sXR));
+-  NS_ENSURE_SUCCESS(rv, rv);
+-
+   static const char* const sExtensions = "SystemExtensionsDev";
+   rv = aFile->AppendNative(nsDependentCString(sExtensions));
+   NS_ENSURE_SUCCESS(rv, rv);
+ 
+ #elif defined(XP_UNIX)
+ 
+-  static const char* const sXR = ".mozilla";
+-  rv = aFile->AppendNative(nsDependentCString(sXR));
+-  NS_ENSURE_SUCCESS(rv, rv);
+-
+   static const char* const sExtensions = "systemextensionsdev";
+   rv = aFile->AppendNative(nsDependentCString(sExtensions));
+   NS_ENSURE_SUCCESS(rv, rv);
+@@ -1625,9 +1652,6 @@ nsresult nsXREDirProvider::AppendProfilePath(nsIFile* aFile, bool aLocal) {
+   NS_ENSURE_SUCCESS(rv, rv);
+ #elif defined(XP_UNIX)
+   nsAutoCString folder;
+-  // Make it hidden (by starting with "."), except when local (the
+-  // profile is already under ~/.cache or XDG_CACHE_HOME).
+-  if (!aLocal) folder.Assign('.');
+ 
+   if (!profile.IsEmpty()) {
+     // Skip any leading path characters
+@@ -1647,8 +1671,12 @@ nsresult nsXREDirProvider::AppendProfilePath(nsIFile* aFile, bool aLocal) {
+       folder.Append(vendor);
+       ToLowerCase(folder);
+ 
+-      rv = aFile->AppendNative(folder);
+-      NS_ENSURE_SUCCESS(rv, rv);
++      // Keep the 'mozilla' path for cache:
++      // Use ${XDG_DATA_HOME:-$HOME/.cache}/mozilla/firefox
++      if (aLocal) {
++        rv = aFile->AppendNative(folder);
++        NS_ENSURE_SUCCESS(rv, rv);
++      }
+ 
+       folder.Truncate();
+     }
+diff --git a/xpcom/io/nsAppFileLocationProvider.cpp b/xpcom/io/nsAppFileLocationProvider.cpp
+index 90e4ec9..8b838ec 100644
+--- a/xpcom/io/nsAppFileLocationProvider.cpp
++++ b/xpcom/io/nsAppFileLocationProvider.cpp
+@@ -247,7 +247,7 @@ nsresult nsAppFileLocationProvider::CloneMozBinDirectory(nsIFile** aLocalFile) {
+ // GetProductDirectory - Gets the directory which contains the application data
+ // folder
+ //
+-// UNIX   : ~/.mozilla/
++// UNIX   : ~/.mozilla/ or ${XDG_DATA_HOME:-~/.local/share}/mozilla
+ // WIN    : <Application Data folder on user's machine>\Mozilla
+ // Mac    : :Documents:Mozilla:
+ //----------------------------------------------------------------------------------------
+@@ -291,19 +291,80 @@ nsresult nsAppFileLocationProvider::GetProductDirectory(nsIFile** aLocalFile,
+     return rv;
+   }
+ #elif defined(XP_UNIX)
+-  rv = NS_NewNativeLocalFile(nsDependentCString(PR_GetEnv("HOME")), true,
++  const char* homeDir = PR_GetEnv("HOME");
++  /* check old config ~/.mozilla */
++  rv = NS_NewNativeLocalFile(nsDependentCString(homeDir), true,
+                              getter_AddRefs(localDir));
+   if (NS_FAILED(rv)) {
+     return rv;
+   }
++  rv = localDir->AppendRelativeNativePath(nsDependentCString(".mozilla"));
++  if (NS_FAILED(rv)) {
++    return rv;
++  }
++  rv = localDir->Exists(&exists);
++  if (NS_FAILED(rv)) {
++    return rv;
++  }
++  /* otherwise, use new config */
++  if (!exists) {
++    const char* xdghomedir = PR_GetEnv("XDG_DATA_HOME");
++    if (!xdghomedir || !*xdghomedir) {
++      /* XDG_DATA_HOME=$HOME/.local/share */
++      rv = NS_NewNativeLocalFile(nsDependentCString(homeDir), true,
++                                 getter_AddRefs(localDir));
++      if (NS_FAILED(rv)) {
++        return rv;
++      }
++      rv = localDir->AppendRelativeNativePath(nsDependentCString(".local"));
++      if (NS_FAILED(rv)) {
++        return rv;
++      }
++      rv = localDir->Exists(&exists);
++      if (NS_SUCCEEDED(rv) && !exists) {
++        rv = localDir->Create(nsIFile::DIRECTORY_TYPE, 0755);
++        if (NS_FAILED(rv)) {
++          return rv;
++        }
++      }
++      rv = localDir->AppendRelativeNativePath(nsDependentCString("share"));
++      if (NS_FAILED(rv)) {
++        return rv;
++      }
++      rv = localDir->Exists(&exists);
++      if (NS_SUCCEEDED(rv) && !exists) {
++        rv = localDir->Create(nsIFile::DIRECTORY_TYPE, 0755);
++      }
++    }
++    else {
++      rv = NS_NewNativeLocalFile(nsDependentCString(xdghomedir), true,
++                                 getter_AddRefs(localDir));
++    }
++    if (NS_FAILED(rv)) {
++      return rv;
++    }
++    rv = localDir->AppendRelativeNativePath(nsDependentCString("mozilla"));
++    if (NS_FAILED(rv)) {
++      return rv;
++    }
++  }
+ #else
+ #error dont_know_how_to_get_product_dir_on_your_platform
+ #endif
+ 
++#if !defined(XP_UNIX) || defined(XP_MACOSX)
++  // Since we have to check for legacy configuration, we have
++  // the complete path for Linux already, so this is not
++  // needed. If we stop checking for legacy at some point,
++  // then we can change this to not be protected by
++  // this clause.
+   rv = localDir->AppendRelativeNativePath(DEFAULT_PRODUCT_DIR);
++
+   if (NS_FAILED(rv)) {
+     return rv;
+   }
++#endif
++
+   rv = localDir->Exists(&exists);
+ 
+   if (NS_SUCCEEDED(rv) && !exists) {
+@@ -323,7 +384,7 @@ nsresult nsAppFileLocationProvider::GetProductDirectory(nsIFile** aLocalFile,
+ // GetDefaultUserProfileRoot - Gets the directory which contains each user
+ // profile dir
+ //
+-// UNIX   : ~/.mozilla/
++// UNIX   : ~/.mozilla/ or ${XDG_DATA_HOME:-~/.local/share}/mozilla
+ // WIN    : <Application Data folder on user's machine>\Mozilla\Profiles
+ // Mac    : :Documents:Mozilla:Profiles:
+ //----------------------------------------------------------------------------------------
diff --git a/overlays/patches/firefox/nightly/D6695.diff b/overlays/patches/firefox/nightly/D6695.diff
new file mode 100644
index 000000000000..31a08471a8cc
--- /dev/null
+++ b/overlays/patches/firefox/nightly/D6695.diff
@@ -0,0 +1,159 @@
+--- a/toolkit/xre/nsXREDirProvider.cpp
++++ b/toolkit/xre/nsXREDirProvider.cpp
+@@ -390,13 +390,6 @@ nsXREDirProvider::GetFile(const char* aProperty, bool* aPersistent,
+     nsCOMPtr<nsIFile> localDir;
+     rv = GetUserDataDirectoryHome(getter_AddRefs(localDir), false);
+     if (NS_SUCCEEDED(rv)) {
+-#if defined(XP_MACOSX)
+-      rv = localDir->AppendNative(NS_LITERAL_CSTRING("Mozilla"));
+-#else
+-      rv = localDir->AppendNative(NS_LITERAL_CSTRING(".mozilla"));
+-#endif
+-    }
+-    if (NS_SUCCEEDED(rv)) {
+       localDir.swap(file);
+     }
+   }
+@@ -1249,8 +1242,6 @@ nsresult nsXREDirProvider::GetUpdateRootDir(nsIFile** aResult,
+             nsDependentCString(hasVendor ? GetAppVendor() : GetAppName())))) {
+       return NS_ERROR_FAILURE;
+     }
+-  } else if (NS_FAILED(localDir->AppendNative(NS_LITERAL_CSTRING("Mozilla")))) {
+-    return NS_ERROR_FAILURE;
+   }
+
+   if (NS_FAILED(localDir->Append(NS_LITERAL_STRING("updates"))) ||
+@@ -1378,6 +1369,9 @@ nsresult nsXREDirProvider::GetUserDataDirectoryHome(nsIFile** aFile,
+   NS_ENSURE_SUCCESS(rv, rv);
+
+   localDir = dirFileMac;
++
++  rv = localDir->AppendRelativeNativePath(nsDependentCString("Mozilla"));
++  NS_ENSURE_SUCCESS(rv, rv);
+ #elif defined(XP_IOS)
+   nsAutoCString userDir;
+   if (GetUIKitDirectory(aLocal, userDir)) {
+@@ -1401,6 +1395,9 @@ nsresult nsXREDirProvider::GetUserDataDirectoryHome(nsIFile** aFile,
+   NS_ENSURE_SUCCESS(rv, rv);
+
+   rv = NS_NewLocalFile(path, true, getter_AddRefs(localDir));
++  NS_ENSURE_SUCCESS(rv, rv);
++  rv = localDir->AppendRelativeNativePath(nsDependentCString("Mozilla"));
++  NS_ENSURE_SUCCESS(rv, rv);
+ #elif defined(XP_UNIX)
+   const char* homeDir = getenv("HOME");
+   if (!homeDir || !*homeDir) return NS_ERROR_FAILURE;
+@@ -1422,8 +1419,51 @@ nsresult nsXREDirProvider::GetUserDataDirectoryHome(nsIFile** aFile,
+         rv = localDir->AppendNative(NS_LITERAL_CSTRING(".cache"));
+     }
+   } else {
++    bool exists;
++    /* check old config ~/.mozilla */
+     rv = NS_NewNativeLocalFile(nsDependentCString(homeDir), true,
+                                getter_AddRefs(localDir));
++    NS_ENSURE_SUCCESS(rv, rv);
++    rv = localDir->AppendRelativeNativePath(nsDependentCString(".mozilla"));
++    NS_ENSURE_SUCCESS(rv, rv);
++    rv = localDir->Exists(&exists);
++    NS_ENSURE_SUCCESS(rv, rv);
++    /* otherwise, use new config */
++    if (!exists) {
++      const char* xdghomedir = getenv("XDG_DATA_HOME");
++      if (!xdghomedir || !*xdghomedir) {
++        rv = NS_NewNativeLocalFile(nsDependentCString(homeDir), true,
++                                   getter_AddRefs(localDir));
++        NS_ENSURE_SUCCESS(rv, rv);
++        rv = localDir->AppendRelativeNativePath(nsDependentCString(".local"));
++        NS_ENSURE_SUCCESS(rv, rv);
++        rv = localDir->Exists(&exists);
++        if (NS_SUCCEEDED(rv) && !exists) {
++          rv = localDir->Create(nsIFile::DIRECTORY_TYPE, 0755);
++          NS_ENSURE_SUCCESS(rv, rv);
++        }
++        rv = localDir->AppendRelativeNativePath(nsDependentCString("share"));
++        NS_ENSURE_SUCCESS(rv, rv);
++        rv = localDir->Exists(&exists);
++        if (NS_SUCCEEDED(rv) && !exists) {
++          rv = localDir->Create(nsIFile::DIRECTORY_TYPE, 0755);
++        }
++      }
++      else {
++        rv = NS_NewNativeLocalFile(nsDependentCString(xdghomedir), true,
++                               getter_AddRefs(localDir));
++      }
++      NS_ENSURE_SUCCESS(rv, rv);
++
++      rv = localDir->AppendRelativeNativePath(nsDependentCString("mozilla"));
++      NS_ENSURE_SUCCESS(rv, rv);
++      rv = localDir->Exists(&exists);
++      NS_ENSURE_SUCCESS(rv, rv);
++      if (NS_SUCCEEDED(rv) && !exists) {
++        rv = localDir->Create(nsIFile::DIRECTORY_TYPE, 0700);
++        NS_ENSURE_SUCCESS(rv, rv);
++      }
++    }
+   }
+ #else
+ #error "Don't know how to get product dir on your platform"
+@@ -1534,20 +1574,12 @@ nsresult nsXREDirProvider::AppendSysUserExtensionPath(nsIFile* aFile) {
+
+ #if defined(XP_MACOSX) || defined(XP_WIN)
+
+-  static const char* const sXR = "Mozilla";
+-  rv = aFile->AppendNative(nsDependentCString(sXR));
+-  NS_ENSURE_SUCCESS(rv, rv);
+-
+   static const char* const sExtensions = "Extensions";
+   rv = aFile->AppendNative(nsDependentCString(sExtensions));
+   NS_ENSURE_SUCCESS(rv, rv);
+
+ #elif defined(XP_UNIX)
+
+-  static const char* const sXR = ".mozilla";
+-  rv = aFile->AppendNative(nsDependentCString(sXR));
+-  NS_ENSURE_SUCCESS(rv, rv);
+-
+   static const char* const sExtensions = "extensions";
+   rv = aFile->AppendNative(nsDependentCString(sExtensions));
+   NS_ENSURE_SUCCESS(rv, rv);
+@@ -1565,20 +1597,12 @@ nsresult nsXREDirProvider::AppendSysUserExtensionsDevPath(nsIFile* aFile) {
+
+ #if defined(XP_MACOSX) || defined(XP_WIN)
+
+-  static const char* const sXR = "Mozilla";
+-  rv = aFile->AppendNative(nsDependentCString(sXR));
+-  NS_ENSURE_SUCCESS(rv, rv);
+-
+   static const char* const sExtensions = "SystemExtensionsDev";
+   rv = aFile->AppendNative(nsDependentCString(sExtensions));
+   NS_ENSURE_SUCCESS(rv, rv);
+
+ #elif defined(XP_UNIX)
+
+-  static const char* const sXR = ".mozilla";
+-  rv = aFile->AppendNative(nsDependentCString(sXR));
+-  NS_ENSURE_SUCCESS(rv, rv);
+-
+   static const char* const sExtensions = "systemextensionsdev";
+   rv = aFile->AppendNative(nsDependentCString(sExtensions));
+   NS_ENSURE_SUCCESS(rv, rv);
+@@ -1636,9 +1660,6 @@ nsresult nsXREDirProvider::AppendProfilePath(nsIFile* aFile, bool aLocal) {
+   NS_ENSURE_SUCCESS(rv, rv);
+ #elif defined(XP_UNIX)
+   nsAutoCString folder;
+-  // Make it hidden (by starting with "."), except when local (the
+-  // profile is already under ~/.cache or XDG_CACHE_HOME).
+-  if (!aLocal) folder.Assign('.');
+
+   if (!profile.IsEmpty()) {
+     // Skip any leading path characters
+@@ -1658,9 +1679,6 @@ nsresult nsXREDirProvider::AppendProfilePath(nsIFile* aFile, bool aLocal) {
+       folder.Append(vendor);
+       ToLowerCase(folder);
+
+-      rv = aFile->AppendNative(folder);
+-      NS_ENSURE_SUCCESS(rv, rv);
+-
+       folder.Truncate();
+     }
+
diff --git a/overlays/patches/firefox/packages.nix b/overlays/patches/firefox/packages.nix
new file mode 100644
index 000000000000..ec4fdcc5336e
--- /dev/null
+++ b/overlays/patches/firefox/packages.nix
@@ -0,0 +1,27 @@
+{ firefoxPackages, clangStdenv }:
+
+with firefoxPackages;
+
+firefoxPackages // {
+  # Use clangStdenv to work around
+  # <https://github.com/NixOS/nixpkgs/issues/84283>
+  # (Firefox fails to build with GCC on AMD EPYC 7401P.)
+
+  firefox = (firefox.override {
+    stdenv = clangStdenv;
+  }).overrideAttrs ({ patches ? [], ... }: {
+    patches = patches ++ [ release/D6695.diff ];
+  });
+
+  firefox-beta = (firefox-beta.override {
+    stdenv = clangStdenv;
+  }).overrideAttrs ({ patches ? [], ... }: {
+    patches = patches ++ [ beta/D6695.diff ];
+  });
+
+  firefox-nightly = (firefox-nightly.override {
+    stdenv = clangStdenv;
+  }).overrideAttrs ({ patches ? [], ... }: {
+    patches = patches ++ [ nightly/D6695.diff ];
+  });
+}
diff --git a/overlays/patches/firefox/profiles.ini b/overlays/patches/firefox/profiles.ini
new file mode 100644
index 000000000000..becf53354e76
--- /dev/null
+++ b/overlays/patches/firefox/profiles.ini
@@ -0,0 +1,8 @@
+[General]
+StartWithLastProfile=1
+
+[Profile0]
+Name=default
+IsRelative=1
+Path=default
+Default=1
diff --git a/overlays/patches/firefox/release/D6695.diff b/overlays/patches/firefox/release/D6695.diff
new file mode 100644
index 000000000000..e6425af02ca6
--- /dev/null
+++ b/overlays/patches/firefox/release/D6695.diff
@@ -0,0 +1,282 @@
+diff --git a/toolkit/moz.build b/toolkit/moz.build
+index f01b128b2493a..ae0e19ec9c509 100644
+--- a/toolkit/moz.build
++++ b/toolkit/moz.build
+@@ -84,3 +84,6 @@ with Files('pluginproblem/**'):
+ 
+ with Files('l10n-registry.manifest'):
+     BUG_COMPONENT = ('Core', 'Localization')
++
++if CONFIG['ENABLE_TESTS']:
++    DIRS += ['tests/gtest']
+diff --git a/toolkit/xre/nsXREDirProvider.cpp b/toolkit/xre/nsXREDirProvider.cpp
+index 1d6ffb748e4e4..8708279b964a2 100644
+--- a/toolkit/xre/nsXREDirProvider.cpp
++++ b/toolkit/xre/nsXREDirProvider.cpp
+@@ -390,13 +390,6 @@ nsXREDirProvider::GetFile(const char* aProperty, bool* aPersistent,
+     nsCOMPtr<nsIFile> localDir;
+     rv = GetUserDataDirectoryHome(getter_AddRefs(localDir), false);
+     if (NS_SUCCEEDED(rv)) {
+-#  if defined(XP_MACOSX)
+-      rv = localDir->AppendNative(NS_LITERAL_CSTRING("Mozilla"));
+-#  else
+-      rv = localDir->AppendNative(NS_LITERAL_CSTRING(".mozilla"));
+-#  endif
+-    }
+-    if (NS_SUCCEEDED(rv)) {
+       localDir.swap(file);
+     }
+   }
+@@ -1302,7 +1295,8 @@ nsresult nsXREDirProvider::GetUpdateRootDir(nsIFile** aResult,
+             nsDependentCString(hasVendor ? GetAppVendor() : GetAppName())))) {
+       return NS_ERROR_FAILURE;
+     }
+-  } else if (NS_FAILED(localDir->AppendNative(NS_LITERAL_CSTRING("Mozilla")))) {
++  }
++  else if (NS_FAILED(localDir->AppendNative(NS_LITERAL_CSTRING("Mozilla")))) {
+     return NS_ERROR_FAILURE;
+   }
+ 
+@@ -1443,6 +1437,9 @@ nsresult nsXREDirProvider::GetUserDataDirectoryHome(nsIFile** aFile,
+   NS_ENSURE_SUCCESS(rv, rv);
+ 
+   localDir = dirFileMac;
++
++  rv = localDir->AppendRelativeNativePath(nsDependentCString("Mozilla"));
++  NS_ENSURE_SUCCESS(rv, rv);
+ #elif defined(XP_IOS)
+   nsAutoCString userDir;
+   if (GetUIKitDirectory(aLocal, userDir)) {
+@@ -1466,6 +1463,9 @@ nsresult nsXREDirProvider::GetUserDataDirectoryHome(nsIFile** aFile,
+   NS_ENSURE_SUCCESS(rv, rv);
+ 
+   rv = NS_NewLocalFile(path, true, getter_AddRefs(localDir));
++  NS_ENSURE_SUCCESS(rv, rv);
++  rv = localDir->AppendRelativeNativePath(nsDependentCString("Mozilla"));
++  NS_ENSURE_SUCCESS(rv, rv);
+ #elif defined(XP_UNIX)
+   const char* homeDir = getenv("HOME");
+   if (!homeDir || !*homeDir) return NS_ERROR_FAILURE;
+@@ -1487,8 +1487,51 @@ nsresult nsXREDirProvider::GetUserDataDirectoryHome(nsIFile** aFile,
+         rv = localDir->AppendNative(NS_LITERAL_CSTRING(".cache"));
+     }
+   } else {
++    bool exists;
++    // check old config ~/.mozilla
+     rv = NS_NewNativeLocalFile(nsDependentCString(homeDir), true,
+                                getter_AddRefs(localDir));
++    NS_ENSURE_SUCCESS(rv, rv);
++    rv = localDir->AppendRelativeNativePath(nsDependentCString(".mozilla"));
++    NS_ENSURE_SUCCESS(rv, rv);
++    rv = localDir->Exists(&exists);
++    NS_ENSURE_SUCCESS(rv, rv);
++    // otherwise, use new config
++    if (!exists) {
++      const char* xdghomedir = getenv("XDG_DATA_HOME");
++      if (!xdghomedir || !*xdghomedir) {
++        rv = NS_NewNativeLocalFile(nsDependentCString(homeDir), true,
++                                   getter_AddRefs(localDir));
++        NS_ENSURE_SUCCESS(rv, rv);
++        rv = localDir->AppendRelativeNativePath(nsDependentCString(".local"));
++        NS_ENSURE_SUCCESS(rv, rv);
++        rv = localDir->Exists(&exists);
++        if (NS_SUCCEEDED(rv) && !exists) {
++          rv = localDir->Create(nsIFile::DIRECTORY_TYPE, 0755);
++          NS_ENSURE_SUCCESS(rv, rv);
++        }
++        rv = localDir->AppendRelativeNativePath(nsDependentCString("share"));
++        NS_ENSURE_SUCCESS(rv, rv);
++        rv = localDir->Exists(&exists);
++        if (NS_SUCCEEDED(rv) && !exists) {
++          rv = localDir->Create(nsIFile::DIRECTORY_TYPE, 0755);
++        }
++      }
++      else {
++        rv = NS_NewNativeLocalFile(nsDependentCString(xdghomedir), true,
++                               getter_AddRefs(localDir));
++      }
++      NS_ENSURE_SUCCESS(rv, rv);
++
++      rv = localDir->AppendRelativeNativePath(nsDependentCString("mozilla"));
++      NS_ENSURE_SUCCESS(rv, rv);
++      rv = localDir->Exists(&exists);
++      NS_ENSURE_SUCCESS(rv, rv);
++      if (NS_SUCCEEDED(rv) && !exists) {
++        rv = localDir->Create(nsIFile::DIRECTORY_TYPE, 0700);
++        NS_ENSURE_SUCCESS(rv, rv);
++      }
++    }
+   }
+ #else
+ #  error "Don't know how to get product dir on your platform"
+@@ -1609,20 +1652,12 @@ nsresult nsXREDirProvider::AppendSysUserExtensionPath(nsIFile* aFile) {
+ 
+ #if defined(XP_MACOSX) || defined(XP_WIN)
+ 
+-  static const char* const sXR = "Mozilla";
+-  rv = aFile->AppendNative(nsDependentCString(sXR));
+-  NS_ENSURE_SUCCESS(rv, rv);
+-
+   static const char* const sExtensions = "Extensions";
+   rv = aFile->AppendNative(nsDependentCString(sExtensions));
+   NS_ENSURE_SUCCESS(rv, rv);
+ 
+ #elif defined(XP_UNIX)
+ 
+-  static const char* const sXR = ".mozilla";
+-  rv = aFile->AppendNative(nsDependentCString(sXR));
+-  NS_ENSURE_SUCCESS(rv, rv);
+-
+   static const char* const sExtensions = "extensions";
+   rv = aFile->AppendNative(nsDependentCString(sExtensions));
+   NS_ENSURE_SUCCESS(rv, rv);
+@@ -1640,20 +1675,12 @@ nsresult nsXREDirProvider::AppendSysUserExtensionsDevPath(nsIFile* aFile) {
+ 
+ #if defined(XP_MACOSX) || defined(XP_WIN)
+ 
+-  static const char* const sXR = "Mozilla";
+-  rv = aFile->AppendNative(nsDependentCString(sXR));
+-  NS_ENSURE_SUCCESS(rv, rv);
+-
+   static const char* const sExtensions = "SystemExtensionsDev";
+   rv = aFile->AppendNative(nsDependentCString(sExtensions));
+   NS_ENSURE_SUCCESS(rv, rv);
+ 
+ #elif defined(XP_UNIX)
+ 
+-  static const char* const sXR = ".mozilla";
+-  rv = aFile->AppendNative(nsDependentCString(sXR));
+-  NS_ENSURE_SUCCESS(rv, rv);
+-
+   static const char* const sExtensions = "systemextensionsdev";
+   rv = aFile->AppendNative(nsDependentCString(sExtensions));
+   NS_ENSURE_SUCCESS(rv, rv);
+@@ -1718,9 +1745,6 @@ nsresult nsXREDirProvider::AppendProfilePath(nsIFile* aFile, bool aLocal) {
+   NS_ENSURE_SUCCESS(rv, rv);
+ #elif defined(XP_UNIX)
+   nsAutoCString folder;
+-  // Make it hidden (by starting with "."), except when local (the
+-  // profile is already under ~/.cache or XDG_CACHE_HOME).
+-  if (!aLocal) folder.Assign('.');
+ 
+   if (!profile.IsEmpty()) {
+     // Skip any leading path characters
+@@ -1740,8 +1764,12 @@ nsresult nsXREDirProvider::AppendProfilePath(nsIFile* aFile, bool aLocal) {
+       folder.Append(vendor);
+       ToLowerCase(folder);
+ 
+-      rv = aFile->AppendNative(folder);
+-      NS_ENSURE_SUCCESS(rv, rv);
++      // Keep the 'mozilla' path for cache:
++      // Use ${XDG_DATA_HOME:-$HOME/.cache}/mozilla/firefox
++      if (aLocal) {
++        rv = aFile->AppendNative(folder);
++        NS_ENSURE_SUCCESS(rv, rv);
++      }
+ 
+       folder.Truncate();
+     }
+diff --git a/xpcom/io/nsAppFileLocationProvider.cpp b/xpcom/io/nsAppFileLocationProvider.cpp
+index e79c8303fe129..53c550db18c05 100644
+--- a/xpcom/io/nsAppFileLocationProvider.cpp
++++ b/xpcom/io/nsAppFileLocationProvider.cpp
+@@ -247,7 +247,7 @@ nsresult nsAppFileLocationProvider::CloneMozBinDirectory(nsIFile** aLocalFile) {
+ // GetProductDirectory - Gets the directory which contains the application data
+ // folder
+ //
+-// UNIX   : ~/.mozilla/
++// UNIX   : ~/.mozilla/ or ${XDG_DATA_HOME:-~/.local/share}/mozilla
+ // WIN    : <Application Data folder on user's machine>\Mozilla
+ // Mac    : :Documents:Mozilla:
+ //----------------------------------------------------------------------------------------
+@@ -291,19 +291,80 @@ nsresult nsAppFileLocationProvider::GetProductDirectory(nsIFile** aLocalFile,
+     return rv;
+   }
+ #elif defined(XP_UNIX)
+-  rv = NS_NewNativeLocalFile(nsDependentCString(PR_GetEnv("HOME")), true,
++  const char* homeDir = PR_GetEnv("HOME");
++  /* check old config ~/.mozilla */
++  rv = NS_NewNativeLocalFile(nsDependentCString(homeDir), true,
+                              getter_AddRefs(localDir));
+   if (NS_FAILED(rv)) {
+     return rv;
+   }
++  rv = localDir->AppendRelativeNativePath(nsDependentCString(".mozilla"));
++  if (NS_FAILED(rv)) {
++    return rv;
++  }
++  rv = localDir->Exists(&exists);
++  if (NS_FAILED(rv)) {
++    return rv;
++  }
++  /* otherwise, use new config */
++  if (!exists) {
++    const char* xdghomedir = PR_GetEnv("XDG_DATA_HOME");
++    if (!xdghomedir || !*xdghomedir) {
++      /* XDG_DATA_HOME=$HOME/.local/share */
++      rv = NS_NewNativeLocalFile(nsDependentCString(homeDir), true,
++                                 getter_AddRefs(localDir));
++      if (NS_FAILED(rv)) {
++        return rv;
++      }
++      rv = localDir->AppendRelativeNativePath(nsDependentCString(".local"));
++      if (NS_FAILED(rv)) {
++        return rv;
++      }
++      rv = localDir->Exists(&exists);
++      if (NS_SUCCEEDED(rv) && !exists) {
++        rv = localDir->Create(nsIFile::DIRECTORY_TYPE, 0755);
++        if (NS_FAILED(rv)) {
++          return rv;
++        }
++      }
++      rv = localDir->AppendRelativeNativePath(nsDependentCString("share"));
++      if (NS_FAILED(rv)) {
++        return rv;
++      }
++      rv = localDir->Exists(&exists);
++      if (NS_SUCCEEDED(rv) && !exists) {
++        rv = localDir->Create(nsIFile::DIRECTORY_TYPE, 0755);
++      }
++    }
++    else {
++      rv = NS_NewNativeLocalFile(nsDependentCString(xdghomedir), true,
++                                 getter_AddRefs(localDir));
++    }
++    if (NS_FAILED(rv)) {
++      return rv;
++    }
++    rv = localDir->AppendRelativeNativePath(nsDependentCString("mozilla"));
++    if (NS_FAILED(rv)) {
++      return rv;
++    }
++  }
+ #else
+ #  error dont_know_how_to_get_product_dir_on_your_platform
+ #endif
+ 
++#if !defined(XP_UNIX) || defined(XP_MACOSX)
++  // Since we have to check for legacy configuration, we have
++  // the complete path for Linux already, so this is not
++  // needed. If we stop checking for legacy at some point,
++  // then we can change this to not be protected by
++  // this clause.
+   rv = localDir->AppendRelativeNativePath(DEFAULT_PRODUCT_DIR);
++
+   if (NS_FAILED(rv)) {
+     return rv;
+   }
++#endif
++
+   rv = localDir->Exists(&exists);
+ 
+   if (NS_SUCCEEDED(rv) && !exists) {
+@@ -323,7 +384,7 @@ nsresult nsAppFileLocationProvider::GetProductDirectory(nsIFile** aLocalFile,
+ // GetDefaultUserProfileRoot - Gets the directory which contains each user
+ // profile dir
+ //
+-// UNIX   : ~/.mozilla/
++// UNIX   : ~/.mozilla/ or ${XDG_DATA_HOME:-~/.local/share}/mozilla
+ // WIN    : <Application Data folder on user's machine>\Mozilla\Profiles
+ // Mac    : :Documents:Mozilla:Profiles:
+ //----------------------------------------------------------------------------------------
diff --git a/overlays/patches/firefox/user.js b/overlays/patches/firefox/user.js
new file mode 100644
index 000000000000..8b137891791f
--- /dev/null
+++ b/overlays/patches/firefox/user.js
@@ -0,0 +1 @@
+
diff --git a/overlays/patches/gnupg/VERY-BAD-allow-signing-with-expired-keys.patch b/overlays/patches/gnupg/VERY-BAD-allow-signing-with-expired-keys.patch
new file mode 100644
index 000000000000..688c6cb6f074
--- /dev/null
+++ b/overlays/patches/gnupg/VERY-BAD-allow-signing-with-expired-keys.patch
@@ -0,0 +1,60 @@
+From f6cd902764ea8d13523e98f10bb05ce32234f60d Mon Sep 17 00:00:00 2001
+From: Alyssa Ross <hi@alyssa.is>
+Date: Fri, 31 Jul 2020 06:10:00 +0000
+Subject: [PATCH] VERY BAD: allow signing with expired keys
+
+This probably has very bad side effects.  Will expiration dates still
+be checked when verifying signatures, for example?  Who knows‽
+---
+ g10/getkey.c | 18 ++++++++----------
+ 1 file changed, 8 insertions(+), 10 deletions(-)
+
+diff --git a/g10/getkey.c b/g10/getkey.c
+index cfcf9c96a..26f41656d 100644
+--- a/g10/getkey.c
++++ b/g10/getkey.c
+@@ -1930,9 +1930,9 @@ parse_def_secret_key (ctrl_t ctrl)
+           if (pk->has_expired)
+             {
+               if (DBG_LOOKUP)
+-                log_debug ("not using %s as default key, %s",
+-                           keystr_from_pk (pk), "expired");
+-              continue;
++                log_debug ("%s has expired, but let's ignore that",
++                           keystr_from_pk (pk));
++              /* continue; */
+             }
+           if (pk_is_disabled (pk))
+             {
+@@ -3579,9 +3579,9 @@ finish_lookup (kbnode_t keyblock, unsigned int req_usage, int want_exact,
+ 	  if (pk->has_expired)
+ 	    {
+ 	      if (DBG_LOOKUP)
+-		log_debug ("\tsubkey has expired\n");
++	  	log_debug ("\tsubkey has expired but let's ignored that\n");
+               n_revoked_or_expired++;
+-	      continue;
++	      /* continue; */
+ 	    }
+ 	  if (pk->timestamp > curtime && !opt.ignore_valid_from)
+ 	    {
+@@ -3656,13 +3656,11 @@ finish_lookup (kbnode_t keyblock, unsigned int req_usage, int want_exact,
+ 	  if (DBG_LOOKUP)
+ 	    log_debug ("\tprimary key has been revoked\n");
+ 	}
+-      else if (pk->has_expired)
+-	{
+-	  if (DBG_LOOKUP)
+-	    log_debug ("\tprimary key has expired\n");
+-	}
+       else /* Okay.  */
+ 	{
++	  if (pk->has_expired && DBG_LOOKUP)
++	    log_debug ("\tprimary key has expired but let's ignore that\n");
++
+ 	  if (DBG_LOOKUP)
+ 	    log_debug ("\tprimary key may be used\n");
+ 	  latest_key = keyblock;
+-- 
+2.27.0
+
diff --git a/overlays/patches/gnupg/default.nix b/overlays/patches/gnupg/default.nix
new file mode 100644
index 000000000000..35000019c0b0
--- /dev/null
+++ b/overlays/patches/gnupg/default.nix
@@ -0,0 +1,8 @@
+{ gnupg, ... } @ args:
+
+(gnupg.override (builtins.removeAttrs args [ "gnupg" ])).overrideAttrs (
+  { patches ? [], ... }:
+  {
+    patches = patches ++ [ ./VERY-BAD-allow-signing-with-expired-keys.patch ];
+  }
+)
diff --git a/overlays/patches/nixpkgs-wayland/.ci/prep.sh b/overlays/patches/nixpkgs-wayland/.ci/prep.sh
new file mode 100755
index 000000000000..d3a57e7b509a
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/.ci/prep.sh
@@ -0,0 +1,13 @@
+#!/usr/bin/env bash
+set -euo pipefail
+set -x
+
+cachix use nixpkgs-wayland
+
+ssh-keyscan github.com >> ${HOME}/.ssh/known_hosts
+
+git config --global user.name \
+ "Cole Botkens"
+
+git config --global user.email \
+ "cole.mickens+colebot@gmail.com"
diff --git a/overlays/patches/nixpkgs-wayland/.ci/srht-job.yaml b/overlays/patches/nixpkgs-wayland/.ci/srht-job.yaml
new file mode 100644
index 000000000000..b05a6c70313c
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/.ci/srht-job.yaml
@@ -0,0 +1,18 @@
+image: nixos/unstable
+sources:
+  - git@github.com:colemickens/nixpkgs-wayland
+secrets:
+  - df3e056f-2931-4a93-86db-e40c2fa6098d # cachix.dhall
+  - bd070f2a-01d1-4b7b-9795-036deb06912c # id_ed25519
+environment:
+  CI_BUILD: "sr.ht"
+tasks:
+  - prep: |
+      cd nixpkgs-wayland
+      nix-shell --pure --command "./.ci/prep.sh"
+  - update: |
+      cd nixpkgs-wayland
+      nix-shell --pure --command "JOB_ID=$JOB_ID ./update.sh"
+  # - update-flakes: |
+  #     cd nixpkgs-wayland
+  #     nix-shell --pure --command "JOB_ID=$JOB_ID ./update-flakes.sh"
diff --git a/overlays/patches/nixpkgs-wayland/.ci/srht-submit.sh b/overlays/patches/nixpkgs-wayland/.ci/srht-submit.sh
new file mode 100755
index 000000000000..8a863b1b8eac
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/.ci/srht-submit.sh
@@ -0,0 +1,26 @@
+#!/usr/bin/env bash
+set -euo pipefail
+set -x
+DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
+
+# user-specific
+SECRET_NAME="cole.mickens@gmail.com/meta.sr.ht"
+SECRET_ATTR="pat"
+
+# less user-specific
+BUILD_HOST="https://builds.sr.ht"
+if which gopass ; then
+  TOKEN="$(gopass show "${SECRET_NAME}" | grep "${SECRET_ATTR}" | cut -d' ' -f2)"
+else
+  TOKEN="$(cat "/home/cole/.srht-token")"
+fi
+
+DATA="$(mktemp)"
+MANIFEST="$(jq -aRs . <"${DIR}/srht-job.yaml")"
+echo "{ \"tags\": [ \"nixpkgs-wayland\" ], \"manifest\": ${MANIFEST} }" > "${DATA}"
+
+curl \
+  -H "Authorization:token ${TOKEN}" \
+  -H "Content-Type: application/json" \
+  -d "@${DATA}" \
+  "${BUILD_HOST}/api/jobs"
diff --git a/overlays/patches/nixpkgs-wayland/.envrc b/overlays/patches/nixpkgs-wayland/.envrc
new file mode 100644
index 000000000000..3550a30f2de3
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/.envrc
@@ -0,0 +1 @@
+use flake
diff --git a/overlays/patches/nixpkgs-wayland/.gitignore b/overlays/patches/nixpkgs-wayland/.gitignore
new file mode 100644
index 000000000000..1eb9422ad8fb
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/.gitignore
@@ -0,0 +1,5 @@
+.ci/commit-message
+.direnv
+*.qcow2
+result
+result-*
diff --git a/overlays/patches/nixpkgs-wayland/README.md b/overlays/patches/nixpkgs-wayland/README.md
new file mode 100644
index 000000000000..486d613994f8
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/README.md
@@ -0,0 +1,167 @@
+# flake-wayland-apps
+*nee nixpkgs-wayland*
+
+[![builds.sr.ht status](https://builds.sr.ht/~colemickens/nixpkgs-wayland.svg)](https://builds.sr.ht/~colemickens/nixpkgs-wayland?)
+
+- [flake-wayland-apps](#flake-wayland-apps)
+  - [Warning](#warning)
+  - [Overview](#overview)
+  - [Usage](#usage)
+      - [Flakes Usage](#flakes-usage)
+      - [Example Usage](#example-usage)
+  - [Packages](#packages)
+  - [Tips](#tips)
+      - [`sway`](#sway)
+      - [`obs-studio` + `wlrobs`](#obs-studio--wlrobs)
+  - [Development Guide](#development-guide)
+
+## Warning
+* This repo may be renamed soon. (~`nixos-wayland-apps`, maybe)
+  * `wayland-nix` (ala `sops-nix`)?
+  * `nixos-wayland` ?
+  * keep `nixpkgs-wayland`?
+* The primary cache server may change soon.
+
+## Overview
+
+Automated, pre-built packages for Wayland (sway/wlroots) tools for NixOS.
+
+There is also now flake support: `.#packages` contain a package list, `.#overlay` is the full set as an overlay.
+
+(related: [nixpkgs-chromium](https://github.com/colemickens/nixpkgs-chromium) - Chromium with native Wayland support)
+
+## Usage
+
+The [NixOS Wiki page on Overlays](https://nixos.wiki/wiki/Overlays)
+shows how to activate the overlay.
+
+The [Cachix landing page for `nixpkgs-wayland`](https://nixpkgs-wayland.cachix.org) shows how to utilize the binary cache. Packages from this overlay are regularly built against `nixos-unstable` and pushed to this cache.
+
+#### Flakes Usage
+
+```bash
+nix build "github:colemickens/nixpkgs-wayland#waybar" # builds waybar
+
+nix build "github:colemickens/nixpkgs-wayland" # builds all packages
+```
+
+#### Example Usage
+
+```nix
+{ config, lib, pkgs, ... }:
+let
+  rev = "master"; # could be a git rev, to pin the overlay (not usually recommended)
+  url = "https://github.com/colemickens/nixpkgs-wayland/archive/${rev}.tar.gz";
+  waylandOverlay = (import (builtins.fetchTarball url));
+in
+  {
+    nixpkgs.overlays = [ waylandOverlay ];
+    environment.systemPackages = with pkgs; [ wayvnc ];
+    # ...
+  }
+```
+
+You could write that to a file `./wayland.nix` next to your `configuration.nix` and then use it like so:
+```nix
+{ config, lib, pkgs, ... }:
+  {
+    # ...
+    imports = [
+      # ...
+      ./wayland.nix
+    ];
+  }
+```
+
+Or you can integrate those few lines into your own configuration.
+
+## Packages
+
+These packages were mostly recently built (and cached) against:
+<!--nixpkgs-->
+| Channel | Last Channel Commit Time |
+| ------- | ------------------------ |
+<!--nixpkgs-->
+
+<!--pkgs-->
+| Package | Last Updated (UTC) | Description |
+| ------- | ------------------ | ----------- |
+| [aml](https://github.com/any1/neatvnc) | 2020-07-26 14:57:11Z | liberally licensed VNC server library that's intended to be fast and neat |
+| [bspwc](https://git.sr.ht/~bl4ckb0ne/bspwc) | 2020-01-18 03:54:38Z (pinned) | Binary space partitioning wayland compositor |
+| [cage](https://www.hjdskes.nl/projects/cage/) | 2020-08-02 15:43:05Z | A Wayland kiosk |
+| [clipman](https://github.com/yory8/clipman) | 2020-06-29 21:10:10Z | A basic clipboard manager for Wayland, with support for persisting copy buffers after an application exits |
+| [drm_info](https://github.com/ascent12/drm_info) | 2020-07-04 07:46:47Z | Small utility to dump info about DRM devices. |
+| [emacs](https://www.gnu.org/software/emacs/) | 2020-08-14 17:17:14Z | The extensible, customizable GNU text editor |
+| [gebaar-libinput](https://github.com/Coffee2CodeNL/gebaar-libinput) | 2019-04-05 13:27:03Z | Gebaar, A Super Simple WM Independent Touchpad Gesture Daemon for libinput |
+| [glpaper](https://bitbucket.org/Scoopta/glpaper) | 2020-03-29 19:46:07 | GLPaper is a wallpaper program for wlroots based wayland compositors such as sway that allows you to render glsl shaders as your wallpaper |
+| [grim](https://github.com/emersion/grim) | 2020-07-21 18:11:14Z | Grab images from a Wayland compositor |
+| [gtk-layer-shell](https://github.com/wmww/gtk-layer-shell) | 2020-08-12 19:57:39Z | A library to create panels and other desktop components for Wayland using the Layer Shell protocol |
+| [i3status-rust](https://github.com/greshake/i3status-rust) | 2020-08-14 16:00:22Z | Very resource-friendly and feature-rich replacement for i3status |
+| [imv](https://github.com/eXeC64/imv) | 2020-02-08 00:29:25Z (pinned) | A command line image viewer for tiling window managers |
+| [kanshi](https://github.com/emersion/kanshi) | 2020-08-05 14:50:47Z | Dynamic display configuration |
+| [lavalauncher](https://git.sr.ht/~leon_plickat/lavalauncher) | 2020-08-15 16:16:45Z | A simple launcher for Wayland. |
+| [mako](https://wayland.emersion.fr/mako) | 2020-08-03 16:08:05Z | A lightweight Wayland notification daemon |
+| [neatvnc](https://github.com/any1/neatvnc) | 2020-07-26 13:52:00Z | liberally licensed VNC server library that's intended to be fast and neat |
+| [obs-studio](https://obsproject.com) | 2020-08-10 13:48:20Z | Free and open source software for video recording and live streaming |
+| [obs-wlrobs](https://sr.ht/~scoopta/wlrobs) | 2020-08-12 12:00:28 | wlrobs is an obs-studio plugin that allows you to screen capture on wlroots based wayland compositors |
+| [oguri](https://github.com/vilhalmer/oguri) | 2020-05-27 14:14:43Z | A very nice animated wallpaper tool for Wayland compositors |
+| [redshift-wayland](http://jonls.dk/redshift) | 2019-08-24 15:20:17Z | Screen color temperature manager |
+| [rootbar](https://hg.sr.ht/~scoopta/rootbar) | 2020-04-07 01:06:53 | Root Bar is a bar for wlroots based wayland compositors such as sway and was designed to address the lack of good bars for wayland |
+| [slurp](https://github.com/emersion/slurp) | 2020-08-03 09:44:19Z | Select a region in a Wayland compositor |
+| [sway](https://swaywm.org) | 2020-08-11 22:37:11Z | i3-compatible tiling Wayland compositor |
+| [swaybg](https://github.com/swaywm/swaybg) | 2019-08-08 23:03:44Z | Wallpaper tool for Wayland compositors |
+| [swayidle](https://swaywm.org) | 2020-04-30 10:15:57Z | Sway's idle management daemon |
+| [swaylock](https://swaywm.org) | 2020-07-13 13:49:10Z | Screen locker for Wayland |
+| [waybar](https://github.com/Alexays/Waybar) | 2020-08-15 08:59:12Z | Highly customizable Wayland Polybar like bar for Sway and Wlroots based compositors. |
+| [waybox](https://github.com/wizbright/waybox) | 2020-05-01 03:02:14Z | An openbox clone on Wayland (WIP) |
+| [wayfire](https://wayfire.org/) | 2020-08-15 15:55:56Z | 3D wayland compositor |
+| [waypipe](https://gitlab.freedesktop.org/mstoeckl/waypipe/) | 2020-07-06 00:16:52Z | Network transparency with Wayland |
+| [wayvnc](https://github.com/any1/wayvnc) | 2020-07-31 18:23:25Z | A VNC server for wlroots based Wayland compositors |
+| [wdisplays](https://github.com/cyclopsian/wdisplays) | 2020-05-09 19:42:15Z | GUI display configurator for wlroots compositors |
+| [wev](https://git.sr.ht/~sircmpwn/wev) | 2020-07-07 15:20:53Z | A tool for debugging events on a Wayland window, analagous to the X11 tool xev. |
+| [wf-recorder](https://github.com/ammen99/wf-recorder) | 2020-07-19 12:45:44Z | Utility program for screen recording of wlroots-based compositors |
+| [wl-clipboard](https://github.com/bugaevc/wl-clipboard) | 2020-02-13 16:44:26Z | Select a region in a Wayland compositor |
+| [wl-gammactl](https://github.com/mischw/wl-gammactl) | 2020-02-16 12:53:36Z | Small GTK GUI application to set contrast, brightness and gamma for wayland compositors which support the wlr-gamma-control protocol extension. |
+| [wlay](https://github.com/atx/wlay) | 2019-07-04 17:03:15Z | Graphical output management for Wayland |
+| [wldash](https://wldash.org) | 2020-07-22 10:42:48Z | Wayland launcher/dashboard |
+| [wlfreerdp](http://www.freerdp.com/) | 2020-08-11 12:34:07Z | A Remote Desktop Protocol Client |
+| [wlogout](https://github.com/ArtsyMacaw/wlogout) | 2020-03-14 05:34:47Z | A wayland based logout menu |
+| [wlr-randr](https://github.com/emersion/wlr-randr) | 2020-07-27 14:33:25Z | An xrandr clone for wlroots compositors |
+| [wlroots](https://github.com/swaywm/wlroots) | 2020-08-14 15:57:31Z | A modular Wayland compositor library |
+| [wltrunk](https://git.sr.ht/~bl4ckb0ne/wltrunk) | 2020-03-11 13:38:35Z (pinned) | High-level Wayland compositor library based on wlroots |
+| [wofi](https://hg.sr.ht/~scoopta/wofi) | 2020-08-11 19:07:49 | Wofi is a launcher/menu program for wlroots based wayland compositors such as sway |
+| [wtype](https://github.com/atx/wtype) | 2020-08-05 16:06:59Z | xdotool type for wayland |
+| [xdg-desktop-portal-wlr](https://github.com/emersion/xdg-desktop-portal-wlr) | 2020-08-07 16:33:26Z | xdg-desktop-portal backend for wlroots |
+<!--pkgs-->
+
+</details>
+
+## Tips
+
+#### `sway`
+
+* You will likely want a default config file to place at `$HOME/.config/sway/config`. You can use the upstream default as a starting point: https://github.com/swaywm/sway/blob/master/config.in
+* I recommend using [`home-manager`](https://github.com/rycee/home-manager/). It has options for enabling and
+  configuring Sway.
+* I've recently learned that simply running `sway` at a TTY can be considered insecure. If Sway crashes, the TTY
+  is left in an unlocked state. Running Sway with a DM or as `exec sway` can help mitigate this concern.
+
+#### `obs-studio` + `wlrobs`
+
+* I recommend using [`home-manager`](https://github.com/rycee/home-manager/). It has options for enabling and
+  configuring OBS and `obs-wlrobs`. Enabling this overlay and those options is sufficient.
+
+## Development Guide
+
+* Use `nix-shell`.
+* `./update.sh`:
+  * updates `nixpkgs/<channel>/metadata.nix` per the upstream channel
+  * updates `pkgs/<pkg>/metadata.nix` with the latest commit+hash for each package
+  * calls `nix-build-uncached build.nix` to build uncached packages (see: [nix-build-uncached](https://github.com/Mic92/nix-build-uncached))
+  * pushes to ["nixpkgs-wayland" on cachix](https://nixpkgs-wayland.cachix.org)
+
+Note: in some cases, you may need to manually update `cargoSha256` or `vendorSha256` in `pkgs/<pkg>/metadata.nix` as well.
+
+If for some reason the overlay isn't progressing and you want to help, just clone the repo, run `nix-shell --command ./update.sh`
+and start fixing issues in the package definitions. Sometimes you might need to edit `default.nix` to change the version
+ of `wlroots` a certain package uses.
diff --git a/overlays/patches/nixpkgs-wayland/default.nix b/overlays/patches/nixpkgs-wayland/default.nix
new file mode 100644
index 000000000000..2e2aab7895f1
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/default.nix
@@ -0,0 +1,71 @@
+self: pkgs:
+let
+waylandPkgs = rec {
+  # wlroots-related
+  cage             = pkgs.callPackage ./pkgs/cage {};
+  drm_info         = pkgs.callPackage ./pkgs/drm_info {};
+  emacs-pgtk       = pkgs.callPackage ./pkgs/emacs {};
+  gebaar-libinput  = pkgs.callPackage ./pkgs/gebaar-libinput {};
+  glpaper          = pkgs.callPackage ./pkgs/glpaper {};
+  grim             = pkgs.callPackage ./pkgs/grim {};
+  kanshi           = pkgs.callPackage ./pkgs/kanshi {};
+  imv              = pkgs.callPackage ./pkgs/imv {};
+  lavalauncher     = pkgs.callPackage ./pkgs/lavalauncher {};
+  mako             = pkgs.callPackage ./pkgs/mako {};
+  oguri            = pkgs.callPackage ./pkgs/oguri {};
+  rootbar          = pkgs.callPackage ./pkgs/rootbar {};
+  slurp            = pkgs.callPackage ./pkgs/slurp {};
+  sway-unwrapped   = pkgs.callPackage ./pkgs/sway {};
+  swaybg           = pkgs.callPackage ./pkgs/swaybg {};
+  swayidle         = pkgs.callPackage ./pkgs/swayidle {};
+  swaylock         = pkgs.callPackage ./pkgs/swaylock {};
+  waybar           = pkgs.callPackage ./pkgs/waybar {};
+  waybox           = pkgs.callPackage ./pkgs/waybox { wlroots = wlroots-0-9-x; };
+  waypipe          = pkgs.callPackage ./pkgs/waypipe {};
+  wayvnc           = pkgs.callPackage ./pkgs/wayvnc {};
+  wdisplays        = pkgs.callPackage ./pkgs/wdisplays {};
+  wev              = pkgs.callPackage ./pkgs/wev {};
+  wf-recorder      = pkgs.callPackage ./pkgs/wf-recorder {};
+  wlay             = pkgs.callPackage ./pkgs/wlay {};
+  obs-wlrobs       = pkgs.callPackage ./pkgs/obs-wlrobs {};
+  wl-clipboard     = pkgs.callPackage ./pkgs/wl-clipboard {};
+  wl-gammactl      = pkgs.callPackage ./pkgs/wl-gammactl {};
+  wldash           = pkgs.callPackage ./pkgs/wldash {};
+  wlogout          = pkgs.callPackage ./pkgs/wlogout {};
+  wlroots          = pkgs.callPackage ./pkgs/wlroots {};
+  wlr-randr        = pkgs.callPackage ./pkgs/wlr-randr {};
+  wofi             = pkgs.callPackage ./pkgs/wofi {};
+  wtype            = pkgs.callPackage ./pkgs/wtype {};
+  xdg-desktop-portal-wlr = pkgs.callPackage ./pkgs/xdg-desktop-portal-wlr {};
+
+  gtk-layer-shell = pkgs.callPackage ./pkgs/gtk-layer-shell {};
+  clipman = pkgs.callPackage ./pkgs/clipman {};
+
+  wlroots-tmp = pkgs.callPackage ./pkgs-temp/wlroots {};
+  wlroots-0-9-x = pkgs.callPackage ./pkgs-temp/wlroots-0-9-x {};
+
+  # misc
+  redshift-wayland = pkgs.callPackage ./pkgs/redshift-wayland {
+    inherit (pkgs.python3Packages) python pygobject3 pyxdg wrapPython;
+    geoclue = pkgs.geoclue2;
+  };
+  aml = pkgs.callPackage ./pkgs/aml {};
+  neatvnc = pkgs.callPackage ./pkgs/neatvnc {};
+  obs-studio = pkgs.libsForQt5.callPackage ./pkgs/obs-studio { ffmpeg = pkgs.ffmpeg_4; };
+  wlfreerdp = pkgs.callPackage ./pkgs/wlfreerdp {
+    inherit (pkgs) libpulseaudio;
+    inherit (pkgs.gst_all_1) gstreamer gst-plugins-base gst-plugins-good;
+  };
+
+  # i3 related
+  i3status-rust    = pkgs.callPackage ./pkgs/i3status-rust {};
+
+  # wayfire stuff
+  wayfire          = pkgs.callPackage ./pkgs/wayfire {};
+
+  # bspwc/wltrunk stuff
+  bspwc    = pkgs.callPackage ./pkgs/bspwc { wlroots = wlroots-tmp; };
+  wltrunk  = pkgs.callPackage ./pkgs/wltrunk { wlroots = wlroots-tmp; };
+};
+in
+  waylandPkgs // { inherit waylandPkgs; }
diff --git a/overlays/patches/nixpkgs-wayland/demo/README.md b/overlays/patches/nixpkgs-wayland/demo/README.md
new file mode 100644
index 000000000000..2aebdff76fc0
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/demo/README.md
@@ -0,0 +1,9 @@
+# Demo
+
+This is a WIP demo
+
+## QEMU Demo
+
+    ./vm-build.sh && ./vm-run.sh
+    
+
diff --git a/overlays/patches/nixpkgs-wayland/demo/configuration.nix b/overlays/patches/nixpkgs-wayland/demo/configuration.nix
new file mode 100644
index 000000000000..4f3a55177f0c
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/demo/configuration.nix
@@ -0,0 +1,37 @@
+{ ... }: {
+  imports = [
+    (import ./profile.nix { user = "demo"; })
+  ];
+
+  nix.trustedUsers = [ "root" "@wheel" ];
+
+  security.sudo.enable = true;
+
+  users.users.demo = {
+    uid = 1000;
+    isNormalUser = true;
+    password = "demo1234";
+    #hashedPassword = "$6$3vp.8UtiX$XSiK9o.4OMB1e.NWH9TebK2GigdAX2HvH9w0XUnv9gU2a96b6zLQCRS7HNnApafK16K2puxWjnC0A.eriwpUD1";
+    extraGroups = [
+      # allow demo to administer the machine
+      "wheel"
+    ];
+  };
+
+  users.users.root = {
+    password = "root1234";
+  };
+
+  services.xserver.enable = false;
+
+  services.mingetty.helpLine = ''
+
+       Welcome to the Sway demo
+
+    login: demo
+    password: demo1234
+
+    Once logged-in, type `sway` to start the desktop environment.
+  '';
+}
+
diff --git a/overlays/patches/nixpkgs-wayland/demo/home/i3status-rs.toml b/overlays/patches/nixpkgs-wayland/demo/home/i3status-rs.toml
new file mode 100644
index 000000000000..66154989d75c
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/demo/home/i3status-rs.toml
@@ -0,0 +1,66 @@
+# See https://github.com/greshake/i3status-rust/blob/master/blocks.md
+
+#theme = "solarized-dark"
+#theme = "slick"
+icons = "awesome"
+#icons = "material"
+
+[theme]
+name = "slick"
+
+#https://github.com/greshake/i3status-rust/wiki/Theming-&-Icons
+# [theme.overrides]
+# idle_bg = "#123456"
+# idle_fg = "#abcdef"
+
+[[block]]
+block = "memory"
+display_type = "memory"
+format_mem = "{Mup}%"
+format_swap = "{SUp}%"
+
+[[block]]
+block = "cpu"
+interval = 1
+
+[[block]]
+block = "load"
+interval = 1
+format = "{1m}"
+
+[[block]]
+block = "net"
+#device = "wlp4s0"
+ssid = true
+ip = true
+speed_up = false
+graph_up = true
+interval = 5
+
+# [[block]]
+# block = "music"
+# player = "spotify"
+# buttons = ["play", "next"]
+
+# [[block]]
+# block = "xrandr"
+# icons = true
+# resolution = true
+# interval = 2
+
+#[[block]]
+#block = "backlight"
+#device = "intel_backlight"
+
+[[block]]
+block = "sound"
+on_click = "pavucontrol"
+
+#[[block]]
+#block = "battery"
+#interval = 10
+
+[[block]]
+block = "time"
+interval = 60
+format = "%a %d/%m %R"
diff --git a/overlays/patches/nixpkgs-wayland/demo/home/profile.nix b/overlays/patches/nixpkgs-wayland/demo/home/profile.nix
new file mode 100644
index 000000000000..aa8ff8331c8c
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/demo/home/profile.nix
@@ -0,0 +1,52 @@
+{ pkgs, ... }: {
+  home.packages = with pkgs; [
+    brightnessctl
+    dmenu
+    pavucontrol
+    playerctl
+    termite
+    xdg_utils # needed for termite URL opening
+    xwayland
+  ] ++ (with waylandPkgs; [
+    grim # screenshot CLI
+    i3status-rust # menu bar
+    kanshi # broken: display configurator
+    mako # notification manager
+    redshift-wayland # ???
+    slurp # dimension-grabbing CLI, to use with grim
+    swayidle # lock screen manager
+    wlstream # screen recording CLI
+  ]);
+
+  programs.termite.enable = true;
+  programs.termite.scrollbackLines = 10000;
+
+  programs.firefox.enable = true;
+
+  # FIXME: doesn't work yet
+  xsession.enable = true;
+  xsession.windowManager.command = "sway";
+
+  xdg.enable = true;
+  xdg.configFile."sway/config" = {
+    source = pkgs.substituteAll {
+      name = "sway-config";
+      src = ./sway-config;
+      wallpaper = ./wallpaper.jpg;
+      i3status = ./i3status-rs.toml;
+    };
+    onChange = ''
+      echo "Reloading sway"
+      #FIXME: swaymsg reload
+    '';
+  };
+
+  xdg.configFile."chromium-flags.conf" = {
+    source = pkgs.writeText "chromium-flags.conf" ''
+      --force-device-scale-factor=1
+    '';
+  };
+
+  gtk.enable = true;
+  gtk.gtk3.waylandSupport = true;
+}
diff --git a/overlays/patches/nixpkgs-wayland/demo/home/sway-config b/overlays/patches/nixpkgs-wayland/demo/home/sway-config
new file mode 100644
index 000000000000..eab473f3c92a
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/demo/home/sway-config
@@ -0,0 +1,243 @@
+# Default config for sway
+#
+# Copy this to ~/.config/sway/config and edit it to your liking.
+#
+# Read `man 5 sway` for a complete reference.
+
+### Variables
+#
+# Logo key. Use Mod1 for Alt.
+set $mod Mod4
+# Home row direction keys, like vim
+set $left h
+set $down j
+set $up k
+set $right l
+# Your preferred terminal emulator
+#set $term urxvt
+set $term termite
+# alacritty
+# Your preferred application launcher
+# Note: it's recommended that you pass the final command to sway
+set $menu dmenu_path | dmenu | xargs swaymsg exec
+
+### Output configuration
+#
+# Default wallpaper (more resolutions are available in __DATADIR__/backgrounds/sway/)
+output * bg @wallpaper@ fill
+
+output eDP-1 scale 1.5
+
+#
+# Example configuration:
+#
+#   output HDMI-A-1 resolution 1920x1080 position 1920,0
+#
+# You can get the names of your outputs by running: swaymsg -t get_outputs
+
+### Idle configuration
+#
+# Example configuration:
+#
+exec swayidle \
+    timeout 500 'swaylock -c 000000' \
+    timeout 600 'swaymsg "output * dpms off"' \
+       resume 'swaymsg "output * dpms on"' \
+    before-sleep 'swaylock -c 000000'
+
+# Start the notification center
+exec mako --default-timeout 50000
+
+# Start one shell
+exec $term
+
+# This will lock your screen after 300 seconds of inactivity, then turn off
+# your displays after another 600 seconds, and turn your screens back on when
+# resumed. It will also lock your screen before your computer goes to sleep.
+
+### Input configuration
+#
+# Example configuration:
+#
+#   input "2:14:SynPS/2_Synaptics_TouchPad" {
+#       dwt enabled
+#       tap enabled
+#       natural_scroll enabled
+#       middle_emulation enabled
+#   }
+#
+# You can get the names of your inputs by running: swaymsg -t get_inputs
+# Read `man 5 sway-input` for more information about this section.
+
+input "1386:888:Wacom_Intuos_BT_M_Pen" {
+  map_to_output HDMI-A-2
+  # FIXME: map BTN_0 to BTN_3, BTN_STYLUS and BTN_STYLUS2 buttons
+}
+
+### Key bindings
+#
+# Basics:
+#
+    # start a terminal
+    bindsym $mod+Return exec $term
+
+    # kill focused window
+    bindsym $mod+Shift+q kill
+
+    # start your launcher
+    bindsym $mod+d exec $menu
+    bindsym $mod+p exec $menu
+
+    # Drag floating windows by holding down $mod and left mouse button.
+    # Resize them with right mouse button + $mod.
+    # Despite the name, also works for non-floating windows.
+    # Change normal to inverse to use left mouse button for resizing and right
+    # mouse button for dragging.
+    floating_modifier $mod normal
+
+    # reload the configuration file
+    bindsym $mod+Shift+c reload
+
+    # exit sway (logs you out of your Wayland session)
+    bindsym $mod+Shift+e exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit'
+#
+# Moving around:
+#
+    # Move your focus around
+    bindsym $mod+$left focus left
+    bindsym $mod+$down focus down
+    bindsym $mod+$up focus up
+    bindsym $mod+$right focus right
+    # or use $mod+[up|down|left|right]
+    bindsym $mod+Left focus left
+    bindsym $mod+Down focus down
+    bindsym $mod+Up focus up
+    bindsym $mod+Right focus right
+
+    # _move_ the focused window with the same, but add Shift
+    bindsym $mod+Shift+$left move left
+    bindsym $mod+Shift+$down move down
+    bindsym $mod+Shift+$up move up
+    bindsym $mod+Shift+$right move right
+    # ditto, with arrow keys
+    bindsym $mod+Shift+Left move left
+    bindsym $mod+Shift+Down move down
+    bindsym $mod+Shift+Up move up
+    bindsym $mod+Shift+Right move right
+#
+# Workspaces:
+#
+    # switch to workspace
+    bindsym $mod+1 workspace 1
+    bindsym $mod+2 workspace 2
+    bindsym $mod+3 workspace 3
+    bindsym $mod+4 workspace 4
+    bindsym $mod+5 workspace 5
+    bindsym $mod+6 workspace 6
+    bindsym $mod+7 workspace 7
+    bindsym $mod+8 workspace 8
+    bindsym $mod+9 workspace 9
+    bindsym $mod+0 workspace 10
+    # move focused container to workspace
+    bindsym $mod+Shift+1 move container to workspace 1
+    bindsym $mod+Shift+2 move container to workspace 2
+    bindsym $mod+Shift+3 move container to workspace 3
+    bindsym $mod+Shift+4 move container to workspace 4
+    bindsym $mod+Shift+5 move container to workspace 5
+    bindsym $mod+Shift+6 move container to workspace 6
+    bindsym $mod+Shift+7 move container to workspace 7
+    bindsym $mod+Shift+8 move container to workspace 8
+    bindsym $mod+Shift+9 move container to workspace 9
+    bindsym $mod+Shift+0 move container to workspace 10
+    # Note: workspaces can have any name you want, not just numbers.
+    # We just use 1-10 as the default.
+#
+# Layout stuff:
+#
+    # You can "split" the current object of your focus with
+    # $mod+b or $mod+v, for horizontal and vertical splits
+    # respectively.
+    bindsym $mod+b splith
+    bindsym $mod+v splitv
+
+    # Switch the current container between different layout styles
+    bindsym $mod+s layout stacking
+    bindsym $mod+w layout tabbed
+    bindsym $mod+e layout toggle split
+
+    # Make the current focus fullscreen
+    bindsym $mod+f fullscreen
+
+    # Toggle the current focus between tiling and floating mode
+    bindsym $mod+Shift+space floating toggle
+
+    # Swap focus between the tiling area and the floating area
+    bindsym $mod+space focus mode_toggle
+
+    # move focus to the parent container
+    bindsym $mod+a focus parent
+#
+# Scratchpad:
+#
+    # Sway has a "scratchpad", which is a bag of holding for windows.
+    # You can send windows there and get them back later.
+
+    # Move the currently focused window to the scratchpad
+    bindsym $mod+Shift+minus move scratchpad
+
+    # Show the next scratchpad window or hide the focused scratchpad window.
+    # If there are multiple scratchpad windows, this command cycles through them.
+    bindsym $mod+minus scratchpad show
+#
+# Resizing containers:
+#
+mode "resize" {
+    # left will shrink the containers width
+    # right will grow the containers width
+    # up will shrink the containers height
+    # down will grow the containers height
+    bindsym $left resize shrink width 10px
+    bindsym $down resize grow height 10px
+    bindsym $up resize shrink height 10px
+    bindsym $right resize grow width 10px
+
+    # ditto, with arrow keys
+    bindsym Left resize shrink width 10px
+    bindsym Down resize grow height 10px
+    bindsym Up resize shrink height 10px
+    bindsym Right resize grow width 10px
+
+    # return to default mode
+    bindsym Return mode "default"
+    bindsym Escape mode "default"
+}
+bindsym $mod+r mode "resize"
+
+# Media keys
+bindsym XF86AudioLowerVolume exec pactl set-sink-volume $(pacmd list-sinks |awk '/* index:/{print $3}') -5%
+bindsym XF86AudioMute exec pactl set-sink-mute $(pacmd list-sinks |awk '/* index:/{print $3}') toggle
+bindsym XF86AudioNext exec playerctl next
+bindsym XF86AudioPlay exec playerctl play-pause
+bindsym XF86AudioPrev exec playerctl previous
+bindsym XF86AudioRaiseVolume exec pactl set-sink-volume $(pacmd list-sinks |awk '/* index:/{print $3}') +5%
+bindsym XF86MonBrightnessDown exec brightnessctl set 5%-
+bindsym XF86MonBrightnessUp exec brightnessctl set +5%
+bindsym XF86LaunchB exec $menu
+#
+# Status Bar:
+#
+# Read `man 5 sway-bar` for more information about this section.
+bar {
+    position top
+
+    # When the status_command prints a new line to stdout, swaybar updates.
+    # The default just shows the current date and time.
+    #status_command while date +'%Y-%m-%d %l:%M:%S %p'; do sleep 1; done
+    status_command i3status-rs @i3status@
+
+    colors {
+        statusline #ffffff
+        background #323232
+        inactive_workspace #32323200 #32323200 #5c5c5c
+    }
+}
diff --git a/overlays/patches/nixpkgs-wayland/demo/home/wallpaper.jpg b/overlays/patches/nixpkgs-wayland/demo/home/wallpaper.jpg
new file mode 100644
index 000000000000..0500d18da321
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/demo/home/wallpaper.jpg
Binary files differdiff --git a/overlays/patches/nixpkgs-wayland/demo/profile.nix b/overlays/patches/nixpkgs-wayland/demo/profile.nix
new file mode 100644
index 000000000000..87d490576ac6
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/demo/profile.nix
@@ -0,0 +1,66 @@
+{ user }:
+{ pkgs, ... }@args:
+let
+  home-manager = builtins.fetchTarball https://github.com/rycee/home-manager/archive/master.tar.gz;
+in
+{
+  imports = [
+    "${home-manager}/nixos"
+  ];
+
+  nixpkgs.overlays = [ (import ../.) ];
+
+  # When this is enabled, the QEMU VM goes blank after boot
+  #networking.networkmanager.enable = true;
+
+  fonts.fonts = with pkgs; [
+    dejavu_fonts    # just a basic good fond
+    font-awesome_5  # needed by i3status-rust
+  ];
+
+  # add sound support
+  hardware.pulseaudio.enable = true;
+
+  # to allow control of the screen brightness
+  hardware.brightnessctl.enable = true;
+
+  # setup the user's  home
+  home-manager.users."${user}" = (import ./home/profile.nix) args;
+
+  # Sway
+  programs.sway-beta.enable = true;
+  programs.sway-beta.extraSessionCommands = ''
+    # Tell toolkits to use wayland
+    export CLUTTER_BACKEND=wayland
+    #export QT_QPA_PLATFORM=wayland-egl
+    export QT_WAYLAND_DISABLE_WINDOWDECORATION=1
+    export SDL_VIDEODRIVER=wayland
+
+    # Fix krita and other Egl-using apps
+    export LD_LIBRARY_PATH=/run/opengl-driver/lib
+
+    # Disable HiDPI scaling for X apps
+    # https://wiki.archlinux.org/index.php/HiDPI#GUI_toolkits
+    export GDK_SCALE=1
+    export QT_AUTO_SCREEN_SCALE_FACTOR=0
+  '';
+
+  # manage those with home-manager
+  programs.sway-beta.extraPackages = [];
+
+  # Add the required groups for the user to get access
+  users.extraUsers."${user}" = {
+    extraGroups = [
+      # allow sudo
+      "wheel"
+      "input"
+      "tty"
+      "audio"
+      "video"
+      # allow sway's setuid executable
+      "sway"
+      "networkmanager"
+    ];
+  };
+
+}
diff --git a/overlays/patches/nixpkgs-wayland/demo/vm-build.sh b/overlays/patches/nixpkgs-wayland/demo/vm-build.sh
new file mode 100755
index 000000000000..71a9ed753cb7
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/demo/vm-build.sh
@@ -0,0 +1,4 @@
+#!/usr/bin/env bash
+nix-build '<nixpkgs/nixos>' \
+  --argstr configuration "$PWD/configuration.nix" \
+  -A vm
diff --git a/overlays/patches/nixpkgs-wayland/demo/vm-run.sh b/overlays/patches/nixpkgs-wayland/demo/vm-run.sh
new file mode 100755
index 000000000000..98960f9889ec
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/demo/vm-run.sh
@@ -0,0 +1,8 @@
+#!/usr/bin/env bash
+
+if [[ ! -e ./result ]]; then
+  echo Run ./vm-build.sh first
+  exit 1
+fi
+
+exec ./result/bin/run-nixos-vm
diff --git a/overlays/patches/nixpkgs-wayland/docs/sway-on-ubuntu/README.md b/overlays/patches/nixpkgs-wayland/docs/sway-on-ubuntu/README.md
new file mode 100644
index 000000000000..e1bd4bf17076
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/docs/sway-on-ubuntu/README.md
@@ -0,0 +1,136 @@
+# Sway on non-NixOS Distributions
+
+Note, we no longer build this overlay against `nixpkgs-unstable`.
+This means that if you follow this guide, you will wind up building
+`wlroots`, `sway`, etc from source. It doesn't take a long time,
+but it won't be pre-cached like the guide/video imply.
+
+## Walkthrough - NixGL + Sway on Ubuntu
+
+This guide will walk you through running `sway` on Ubuntu 18.10 via `nix` and `nixpkgs`.
+
+At a high-level:
+1. Install `nix`
+2. Configure `nix` to use our binary cache where these packages are built against various versions of `nixpkgs`
+3. Install `NixGL` allowing us to use OpenGL nix packages on non-NixOS distros
+4. Install `sway-beta` from `nixpkgs` and this overlay
+5. Configure `sway-beta` with some settings for this demo
+5. Drop to a TTY and run it!
+
+### Quick Version
+
+If you'd like the quick version, you can use the quickshot `execute.sh` script in this directory:
+```
+cd /tmp
+wget https://raw.githubusercontent.com/colemickens/nixpkgs-wayland/master/docs/sway-on-ubuntu/execute.sh
+chmod +x execute.sh
+./execute.sh
+```
+
+[![Quick Steps Video on YouTube](https://img.youtube.com/vi/Sri_24TJtFI/0.jpg)](https://www.youtube.com/watch?v=Sri_24TJtFI)
+
+You can then skip to the end.
+
+### Detailed Version
+
+#### Install Nix
+
+Per the instructions on the NixOS Wiki: [Nix Installation Guide - Single User Install](https://nixos.wiki/wiki/Nix_Installation_Guide):
+```bash
+sudo apt update; sudo apt install curl git
+sudo install -d -m755 -o $(id -u) -g $(id -g) /nix
+curl https://nixos.org/nix/install | sh
+source .nix-profile/etc/profile.d/nix.sh
+```
+
+(I recommend you logout/login here, so you don't need
+to continue to source the nix profile in each shell.)
+
+
+#### Install Cachix
+
+`cachix` is a service that provides binary caching and a CLI
+that enables easy uploading to and trusting of binary caches.
+
+This will install `cachix` from a specific snapshot of `nixpkgs`
+and make it available in your environment. **It will then trust
+the binary cache that contains builds from this overlay.**
+
+```bash
+nix-env -iA cachix -f https://github.com/NixOS/nixpkgs/tarball/889c72032f8595fcd7542c6032c208f6b8033db6
+
+# note that only the official NixOS cache is listed (cache.nixos.org)
+cat ~/.config/nix
+
+# ignore errors from this command (https://github.com/cachix/cachix/issues/148)
+cachix use nixpkgs-wayland
+
+# note that now the nixpkgs-wayland.cachix.org server is trusted
+cat ~/.config/nix
+```
+
+This will cause future `nix` commands to check with our binary cache
+instead of building everything from scratch. This repository is built against
+`nixpkgs-unstable` which is what you're now using, so you shouldn't have to
+build anything. Even if you did, `nix` effectively guarantees it will "just build"m,
+assuming enough RAM, CPU, etc.
+
+#### Enable the `nixpkgs-wayland` overlay
+
+```bash
+mkdir -p $HOME/.config/nixpkgs/overlays
+git clone https://github.com/colemickens/nixpkgs-wayland.git \
+  $HOME/.config/nixpkgs/overlays/nixpkgs-wayland
+```
+
+#### Install NixGL and Sway
+
+OpenGL enabled Nix applications on non-NixOS operating systems require
+the use of a wrapper. I've added some summary details to the NixOS Wiki:
+[Nixpkgs with OpenGL on non-NixOS](https://nixos.wiki/wiki/Nixpkgs_with_OpenGL_on_non-NixOS)
+
+**Install NixGL and OpenGL drivers**
+
+(Change the attribute to be installed per your GL vendor.)
+```bash
+curl -L --fail https://raw.githubusercontent.com/guibou/nixGL/master/default.nix > /tmp/nixgl.nix
+```
+**Install Sway and related tools**
+```bash
+nix-env -iA nixGLIntel -f /tmp/nixgl.nix
+nix-env -iA nixpkgs.sway-beta nixpkgs.dmenu nixpkgs.mako nixpkgs.slurp nixpkgs.grim
+```
+
+This will install `sway-beta` the default configured channel for the Nix install you
+performed at the beginning, which is named `nixpkgs`. In our case though, `sway-beta`
+is overriden to a newer version by use of this overlay.
+
+**Install a demo Sway config**
+Install the default sway config:
+```bash
+mkdir -p $HOME/.config/sway
+wget 'https://raw.githubusercontent.com/swaywm/sway/master/config.in' \
+  -O $HOME/.config/sway/config
+
+sed -i 's|Mod4|Mod1|g' ~/.config/sway/config
+sed -i '/Sway_Wallpaper_Blue_1920x1080.png/d' ~/.config/sway/config
+sed -i 's|urxvt|gnome-terminal|g' ~/.config/sway/config
+```
+
+##### Run Sway
+
+Let's drop to a TTY and try sway. **Note, this will stop GDM and your current session!**
+
+```bash
+# stop the graphical session
+sudo systemctl isolate multi-user.target
+
+# switch to another TTY
+# ctrl+alt+f3
+
+# on TTY
+nixGLIntel sway
+```
+
+You can run `sway` under GNOME as well, but there are some oddities about where windows spawn.
+
diff --git a/overlays/patches/nixpkgs-wayland/docs/sway-on-ubuntu/execute.sh b/overlays/patches/nixpkgs-wayland/docs/sway-on-ubuntu/execute.sh
new file mode 100755
index 000000000000..092acbadeb99
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/docs/sway-on-ubuntu/execute.sh
@@ -0,0 +1,57 @@
+#!/usr/bin/env bash
+set +x
+echo "---------------------------------------------"
+echo "install nix"
+sudo apt-get update -qqy &>/dev/null; sudo apt-get install -qqy curl git &>/dev/null
+[[ -f "${HOME}/.nix-profile/etc/profile.d/nix.sh" ]] && source ${HOME}/.nix-profile/etc/profile.d/nix.sh
+if ! which nix-env ; then
+  sudo install -d -m755 -o $(id -u) -g $(id -g) /nix
+  curl --silent --fail https://nixos.org/nix/install | sh
+fi
+. "${HOME}/.nix-profile/etc/profile.d/nix.sh"
+
+set -euo pipefail
+echo "---------------------------------------------"
+echo "install cachix"
+nix-env -iA cachix -f "https://github.com/NixOS/nixpkgs/tarball/889c72032f8595fcd7542c6032c208f6b8033db6"
+
+echo "---------------------------------------------"
+echo "use nixpkgs-wayland binary cache"
+cachix use "nixpkgs-wayland"
+
+echo "---------------------------------------------"
+echo "activate \"nixpkgs-wayland\" overlay"
+mkdir -p "$HOME/.config/nixpkgs/overlays"
+if [[ ! -d "${HOME}/.config/nixpkgs/overlays/nixpkgs-wayland" ]]; then
+  git clone "https://github.com/colemickens/nixpkgs-wayland.git" \
+    "$HOME/.config/nixpkgs/overlays/nixpkgs-wayland"
+fi
+
+echo "---------------------------------------------"
+echo "install NixGL, sway, and sway tools"
+curl -L --fail https://raw.githubusercontent.com/guibou/nixGL/master/default.nix > /tmp/nixgl.nix
+nix-env -iA nixGLIntel -f /tmp/nixgl.nix
+nix-env -iA nixpkgs.sway-beta nixpkgs.dmenu nixpkgs.mako nixpkgs.slurp nixpkgs.grim
+
+echo "---------------------------------------------"
+echo "configuring sway"
+mkdir -p $HOME/.config/sway
+wget 'https://raw.githubusercontent.com/swaywm/sway/master/config.in' \
+  -O $HOME/.config/sway/config
+
+sed -i 's|Mod4|Mod1|g' ~/.config/sway/config
+sed -i '/Sway_Wallpaper_Blue_1920x1080.png/d' ~/.config/sway/config
+sed -i 's|urxvt|gnome-terminal|g' ~/.config/sway/config
+
+echo "---------------------------------------------"
+echo "done"
+echo "---------------------------------------------"
+echo "now run:"
+echo " - sudo systemctl isolate multi-user.target (this will stop your GDM session)"
+echo " - nixGLIntel sway"
+echo "when in sway:"
+echo " - 'alt+d' starts 'dmenu'"
+echo " - 'alt+enter' starts 'gnome-terminal'"
+echo "---------------------------------------------"
+echo
+
diff --git a/overlays/patches/nixpkgs-wayland/flake.lock b/overlays/patches/nixpkgs-wayland/flake.lock
new file mode 100644
index 000000000000..2bdf258a4dfb
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/flake.lock
@@ -0,0 +1,77 @@
+{
+  "nodes": {
+    "cachixpkgs": {
+      "locked": {
+        "lastModified": 1597444211,
+        "narHash": "sha256-5JlVzauHV4XlqxVweI9nMhMNszmmfNjFP8lqB5pnDcI=",
+        "owner": "nixos",
+        "repo": "nixpkgs",
+        "rev": "3506bce1d405f078c09a5201e3bb46eb64d5e9e7",
+        "type": "github"
+      },
+      "original": {
+        "owner": "nixos",
+        "ref": "nixos-20.03",
+        "repo": "nixpkgs",
+        "type": "github"
+      }
+    },
+    "flake-utils": {
+      "locked": {
+        "lastModified": 1597053966,
+        "narHash": "sha256-f9lbPS/GJ1His8fsDqM6gfa8kSqREU4eKiMCS5hrKg4=",
+        "owner": "numtide",
+        "repo": "flake-utils",
+        "rev": "ec20f52e2ff61e9c36c2b894b62fc1b4bd04c71b",
+        "type": "github"
+      },
+      "original": {
+        "owner": "numtide",
+        "repo": "flake-utils",
+        "type": "github"
+      }
+    },
+    "master": {
+      "locked": {
+        "lastModified": 1597513517,
+        "narHash": "sha256-yl0vdQwRmnDIghfEBvk0n4owCPywxeu8c8r/cCeLgaI=",
+        "owner": "nixos",
+        "repo": "nixpkgs",
+        "rev": "10d8738108fdedd683f14d70279577f28ac283b8",
+        "type": "github"
+      },
+      "original": {
+        "owner": "nixos",
+        "ref": "master",
+        "repo": "nixpkgs",
+        "type": "github"
+      }
+    },
+    "nixpkgs": {
+      "locked": {
+        "lastModified": 1597482472,
+        "narHash": "sha256-Cq4QYgWSpXr2OSTJDR+ZkZzqQBbHc3TyKWzmrYlE2TE=",
+        "owner": "colemickens",
+        "repo": "nixpkgs",
+        "rev": "5c463ebff3ff7a2554aff704cc32d6edecc70636",
+        "type": "github"
+      },
+      "original": {
+        "owner": "colemickens",
+        "ref": "cmpkgs",
+        "repo": "nixpkgs",
+        "type": "github"
+      }
+    },
+    "root": {
+      "inputs": {
+        "cachixpkgs": "cachixpkgs",
+        "flake-utils": "flake-utils",
+        "master": "master",
+        "nixpkgs": "nixpkgs"
+      }
+    }
+  },
+  "root": "root",
+  "version": 7
+}
diff --git a/overlays/patches/nixpkgs-wayland/flake.nix b/overlays/patches/nixpkgs-wayland/flake.nix
new file mode 100644
index 000000000000..3311d30d8b81
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/flake.nix
@@ -0,0 +1,89 @@
+

+{

+  # TODO: rename git repo to 'flake-wayland-apps'

+  description = "wayland-apps";

+

+  inputs = {

+    master = { url = "github:nixos/nixpkgs/master"; };

+    #nixpkgs = { url = "github:nixos/nixpkgs/nixos-unstable"; };

+    nixpkgs = { url = "github:colemickens/nixpkgs/cmpkgs"; }; # TODO: revert soon

+    cachixpkgs = { url = "github:nixos/nixpkgs/nixos-20.03"; };

+    flake-utils = { url = "github:numtide/flake-utils"; }; # TODO: adopt this

+  };

+

+  outputs = inputs:

+    let

+      metadata = builtins.fromJSON (builtins.readFile ./latest.json);

+

+      nameValuePair = name: value: { inherit name value; };

+      genAttrs = names: f: builtins.listToAttrs (map (n: nameValuePair n (f n)) names);

+      forAllSystems = genAttrs [ "x86_64-linux" "aarch64-linux" ];

+

+      pkgsFor = pkgs: system: includeOverlay:

+        import pkgs {

+          inherit system;

+          config.allowUnfree = true;

+          overlays = if includeOverlay then [

+            (import ./default.nix)            

+          ] else [];

+        };

+    in

+    rec {

+      devShell = forAllSystems (system:

+        let

+          master_ = (pkgsFor inputs.master system false);

+          nixpkgs_ = (pkgsFor inputs.nixpkgs system false);

+          cachixpkgs_ = (pkgsFor inputs.cachixpkgs system false);

+        in

+          nixpkgs_.mkShell {

+            nativeBuildInputs = with nixpkgs_; [

+              bash cacert

+              curl git jq mercurial

+              openssh ripgrep

+

+              cachixpkgs_.cachix

+              master_.nixFlakes

+              master_.nix-build-uncached

+              nixpkgs_.nix-prefetch

+            ];

+          }

+      );

+

+      overlay = final: prev:

+        (import ./default.nix final prev);

+

+      # flakes-util candidate:

+      # make it even more auto to determine sys from the attr name

+      # I think it just needs a genAttrs actually

+      packages = let

+        pkgs = sys:

+          let

+            nixpkgs_ = (pkgsFor inputs.nixpkgs sys true);

+            packagePlatforms = pkg: pkg.meta.hydraPlatforms or pkg.meta.platforms or [ "x86_64-linux" ];

+            pred = n: v: builtins.elem sys (packagePlatforms v);

+          in

+            nixpkgs_.lib.filterAttrs pred nixpkgs_.waylandPkgs;

+      in {

+          x86_64-linux = pkgs "x86_64-linux";

+          aarch64-linux = pkgs "aarch64-linux";

+        };

+

+      # TODO flake-util: join all `inputs.self.packages`

+      # TODO: recursive dependencies aren't checked

+      defaultPackage = forAllSystems (system:

+        let

+          nixpkgs_ = (pkgsFor inputs.nixpkgs system true);

+          attrValues = inputs.nixpkgs.lib.attrValues;

+          out = packages."${system}";

+        in

+          nixpkgs_.symlinkJoin {

+            name = "nixpkgs-wayland";

+            paths = attrValues out;

+          }

+      );

+

+      hydraJobs = {

+        packages = inputs.self.packages;

+      };

+    };

+}

diff --git a/overlays/patches/nixpkgs-wayland/nixpkgs/nixos-unstable/default.nix b/overlays/patches/nixpkgs-wayland/nixpkgs/nixos-unstable/default.nix
new file mode 100644
index 000000000000..377ea09e89fb
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/nixpkgs/nixos-unstable/default.nix
@@ -0,0 +1,7 @@
+let
+  meta = import ./metadata.nix;
+in
+  builtins.fetchTarball {
+    url = "https://github.com/nixos/nixpkgs/archive/${meta.rev}.tar.gz";
+    sha256 = meta.sha256;
+  }
diff --git a/overlays/patches/nixpkgs-wayland/nixpkgs/nixos-unstable/metadata.nix b/overlays/patches/nixpkgs-wayland/nixpkgs/nixos-unstable/metadata.nix
new file mode 100644
index 000000000000..932a2e336c9b
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/nixpkgs/nixos-unstable/metadata.nix
@@ -0,0 +1,8 @@
+{
+  repo_git = "https://github.com/nixos/nixpkgs";
+  branch = "nixos-unstable";
+  url = "https://github.com/nixos/nixpkgs/archive/nixos-unstable.tar.gz";
+  rev = "32b46dd897ab2143a609988a04d87452f0bbef59";
+  sha256 = "1gzfrpjnr1bz9zljsyg3a4zrhk8r927sz761mrgcg56dwinkhpjk";
+  revdate = "2020-08-10 11:11:39Z";
+}
diff --git a/overlays/patches/nixpkgs-wayland/packages.nix b/overlays/patches/nixpkgs-wayland/packages.nix
new file mode 100644
index 000000000000..a989f104d723
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/packages.nix
@@ -0,0 +1,9 @@
+let
+  flake = (import (fetchTarball {
+    url="https://github.com/edolstra/flake-compat/archive/c75e76f80c57784a6734356315b306140646ee84.tar.gz";
+    sha256="071aal00zp2m9knnhddgr2wqzlx6i6qa1263lv1y7bdn2w20h10h";
+  }) {
+    src = builtins.fetchGit ./.;
+  }).defaultNix;
+in
+  flake.packages."${builtins.currentSystem}"
\ No newline at end of file
diff --git a/overlays/patches/nixpkgs-wayland/pkgs-temp/wlroots-0-9-x/default.nix b/overlays/patches/nixpkgs-wayland/pkgs-temp/wlroots-0-9-x/default.nix
new file mode 100644
index 000000000000..19f0e03d22bc
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs-temp/wlroots-0-9-x/default.nix
@@ -0,0 +1,60 @@
+{ stdenv, fetchFromGitHub, meson, ninja, pkgconfig
+, wayland, libGL, wayland-protocols, libinput, libxkbcommon, pixman
+, xcbutilwm, libX11, libcap, xcbutilimage, xcbutilerrors, mesa
+, libpng, ffmpeg_4
+}:
+
+stdenv.mkDerivation rec {
+  pname = "wlroots";
+  version = "0.9.1";
+
+  src = fetchFromGitHub {
+    owner = "swaywm";
+    repo = "wlroots";
+    rev = version;
+    sha256 = "0lh0m5wmr5a73zgqnnrrcnrywy7wjsrs839agiq9hf1yrgav3m8z";
+  };
+
+  # $out for the library and $examples for the example programs (in examples):
+  outputs = [ "out" "examples" ];
+
+  nativeBuildInputs = [ meson ninja pkgconfig ];
+
+  buildInputs = [
+    wayland libGL wayland-protocols libinput libxkbcommon pixman
+    xcbutilwm libX11 libcap xcbutilimage xcbutilerrors mesa
+    libpng ffmpeg_4
+  ];
+
+  mesonFlags = [
+    "-Dlibcap=enabled" "-Dlogind=enabled" "-Dxwayland=enabled" "-Dx11-backend=enabled"
+    "-Dxcb-icccm=enabled" "-Dxcb-errors=enabled"
+    "-Dfreerdp=disabled"
+  ];
+
+  postInstall = ''
+    # Copy the library to $examples
+    mkdir -p $examples/lib
+    cp -P libwlroots* $examples/lib/
+  '';
+
+  postFixup = ''
+    # Install ALL example programs to $examples:
+    # screencopy dmabuf-capture input-inhibitor layer-shell idle-inhibit idle
+    # screenshot output-layout multi-pointer rotation tablet touch pointer
+    # simple
+    mkdir -p $examples/bin
+    cd ./examples
+    for binary in $(find . -executable -type f -printf '%P\n' | grep -vE '\.so'); do
+      cp "$binary" "$examples/bin/wlroots-$binary"
+    done
+  '';
+
+  meta = with stdenv.lib; {
+    description = "A modular Wayland compositor library";
+    inherit (src.meta) homepage;
+    license     = licenses.mit;
+    platforms   = platforms.linux;
+    maintainers = with maintainers; [ primeos ];
+  };
+}
diff --git a/overlays/patches/nixpkgs-wayland/pkgs-temp/wlroots/default.nix b/overlays/patches/nixpkgs-wayland/pkgs-temp/wlroots/default.nix
new file mode 100644
index 000000000000..bd83be504c3a
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs-temp/wlroots/default.nix
@@ -0,0 +1,60 @@
+{ stdenv, fetchFromGitHub, meson, ninja, pkgconfig
+, wayland, libGL, wayland-protocols, libinput, libxkbcommon, pixman
+, xcbutilwm, libX11, libcap, xcbutilimage, xcbutilerrors, mesa
+, libpng, ffmpeg_4
+}:
+
+stdenv.mkDerivation rec {
+  pname = "wlroots";
+  version = "bcd5f7d259690b547d9858d201b1126df78c6451";
+
+  src = fetchFromGitHub {
+    owner = "swaywm";
+    repo = "wlroots";
+    rev = version;
+    sha256 = "1bdsm560g2kfbihhhxmdp3ci129w2kqvn8v73hfgk451fa1hq4ja";
+  };
+
+  # $out for the library and $examples for the example programs (in examples):
+  outputs = [ "out" "examples" ];
+
+  nativeBuildInputs = [ meson ninja pkgconfig ];
+
+  buildInputs = [
+    wayland libGL wayland-protocols libinput libxkbcommon pixman
+    xcbutilwm libX11 libcap xcbutilimage xcbutilerrors mesa
+    libpng ffmpeg_4
+  ];
+
+  mesonFlags = [
+    "-Dlibcap=enabled" "-Dlogind=enabled" "-Dxwayland=enabled" "-Dx11-backend=enabled"
+    "-Dxcb-icccm=enabled" "-Dxcb-errors=enabled"
+    "-Dfreerdp=disabled"
+  ];
+
+  postInstall = ''
+    # Copy the library to $examples
+    mkdir -p $examples/lib
+    cp -P libwlroots* $examples/lib/
+  '';
+
+  postFixup = ''
+    # Install ALL example programs to $examples:
+    # screencopy dmabuf-capture input-inhibitor layer-shell idle-inhibit idle
+    # screenshot output-layout multi-pointer rotation tablet touch pointer
+    # simple
+    mkdir -p $examples/bin
+    cd ./examples
+    for binary in $(find . -executable -type f -printf '%P\n' | grep -vE '\.so'); do
+      cp "$binary" "$examples/bin/wlroots-$binary"
+    done
+  '';
+
+  meta = with stdenv.lib; {
+    description = "A modular Wayland compositor library";
+    inherit (src.meta) homepage;
+    license     = licenses.mit;
+    platforms   = platforms.linux;
+    maintainers = with maintainers; [ primeos ];
+  };
+}
diff --git a/overlays/patches/nixpkgs-wayland/pkgs.nix b/overlays/patches/nixpkgs-wayland/pkgs.nix
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs.nix
diff --git a/overlays/patches/nixpkgs-wayland/pkgs/aml/default.nix b/overlays/patches/nixpkgs-wayland/pkgs/aml/default.nix
new file mode 100644
index 000000000000..a692cd8c81a3
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs/aml/default.nix
@@ -0,0 +1,42 @@
+{ stdenv, fetchFromGitHub
+, pkgconfig, meson, ninja
+, wayland, wayland-protocols
+, libxkbcommon, libvncserver
+, libpthreadstubs, libdrm
+, pixman, libuv, libglvnd
+, gnutls
+}:
+
+let
+  metadata = import ./metadata.nix;
+in
+stdenv.mkDerivation rec {
+  name = "aml-${version}";
+  version = metadata.rev;
+
+  src = fetchFromGitHub {
+    owner = "any1";
+    repo = "aml";
+    rev = metadata.rev;
+    sha256 = metadata.sha256;
+  };
+
+  nativeBuildInputs = [ pkgconfig meson ninja ];
+  buildInputs = [
+    wayland wayland-protocols
+    libxkbcommon libvncserver
+    libpthreadstubs libdrm
+    pixman libuv libglvnd
+    gnutls
+  ];
+
+  enableParallelBuilding = true;
+
+  meta = with stdenv.lib; {
+    description = "liberally licensed VNC server library that's intended to be fast and neat";
+    homepage    = "https://github.com/any1/neatvnc";
+    license     = licenses.mit;
+    platforms   = platforms.linux;
+    maintainers = with maintainers; [ colemickens ];
+  };
+}
diff --git a/overlays/patches/nixpkgs-wayland/pkgs/aml/metadata.nix b/overlays/patches/nixpkgs-wayland/pkgs/aml/metadata.nix
new file mode 100644
index 000000000000..10d517b9d92d
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs/aml/metadata.nix
@@ -0,0 +1,7 @@
+{
+  repo_git = "https://github.com/any1/aml";
+  branch = "master";
+  rev = "d1783ccb26ad094858633401095085c9de683841";
+  sha256 = "1ckfrk3n9r6akvzdvrzr7hbbvrpi6y162x7x7yiz7m0jhn4vzs7l";
+  revdate = "2020-07-26 14:57:11Z";
+}
diff --git a/overlays/patches/nixpkgs-wayland/pkgs/bspwc/default.nix b/overlays/patches/nixpkgs-wayland/pkgs/bspwc/default.nix
new file mode 100644
index 000000000000..c9ad6462dd90
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs/bspwc/default.nix
@@ -0,0 +1,38 @@
+{ stdenv, fetchgit
+, meson, ninja, pkgconfig, scdoc
+, wlroots, wayland, wayland-protocols
+, pixman, libxkbcommon
+, libudev, mesa_noglu, libX11 # not mentioned in meson.build...
+, wltrunk, libGL
+}:
+
+let
+  metadata = import ./metadata.nix;
+in
+stdenv.mkDerivation rec {
+  name = "bspwc-${version}";
+  version = metadata.rev;
+
+  src = fetchgit {
+    url = "https://git.sr.ht/~bl4ckb0ne/bspwc";
+    rev = version;
+    sha256 = metadata.sha256;
+  };
+
+  nativeBuildInputs = [ pkgconfig meson ninja scdoc ];
+  buildInputs = [
+    wayland wayland-protocols wlroots wltrunk
+    pixman libxkbcommon libudev mesa_noglu libX11 libGL
+  ];
+  mesonFlags = [ "-Dauto_features=enabled" ];
+
+  enableParallelBuilding = true;
+
+  meta = with stdenv.lib; {
+    description = "Binary space partitioning wayland compositor";
+    homepage    = "https://git.sr.ht/~bl4ckb0ne/bspwc";
+    license     = licenses.gpl2;
+    platforms   = platforms.linux;
+    maintainers = with maintainers; [ colemickens ];
+  };
+}
diff --git a/overlays/patches/nixpkgs-wayland/pkgs/bspwc/metadata.nix b/overlays/patches/nixpkgs-wayland/pkgs/bspwc/metadata.nix
new file mode 100644
index 000000000000..4b01dbc4d8c5
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs/bspwc/metadata.nix
@@ -0,0 +1,8 @@
+{
+  repo_git = "https://git.sr.ht/~bl4ckb0ne/bspwc";
+  branch = "master";
+  rev = "5edc0d19758574ffacaeb4b18eeca4956c2b675e";
+  sha256 = "0py3dy0ykgw5my7bn510m06ffpwx0kca7052ncg23s5l9vnwdzvd";
+  revdate = "2020-01-18 03:54:38Z";
+  skip = true;
+}
diff --git a/overlays/patches/nixpkgs-wayland/pkgs/cage/default.nix b/overlays/patches/nixpkgs-wayland/pkgs/cage/default.nix
new file mode 100644
index 000000000000..6afa98ea0071
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs/cage/default.nix
@@ -0,0 +1,38 @@
+{ stdenv, fetchFromGitHub, fetchpatch
+, pkgconfig, meson, ninja, scdoc
+, wayland, wayland-protocols
+, wlroots, pixman, libxkbcommon, libudev, libGL, libX11
+}:
+
+let
+  metadata = import ./metadata.nix;
+in
+stdenv.mkDerivation rec {
+  name = "cage-${version}";
+  version = metadata.rev;
+
+  src = fetchFromGitHub {
+    owner = "Hjdskes";
+    repo = "cage";
+    rev = metadata.rev;
+    sha256 = metadata.sha256;
+  };
+
+  nativeBuildInputs = [ pkgconfig meson ninja ];
+  buildInputs = [
+    scdoc
+    wayland wayland-protocols
+    wlroots pixman libxkbcommon libudev libGL libX11
+  ];
+  mesonFlags = [ "-Dxwayland=true" ];
+
+  enableParallelBuilding = true;
+
+  meta = with stdenv.lib; {
+    description = "A Wayland kiosk";
+    homepage    = "https://www.hjdskes.nl/projects/cage/";
+    license     = licenses.mit;
+    platforms   = platforms.linux;
+    maintainers = with maintainers; [ colemickens ];
+  };
+}
diff --git a/overlays/patches/nixpkgs-wayland/pkgs/cage/metadata.nix b/overlays/patches/nixpkgs-wayland/pkgs/cage/metadata.nix
new file mode 100644
index 000000000000..28260f938a95
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs/cage/metadata.nix
@@ -0,0 +1,7 @@
+{
+  repo_git = "https://github.com/Hjdskes/cage";
+  branch = "master";
+  rev = "0d85c1652e676806a5c065bdc88e83f0b33a0a5e";
+  sha256 = "1z2wd3xi5r061cxifkpk12rqnkb5fvn7abz2qnqk19rvxqiqya4z";
+  revdate = "2020-08-02 15:43:05Z";
+}
diff --git a/overlays/patches/nixpkgs-wayland/pkgs/clipman/default.nix b/overlays/patches/nixpkgs-wayland/pkgs/clipman/default.nix
new file mode 100644
index 000000000000..d3faa158014f
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs/clipman/default.nix
@@ -0,0 +1,23 @@
+{ lib, fetchFromGitHub, buildGoModule }:
+
+let metadata = import ./metadata.nix; in
+buildGoModule rec {
+  pname = "clipman";
+  version = metadata.rev;
+
+  src = fetchFromGitHub {
+    owner = "yory8";
+    repo = "clipman";
+    rev = metadata.rev;
+    sha256 = metadata.sha256;
+  };
+
+  vendorSha256 = metadata.vendorSha256;
+
+  meta = with lib; {
+    description = "A basic clipboard manager for Wayland, with support for persisting copy buffers after an application exits";
+    homepage = "https://github.com/yory8/clipman";
+    license = licenses.gpl3;
+    maintainers = with maintainers; [ colemickens ];
+  };
+}
diff --git a/overlays/patches/nixpkgs-wayland/pkgs/clipman/metadata.nix b/overlays/patches/nixpkgs-wayland/pkgs/clipman/metadata.nix
new file mode 100644
index 000000000000..f11e7d131ffb
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs/clipman/metadata.nix
@@ -0,0 +1,8 @@
+{
+  repo_git = "https://github.com/yory8/clipman";
+  branch = "master";
+  rev = "77706941a34331848f713be356933dc4c269b2fe";
+  sha256 = "133ja4kl0sgf86fa4lr8yblp1jf7mn83dp2816cr0jrjh6lwlv3i";
+  vendorSha256 = "18jw4z0lcrh00yjr3qdkgvlrpfwqbsm0ncz7fp1h72pzkh41byv7";
+  revdate = "2020-06-29 21:10:10Z";
+}
diff --git a/overlays/patches/nixpkgs-wayland/pkgs/drm_info/default.nix b/overlays/patches/nixpkgs-wayland/pkgs/drm_info/default.nix
new file mode 100644
index 000000000000..6d04b844d703
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs/drm_info/default.nix
@@ -0,0 +1,33 @@
+{ stdenv, fetchFromGitHub
+, libdrm, json_c
+, meson, ninja, pkgconfig
+, libpciaccess
+}:
+
+let
+  metadata = import ./metadata.nix;
+in
+stdenv.mkDerivation rec {
+  pname = "drm_info";
+  version = metadata.rev;
+
+  src = fetchFromGitHub {
+    owner = "ascent12";
+    repo = "drm_info";
+    rev = version;
+    sha256 = metadata.sha256;
+  };
+
+  nativeBuildInputs = [ meson ninja pkgconfig ];
+  buildInputs = [ libdrm json_c libpciaccess ];
+
+  mesonFlags = [ "-Dlibpci=disabled" ];
+
+  meta = with stdenv.lib; {
+    description = "Small utility to dump info about DRM devices.";
+    homepage = "https://github.com/ascent12/drm_info";
+    license = licenses.mit;
+    maintainers = with maintainers; [ tadeokondrak ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/overlays/patches/nixpkgs-wayland/pkgs/drm_info/metadata.nix b/overlays/patches/nixpkgs-wayland/pkgs/drm_info/metadata.nix
new file mode 100644
index 000000000000..be8fc4ac33f4
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs/drm_info/metadata.nix
@@ -0,0 +1,7 @@
+{
+  repo_git = "https://github.com/ascent12/drm_info";
+  branch = "master";
+  rev = "7117855b4de236c9bfeed1befc1932497d51a470";
+  sha256 = "0mgb8a5lr4zagvdnfbykn7dk9kqjz7g3pabd2apkh0dhikbly5hg";
+  revdate = "2020-07-04 07:46:47Z";
+}
diff --git a/overlays/patches/nixpkgs-wayland/pkgs/emacs/default.nix b/overlays/patches/nixpkgs-wayland/pkgs/emacs/default.nix
new file mode 100644
index 000000000000..d36f138b099a
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs/emacs/default.nix
@@ -0,0 +1,22 @@
+{ stdenv, fetchFromGitHub, emacs, cairo }:
+
+let
+  metadata = import ./metadata.nix;
+in
+(emacs.override { srcRepo = true; }).overrideAttrs (old: rec {
+  name = "emacs-pgtk-${version}";
+  version = metadata.rev;
+
+  src = fetchFromGitHub {
+    owner = "masm11";
+    repo = "emacs";
+    rev = version;
+    sha256 = metadata.sha256;
+  };
+
+  configureFlags = old.configureFlags ++ [ "--with-pgtk" "--with-cairo" ];
+
+  buildInputs = old.buildInputs ++ [ cairo ];
+
+  patches = [];
+})
diff --git a/overlays/patches/nixpkgs-wayland/pkgs/emacs/metadata.nix b/overlays/patches/nixpkgs-wayland/pkgs/emacs/metadata.nix
new file mode 100644
index 000000000000..3b67ed867509
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs/emacs/metadata.nix
@@ -0,0 +1,8 @@
+{
+  repo_git = "https://github.com/masm11/emacs";
+  upattr = "emacs-pgtk";
+  branch = "pgtk";
+  rev = "db000296808254d9a38ce71e976d3f3bb4723428";
+  sha256 = "sha256-tIWe1gVYGSmLR5qmgUIEtQzr/j7htaR3mILv2XSsYgA=";
+  revdate = "2020-08-14 17:17:14Z";
+}
diff --git a/overlays/patches/nixpkgs-wayland/pkgs/gebaar-libinput/default.nix b/overlays/patches/nixpkgs-wayland/pkgs/gebaar-libinput/default.nix
new file mode 100644
index 000000000000..a5406f130248
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs/gebaar-libinput/default.nix
@@ -0,0 +1,36 @@
+{ gcc8Stdenv, fetchFromGitHub
+, pkgconfig, cmake
+, libinput, zlib
+}:
+
+let
+  metadata = import ./metadata.nix;
+in
+gcc8Stdenv.mkDerivation rec {
+  name = "${pname}-${version}";
+  pname = "gebaar-libinput";
+  version = metadata.rev;
+
+  src = fetchFromGitHub {
+    owner = "Coffee2CodeNL";
+    repo = "gebaar-libinput";
+    rev = version;
+    sha256 = metadata.sha256;
+    fetchSubmodules = true;
+  };
+
+  nativeBuildInputs = [ pkgconfig cmake ];
+  buildInputs = [
+    libinput zlib #cpptoml
+  ];
+
+  enableParallelBuilding = true;
+
+  meta = with gcc8Stdenv.lib; {
+    description = "Gebaar, A Super Simple WM Independent Touchpad Gesture Daemon for libinput";
+    homepage    = "https://github.com/Coffee2CodeNL/gebaar-libinput";
+    license     = licenses.gpl3;
+    platforms   = platforms.linux;
+    maintainers = with maintainers; [ colemickens ];
+  };
+}
diff --git a/overlays/patches/nixpkgs-wayland/pkgs/gebaar-libinput/metadata.nix b/overlays/patches/nixpkgs-wayland/pkgs/gebaar-libinput/metadata.nix
new file mode 100644
index 000000000000..e9e4489984dd
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs/gebaar-libinput/metadata.nix
@@ -0,0 +1,7 @@
+{
+  repo_git = "https://github.com/Coffee2CodeNL/gebaar-libinput";
+  branch = "master";
+  rev = "c18c8bd73e79aaf1211bd88bf9cff808273cf6d6";
+  sha256 = "0crz4cbyn9g23n0bq40znrs3jc2pzrhyn8h6lxkk1hf89hwq6jxh";
+  revdate = "2019-04-05 13:27:03Z";
+}
diff --git a/overlays/patches/nixpkgs-wayland/pkgs/glpaper/default.nix b/overlays/patches/nixpkgs-wayland/pkgs/glpaper/default.nix
new file mode 100644
index 000000000000..c1c1199ce826
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs/glpaper/default.nix
@@ -0,0 +1,37 @@
+{ stdenv, fetchhg
+, meson, ninja, pkgconfig
+, wlroots, wayland, wayland-protocols
+, pixman, libxkbcommon
+, libudev, mesa_noglu, libX11
+, libGL, libglvnd
+}:
+
+let
+  metadata = import ./metadata.nix;
+in
+stdenv.mkDerivation rec {
+  name = "glpaper-${version}";
+  version = metadata.rev;
+
+  src = fetchhg {
+    url = "https://hg.sr.ht/~scoopta/glpaper";
+    rev = version;
+    sha256 = metadata.sha256;
+  };
+
+  nativeBuildInputs = [ meson ninja pkgconfig ];
+  buildInputs = [
+    wlroots wayland wayland-protocols wlroots
+    pixman libxkbcommon libudev mesa_noglu libX11
+    libGL libglvnd
+  ];
+
+  enableParallelBuilding = true;
+
+  meta = with stdenv.lib; {
+    description = "GLPaper is a wallpaper program for wlroots based wayland compositors such as sway that allows you to render glsl shaders as your wallpaper";
+    homepage    = "https://bitbucket.org/Scoopta/glpaper";
+    platforms   = platforms.linux;
+    maintainers = with maintainers; [ colemickens ];
+  };
+}
diff --git a/overlays/patches/nixpkgs-wayland/pkgs/glpaper/metadata.nix b/overlays/patches/nixpkgs-wayland/pkgs/glpaper/metadata.nix
new file mode 100644
index 000000000000..46e12d15ea93
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs/glpaper/metadata.nix
@@ -0,0 +1,7 @@
+{
+  repo_hg = "https://hg.sr.ht/~scoopta/glpaper/";
+  branch = "default";
+  rev = "a95db77088df";
+  sha256 = "04y12910wvhy4aqx2sa63dy9l6nbs7b77yqpdhc96x2b3mgzgjfs";
+  revdate = "2020-03-29 19:46:07";
+}
diff --git a/overlays/patches/nixpkgs-wayland/pkgs/grim/default.nix b/overlays/patches/nixpkgs-wayland/pkgs/grim/default.nix
new file mode 100644
index 000000000000..fc340b3236c3
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs/grim/default.nix
@@ -0,0 +1,35 @@
+{ stdenv, fetchFromGitHub
+, meson, ninja, pkgconfig
+, cairo, libjpeg, wayland, wayland-protocols
+, scdoc, buildDocs ? true
+}:
+
+let
+  metadata = import ./metadata.nix;
+in
+stdenv.mkDerivation rec {
+  name = "grim-${version}";
+  version = metadata.rev;
+
+  src = fetchFromGitHub {
+    owner = "emersion";
+    repo = "grim";
+    rev = version;
+    sha256 = metadata.sha256;
+  };
+
+  nativeBuildInputs = [ pkgconfig meson ninja ] ++ stdenv.lib.optional buildDocs scdoc;
+  buildInputs = [ cairo libjpeg wayland wayland-protocols ];
+  mesonFlags = [ "-Djpeg=enabled" ]
+    ++ stdenv.lib.optional buildDocs "-Dman-pages=enabled";
+
+  enableParallelBuilding = true;
+
+  meta = with stdenv.lib; {
+    description = "Grab images from a Wayland compositor";
+    homepage    = https://github.com/emersion/grim;
+    license     = licenses.mit;
+    platforms   = platforms.linux;
+    maintainers = with maintainers; [ colemickens ];
+  };
+}
diff --git a/overlays/patches/nixpkgs-wayland/pkgs/grim/metadata.nix b/overlays/patches/nixpkgs-wayland/pkgs/grim/metadata.nix
new file mode 100644
index 000000000000..5cbfc595558d
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs/grim/metadata.nix
@@ -0,0 +1,7 @@
+{
+  repo_git = "https://github.com/emersion/grim";
+  branch = "master";
+  rev = "a5e009a87005810321c7c43c149384b8f25e51b8";
+  sha256 = "0fjmjq0ws9rlblkcqxxw2lv7zvvyi618jqzlnz5z9zb477jwdfib";
+  revdate = "2020-07-21 18:11:14Z";
+}
diff --git a/overlays/patches/nixpkgs-wayland/pkgs/gtk-layer-shell/default.nix b/overlays/patches/nixpkgs-wayland/pkgs/gtk-layer-shell/default.nix
new file mode 100644
index 000000000000..e98637e7871c
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs/gtk-layer-shell/default.nix
@@ -0,0 +1,35 @@
+{ stdenv, fetchFromGitHub
+, meson, ninja, pkgconfig, scdoc
+, wayland, libinput, gtk3, gobject-introspection
+}:
+
+let
+  metadata = import ./metadata.nix;
+in
+stdenv.mkDerivation rec {
+  pname = "gtk-layer-shell";
+  version = metadata.rev;
+
+  src = fetchFromGitHub {
+    owner = "wmww";
+    repo = "gtk-layer-shell";
+    rev = version;
+    sha256 = metadata.sha256;
+  };
+
+  nativeBuildInputs = [ meson ninja pkgconfig scdoc ];
+  buildInputs = [
+    wayland libinput gtk3 gobject-introspection
+  ];
+
+  enableParallelBuilding = true;
+
+  meta = with stdenv.lib; {
+    description = "A library to create panels and other desktop components for Wayland using the Layer Shell protocol";
+    homepage    = "https://github.com/wmww/gtk-layer-shell";
+    license     = licenses.mit;
+    platforms   = platforms.linux;
+    maintainers = with maintainers; [ colemickens ];
+  };
+}
+
diff --git a/overlays/patches/nixpkgs-wayland/pkgs/gtk-layer-shell/metadata.nix b/overlays/patches/nixpkgs-wayland/pkgs/gtk-layer-shell/metadata.nix
new file mode 100644
index 000000000000..a97b1249eb0a
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs/gtk-layer-shell/metadata.nix
@@ -0,0 +1,7 @@
+{
+  repo_git = "https://github.com/wmww/gtk-layer-shell";
+  branch = "master";
+  rev = "f7a9cc8f0ac0c39a594011faf683bdba875bd73a";
+  sha256 = "sha256-i9bwyM5LKJkeOgTSCF0OLZaNCIqQ0AYNwAX/crfAyCc=";
+  revdate = "2020-08-12 19:57:39Z";
+}
diff --git a/overlays/patches/nixpkgs-wayland/pkgs/i3status-rust/default.nix b/overlays/patches/nixpkgs-wayland/pkgs/i3status-rust/default.nix
new file mode 100644
index 000000000000..8940c43de946
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs/i3status-rust/default.nix
@@ -0,0 +1,35 @@
+{ stdenv, rustPlatform, rust, fetchFromGitHub, pkgconfig, dbus, libpulseaudio }:
+
+let
+  metadata = import ./metadata.nix;
+in
+rustPlatform.buildRustPackage rec {
+  name = "i3status-rust-${version}";
+  version = metadata.rev;
+
+  src = fetchFromGitHub {
+    owner = "greshake";
+    repo = "i3status-rust";
+    rev = metadata.rev;
+    sha256 = metadata.sha256;
+  };
+
+  cargoSha256 = metadata.cargoSha256;
+
+  nativeBuildInputs = [ pkgconfig ];
+
+  buildInputs = [ dbus libpulseaudio ];
+
+  preCheck = ''
+    substituteInPlace tests/run_binary.rs \
+      --replace 'target/release' "target/${rust.toRustTarget stdenv.buildPlatform}/release"
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Very resource-friendly and feature-rich replacement for i3status";
+    homepage = https://github.com/greshake/i3status-rust;
+    license = licenses.gpl3;
+    maintainers = [ maintainers.backuitist ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/overlays/patches/nixpkgs-wayland/pkgs/i3status-rust/metadata.nix b/overlays/patches/nixpkgs-wayland/pkgs/i3status-rust/metadata.nix
new file mode 100644
index 000000000000..720ff175ff98
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs/i3status-rust/metadata.nix
@@ -0,0 +1,8 @@
+{
+  repo_git = "https://github.com/greshake/i3status-rust";
+  branch = "master";
+  rev = "39fb0a1100df0a40d0b895f4e82d509116809cf4";
+  sha256 = "sha256-rtv4K4KCMkEGNQnThI6jjHNHivDrfHqLAIkgBSVA57E=";
+  cargoSha256 = "sha256-Kp88Kb2ZtdZFpVOqQ3+jwE8sVEcVp5SvsI1u/mj1d9Q=";
+  revdate = "2020-08-14 16:00:22Z";
+}
diff --git a/overlays/patches/nixpkgs-wayland/pkgs/imv/default.nix b/overlays/patches/nixpkgs-wayland/pkgs/imv/default.nix
new file mode 100644
index 000000000000..f5204f578907
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs/imv/default.nix
@@ -0,0 +1,62 @@
+{ stdenv, fetchFromGitHub
+, freeimage, fontconfig, pkgconfig
+, asciidoc, docbook_xsl, libxslt, cmocka
+, librsvg, pango, libxkbcommon, wayland
+, libGLU, icu
+}:
+
+let metadata = import ./metadata.nix; in
+stdenv.mkDerivation rec {
+  pname = "imv";
+  version = metadata.rev;
+
+  src = fetchFromGitHub {
+    owner  = "eXeC64";
+    repo   = "imv";
+    rev    = metadata.rev;
+    sha256 = metadata.sha256;
+  };
+
+  preBuild = ''
+    # Version is 4.0.1, but Makefile was not updated
+    sed -i 's/^VERSION/c\VERSION = ${metadata.rev}/' Makefile
+  '';
+
+  nativeBuildInputs = [
+    asciidoc
+    cmocka
+    docbook_xsl
+    libxslt
+  ];
+
+  buildInputs = [
+    freeimage
+    libGLU
+    librsvg
+    libxkbcommon
+    pango
+    pkgconfig
+    wayland
+    icu
+  ];
+
+  installFlags = [ "PREFIX=$(out)" "CONFIGPREFIX=$(out)/etc" ];
+
+  postFixup = ''
+    # The `bin/imv` script assumes imv-wayland or imv-x11 in PATH,
+    # so we have to fix those to the binaries we installed into the /nix/store
+
+    sed -i "s|\bimv-wayland\b|$out/bin/imv-wayland|" $out/bin/imv
+    sed -i "s|\bimv-x11\b|$out/bin/imv-x11|" $out/bin/imv
+  '';
+
+  doCheck = true;
+
+  meta = with stdenv.lib; {
+    description = "A command line image viewer for tiling window managers";
+    homepage    = https://github.com/eXeC64/imv;
+    license     = licenses.gpl2;
+    maintainers = with maintainers; [ rnhmjoj markus1189 ];
+    platforms   = [ "i686-linux" "x86_64-linux" ];
+  };
+}
diff --git a/overlays/patches/nixpkgs-wayland/pkgs/imv/metadata.nix b/overlays/patches/nixpkgs-wayland/pkgs/imv/metadata.nix
new file mode 100644
index 000000000000..641d94978a28
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs/imv/metadata.nix
@@ -0,0 +1,8 @@
+{
+  repo_git = "https://github.com/eXeC64/imv";
+  branch = "master";
+  rev = "a222f6475b905bdd0f55752e1539ed17bcad0a77";
+  sha256 = "0gk8g178i961nn3bls75a8qpv6wvfvav6hd9lxca1skaikd33zdx";
+  revdate = "2020-02-08 00:29:25Z";
+  skip = true;
+}
diff --git a/overlays/patches/nixpkgs-wayland/pkgs/kanshi/default.nix b/overlays/patches/nixpkgs-wayland/pkgs/kanshi/default.nix
new file mode 100644
index 000000000000..1b8891c830d0
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs/kanshi/default.nix
@@ -0,0 +1,40 @@
+{ stdenv, fetchFromGitHub
+, meson, ninja, pkgconfig
+, libudev, wayland, wayland-protocols
+, scdoc, buildDocs ? true
+}:
+
+let
+  metadata = import ./metadata.nix;
+in
+stdenv.mkDerivation rec {
+  name = "${pname}-${version}";
+  pname = "kanshi";
+  version = metadata.rev;
+
+  src = fetchFromGitHub {
+    owner = "emersion";
+    repo = pname;
+    rev = version;
+    sha256 = metadata.sha256;
+  };
+
+  nativeBuildInputs = [ pkgconfig meson ninja scdoc ];
+
+  buildInputs = [
+    wayland wayland-protocols
+  ];
+
+  enableParallelBuilding = true;
+
+  mesonFlags = []
+    ++ stdenv.lib.optional (!buildDocs) "-Dman-pages=disabled";
+
+  meta = with stdenv.lib; {
+    description = "Dynamic display configuration";
+    homepage = "https://github.com/emersion/kanshi";
+    maintainers = with maintainers; [ colemickens ];
+    platforms = platforms.linux;
+    #license = TODO;
+  };
+}
diff --git a/overlays/patches/nixpkgs-wayland/pkgs/kanshi/metadata.nix b/overlays/patches/nixpkgs-wayland/pkgs/kanshi/metadata.nix
new file mode 100644
index 000000000000..9cf5c0381500
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs/kanshi/metadata.nix
@@ -0,0 +1,7 @@
+{
+  repo_git = "https://github.com/emersion/kanshi";
+  branch = "master";
+  rev = "e55b5847a07bc3ea2dc19f3cdce8d88c8aa2f9ca";
+  sha256 = "184szxk9rf22yijhxxlwiba77lf2vmr6ixxp0pbkambyz0k4cab6";
+  revdate = "2020-08-05 14:50:47Z";
+}
diff --git a/overlays/patches/nixpkgs-wayland/pkgs/lavalauncher/default.nix b/overlays/patches/nixpkgs-wayland/pkgs/lavalauncher/default.nix
new file mode 100644
index 000000000000..57206ef6665f
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs/lavalauncher/default.nix
@@ -0,0 +1,40 @@
+{ stdenv, fetchgit
+, pkgconfig, meson, ninja, scdoc
+, wayland, wayland-protocols
+, libxkbcommon, cairo, librsvg
+}:
+
+let
+  metadata = import ./metadata.nix;
+in
+stdenv.mkDerivation rec {
+  name = "${pname}-${version}";
+  pname = "lavalauncher";
+  version = metadata.rev;
+
+  src = fetchgit {
+    url = metadata.repo_git;
+    rev = metadata.rev;
+    sha256 = metadata.sha256;
+  };
+
+  nativeBuildInputs = [ pkgconfig meson ninja scdoc ];
+  buildInputs = [
+    wayland wayland-protocols
+    libxkbcommon cairo librsvg
+  ];
+
+  installFlags = [
+    "PREFIX=$(out)"
+  ];
+
+  enableParallelBuilding = true;
+
+  meta = with stdenv.lib; {
+    description = "A simple launcher for Wayland.";
+    homepage    = "https://git.sr.ht/~leon_plickat/lavalauncher";
+    license     = licenses.gpl3;
+    platforms = [ "x86_64-linux" "i686-linux" ];
+    maintainers = with maintainers; [];
+  };
+}
diff --git a/overlays/patches/nixpkgs-wayland/pkgs/lavalauncher/metadata.nix b/overlays/patches/nixpkgs-wayland/pkgs/lavalauncher/metadata.nix
new file mode 100644
index 000000000000..332ea604f2ba
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs/lavalauncher/metadata.nix
@@ -0,0 +1,7 @@
+{
+  repo_git = "https://git.sr.ht/~leon_plickat/lavalauncher";
+  branch = "master";
+  rev = "a54b3c6f9bb70b2800710f7e4480f85060fceac3";
+  sha256 = "0xqcbm6n6hvfc1s9ra7l57jpsmrj500g6xf7wf8xjls0vhn8pw77";
+  revdate = "2020-08-15 16:16:45Z";
+}
diff --git a/overlays/patches/nixpkgs-wayland/pkgs/mako/default.nix b/overlays/patches/nixpkgs-wayland/pkgs/mako/default.nix
new file mode 100644
index 000000000000..1cf5c0b25d6a
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs/mako/default.nix
@@ -0,0 +1,38 @@
+{stdenv, fetchFromGitHub
+, meson, ninja, pkgconfig
+, gtk3, cairo, pango, systemd
+, wayland, wayland-protocols
+, scdoc, buildDocs ? true
+}:
+
+let
+  metadata = import ./metadata.nix;
+in
+stdenv.mkDerivation rec {
+  name = "mako-${version}";
+  version = metadata.rev;
+
+  src = fetchFromGitHub {
+    owner = "emersion";
+    repo = "mako";
+    rev = version;
+    sha256 = metadata.sha256;
+  };
+
+  nativeBuildInputs = [ pkgconfig meson ninja ] ++ stdenv.lib.optional buildDocs scdoc;
+  buildInputs = [ gtk3 cairo pango systemd wayland wayland-protocols ];
+  mesonFlags = [
+    "-Dauto_features=enabled"
+    "-Dsystemd=disabled"
+  ] ++ stdenv.lib.optional (!buildDocs) "-Dman-pages=disabled";
+
+  enableParallelBuilding = true;
+
+  meta = with stdenv.lib; {
+    description = "A lightweight Wayland notification daemon";
+    homepage    = "https://wayland.emersion.fr/mako";
+    license     = licenses.mit;
+    platforms   = platforms.linux;
+    maintainers = with maintainers; [ colemickens ];
+  };
+}
diff --git a/overlays/patches/nixpkgs-wayland/pkgs/mako/metadata.nix b/overlays/patches/nixpkgs-wayland/pkgs/mako/metadata.nix
new file mode 100644
index 000000000000..45b4432c419f
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs/mako/metadata.nix
@@ -0,0 +1,7 @@
+{
+  repo_git = "https://github.com/emersion/mako";
+  branch = "master";
+  rev = "75aa254710145f2c1c4064a3f9641eb9e7f39be8";
+  sha256 = "184hd8a90izksq62cra98fqf25s5iw51bn5q0aggla62p6gld17l";
+  revdate = "2020-08-03 16:08:05Z";
+}
diff --git a/overlays/patches/nixpkgs-wayland/pkgs/neatvnc/default.nix b/overlays/patches/nixpkgs-wayland/pkgs/neatvnc/default.nix
new file mode 100644
index 000000000000..049a45504d60
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs/neatvnc/default.nix
@@ -0,0 +1,44 @@
+{ stdenv, fetchFromGitHub
+, pkgconfig, meson, ninja
+, wayland, wayland-protocols
+, libxkbcommon, libvncserver
+, libpthreadstubs, libdrm
+, pixman, libuv, libglvnd
+, gnutls
+, aml, libjpeg_turbo
+}:
+
+let
+  metadata = import ./metadata.nix;
+in
+stdenv.mkDerivation rec {
+  name = "neatvnc-${version}";
+  version = metadata.rev;
+
+  src = fetchFromGitHub {
+    owner = "any1";
+    repo = "neatvnc";
+    rev = metadata.rev;
+    sha256 = metadata.sha256;
+  };
+
+  nativeBuildInputs = [ pkgconfig meson ninja ];
+  buildInputs = [
+    wayland wayland-protocols
+    libxkbcommon libvncserver
+    libpthreadstubs libdrm
+    pixman libuv libglvnd
+    gnutls
+    aml libjpeg_turbo
+  ];
+
+  enableParallelBuilding = true;
+
+  meta = with stdenv.lib; {
+    description = "liberally licensed VNC server library that's intended to be fast and neat";
+    homepage    = "https://github.com/any1/neatvnc";
+    license     = licenses.mit;
+    platforms   = platforms.linux;
+    maintainers = with maintainers; [ colemickens ];
+  };
+}
diff --git a/overlays/patches/nixpkgs-wayland/pkgs/neatvnc/metadata.nix b/overlays/patches/nixpkgs-wayland/pkgs/neatvnc/metadata.nix
new file mode 100644
index 000000000000..0652463a1482
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs/neatvnc/metadata.nix
@@ -0,0 +1,7 @@
+{
+  repo_git = "https://github.com/any1/neatvnc";
+  branch = "master";
+  rev = "6ad4aba374153d36c99ea5073b747697774f4e3e";
+  sha256 = "036kzhbabbwc3gvsw8kqf6rs0gh8kgn6i0by9pxski38mi0qs1qs";
+  revdate = "2020-07-26 13:52:00Z";
+}
diff --git a/overlays/patches/nixpkgs-wayland/pkgs/obs-studio/default.nix b/overlays/patches/nixpkgs-wayland/pkgs/obs-studio/default.nix
new file mode 100644
index 000000000000..48a2f7a5dea1
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs/obs-studio/default.nix
@@ -0,0 +1,105 @@
+{ config, stdenv
+, mkDerivation
+, fetchFromGitHub
+, fetchpatch
+, cmake
+, fdk_aac
+, ffmpeg
+, jansson
+, libjack2
+, libxkbcommon
+, libpthreadstubs
+, libXdmcp
+, qtbase
+, qtx11extras
+, qtwayland, wayland
+, qtsvg
+, speex
+, libv4l
+, x264
+, curl
+, xorg
+, makeWrapper
+, pkgconfig
+, vlc
+, mbedtls
+
+, scriptingSupport ? true
+, luajit
+, swig
+, python3
+
+, alsaSupport ? stdenv.isLinux
+, alsaLib
+, pulseaudioSupport ? config.pulseaudio or stdenv.isLinux
+, libpulseaudio
+}:
+
+let
+  metadata = import ./metadata.nix;
+  inherit (stdenv.lib) optional optionals;
+in mkDerivation rec {
+  pname = "obs-studio";
+  version = "unstable-wayland-latest";
+
+  src = fetchFromGitHub {
+    owner = "GeorgesStavracas";
+    repo = "obs-studio";
+    rev = metadata.rev;
+    sha256 = metadata.sha256;
+  };
+
+#  patches = (fetchpatch { url = "https://github.com/obsproject/obs-studio/pull/2097.patch"; sha256 = "18sws0v39vg10fyp3i267wv9n0rimjkx7byk48v7r97vgck1k63h"; });
+
+  nativeBuildInputs = [ cmake pkgconfig ];
+
+  buildInputs = [ curl
+                  fdk_aac
+                  ffmpeg
+                  jansson
+                  libjack2
+                  libv4l
+                  libxkbcommon
+                  libpthreadstubs
+                  libXdmcp
+                  qtbase
+                  qtx11extras
+                  qtsvg
+                  speex
+                  x264
+                  vlc
+                  makeWrapper
+                  mbedtls
+                  qtwayland wayland
+                ]
+                ++ optionals scriptingSupport [ luajit swig python3 ]
+                ++ optional alsaSupport alsaLib
+                ++ optional pulseaudioSupport libpulseaudio;
+
+  # obs attempts to dlopen libobs-opengl, it fails unless we make sure
+  # DL_OPENGL is an explicit path. Not sure if there's a better way
+  # to handle this.
+  cmakeFlags = [
+    "-DCMAKE_CXX_FLAGS=-DDL_OPENGL=\\\"$(out)/lib/libobs-opengl.so\\\""
+    "-DENABLE_WAYLAND=true"
+    "-DENABLE_X11=false"
+  ];
+
+  postInstall = ''
+      wrapProgram $out/bin/obs \
+        --prefix "LD_LIBRARY_PATH" : "${xorg.libX11.out}/lib:${vlc}/lib"
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Free and open source software for video recording and live streaming";
+    longDescription = ''
+      This project is a rewrite of what was formerly known as "Open Broadcaster
+      Software", software originally designed for recording and streaming live
+      video content, efficiently
+    '';
+    homepage = https://obsproject.com;
+    maintainers = with maintainers; [ jb55 MP2E ];
+    license = licenses.gpl2;
+    platforms = [ "x86_64-linux" "i686-linux" ];
+  };
+}
diff --git a/overlays/patches/nixpkgs-wayland/pkgs/obs-studio/fix-search-path.patch b/overlays/patches/nixpkgs-wayland/pkgs/obs-studio/fix-search-path.patch
new file mode 100644
index 000000000000..4503447ff5dc
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs/obs-studio/fix-search-path.patch
@@ -0,0 +1,13 @@
+diff --git a/external/FindLibObs.cmake b/external/FindLibObs.cmake
+index ab0a3de..19c63ee 100644
+--- a/external/FindLibObs.cmake
++++ b/external/FindLibObs.cmake
+@@ -95,7 +95,7 @@ if(LIBOBS_FOUND)
+ 
+ 	set(LIBOBS_INCLUDE_DIRS ${LIBOBS_INCLUDE_DIR} ${W32_PTHREADS_INCLUDE_DIR})
+ 	set(LIBOBS_LIBRARIES ${LIBOBS_LIB} ${W32_PTHREADS_LIB})
+-	include(${LIBOBS_INCLUDE_DIR}/../cmake/external/ObsPluginHelpers.cmake)
++	include(external/ObsPluginHelpers.cmake)
+ 
+ 	# allows external plugins to easily use/share common dependencies that are often included with libobs (such as FFmpeg)
+ 	if(NOT DEFINED INCLUDED_LIBOBS_CMAKE_MODULES)
diff --git a/overlays/patches/nixpkgs-wayland/pkgs/obs-studio/hardcode-ndi-path.patch b/overlays/patches/nixpkgs-wayland/pkgs/obs-studio/hardcode-ndi-path.patch
new file mode 100644
index 000000000000..caef96c381f2
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs/obs-studio/hardcode-ndi-path.patch
@@ -0,0 +1,17 @@
+diff --git a/src/obs-ndi.cpp b/src/obs-ndi.cpp
+index 493831c..7b0f8db 100644
+--- a/src/obs-ndi.cpp
++++ b/src/obs-ndi.cpp
+@@ -197,11 +197,7 @@ const char* obs_module_description()
+ const NDIlib_v4* load_ndilib()
+ {
+ 	QStringList locations;
+-	locations << QString(qgetenv(NDILIB_REDIST_FOLDER));
+-#if defined(__linux__) || defined(__APPLE__)
+-	locations << "/usr/lib";
+-	locations << "/usr/local/lib";
+-#endif
++	locations << "@NDI@/lib";
+ 
+ 	for (QString path : locations) {
+ 		blog(LOG_INFO, "Trying '%s'", path.toUtf8().constData());
diff --git a/overlays/patches/nixpkgs-wayland/pkgs/obs-studio/linuxbrowser.nix b/overlays/patches/nixpkgs-wayland/pkgs/obs-studio/linuxbrowser.nix
new file mode 100644
index 000000000000..134e0cb8a9e3
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs/obs-studio/linuxbrowser.nix
@@ -0,0 +1,49 @@
+# We don't have a wrapper which can supply obs-studio plugins so you have to
+# somewhat manually install this:
+
+# nix-env -f . -iA obs-linuxbrowser
+# mkdir -p ~/.config/obs-studio/plugins
+# ln -s ~/.nix-profile/share/obs/obs-plugins/obs-linuxbrowser ~/.config/obs-studio/plugins/
+
+{ stdenv, fetchFromGitHub, obs-studio, cmake, libcef }:
+
+stdenv.mkDerivation rec {
+  pname = "obs-linuxbrowser";
+  version = "0.6.1-6-gf86dba6";
+
+  src = fetchFromGitHub {
+    owner = "bazukas";
+    repo = "obs-linuxbrowser";
+    rev = version;
+    sha256 = "08d7qz0721va88bcyia8p0ycw50f6x3yk97s3vzhsc9xpq691kpi";
+  };
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ obs-studio ];
+  postUnpack = ''
+    mkdir -p cef/Release cef/Resources cef/libcef_dll_wrapper/
+    for i in ${libcef}/share/cef/*; do
+      ln -s $i cef/Release/
+      ln -s $i cef/Resources/
+    done
+    ln -s ${libcef}/lib/libcef.so cef/Release/
+    ln -s ${libcef}/lib/libcef_dll_wrapper.a cef/libcef_dll_wrapper/
+    ln -s ${libcef}/include cef/
+  '';
+  cmakeFlags = [
+    "-DCEF_ROOT_DIR=../../cef"
+    "-DOBS_INCLUDE_SEARCH_DIR=${obs-studio}/include/obs"
+  ];
+  installPhase = ''
+    mkdir -p $out/share/obs/obs-plugins
+    cp -r build/obs-linuxbrowser $out/share/obs/obs-plugins/
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Browser source plugin for obs-studio based on Chromium Embedded Framework";
+    homepage = https://github.com/bazukas/obs-linuxbrowser;
+    maintainers = with maintainers; [ puffnfresh ];
+    license = licenses.gpl2;
+    platforms = with platforms; linux;
+  };
+}
diff --git a/overlays/patches/nixpkgs-wayland/pkgs/obs-studio/metadata.nix b/overlays/patches/nixpkgs-wayland/pkgs/obs-studio/metadata.nix
new file mode 100644
index 000000000000..7903599bf3f7
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs/obs-studio/metadata.nix
@@ -0,0 +1,7 @@
+{
+  repo_git = "https://github.com/GeorgesStavracas/obs-studio";
+  branch = "feaneron/egl-wayland";
+  rev = "8553a0139bda9e99fdf50669471ab524cde2fa49";
+  sha256 = "sha256-3sz5ZynM6FIPXaQqTQiLToZsTdoln1uKEvz4XgiddRQ=";
+  revdate = "2020-08-10 13:48:20Z";
+}
diff --git a/overlays/patches/nixpkgs-wayland/pkgs/obs-studio/obs-ndi.nix b/overlays/patches/nixpkgs-wayland/pkgs/obs-studio/obs-ndi.nix
new file mode 100644
index 000000000000..452793f442ee
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs/obs-studio/obs-ndi.nix
@@ -0,0 +1,41 @@
+# We don't have a wrapper which can supply obs-studio plugins so you have to
+# somewhat manually install this:
+
+# nix-env -f "<nixpkgs>" -iA obs-ndi
+# mkdir -p ~/.config/obs-studio/plugins/bin
+# ln -s ~/.nix-profile/lib/obs-plugins/obs-ndi.so ~/.config/obs-studio/plugins/bin/
+
+{ stdenv, fetchFromGitHub, obs-studio, cmake, qt5, ndi }:
+
+stdenv.mkDerivation rec {
+  pname = "obs-ndi";
+  version = "4.7.1";
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ obs-studio qt5.qtbase ndi ];
+
+  src = fetchFromGitHub {
+    owner = "Palakis";
+    repo = "obs-ndi";
+    rev = version;
+    sha256 = "040fkbf3f3qgqcrd3072y3zrjb4fwga8zr10jym744xd7bgyylqh";
+  };
+
+  patches = [ ./fix-search-path.patch ./hardcode-ndi-path.patch ];
+
+  postPatch = "sed -i -e s,@NDI@,${ndi},g src/obs-ndi.cpp";
+
+  cmakeFlags = [
+    "-DLIBOBS_INCLUDE_DIR=${obs-studio}/include/obs"
+    "-DLIBOBS_LIB=${obs-studio}/lib"
+    "-DCMAKE_CXX_FLAGS=-I${obs-studio.src}/UI/obs-frontend-api"
+  ];
+
+  meta = with stdenv.lib; {
+    description = "Network A/V plugin for OBS Studio";
+    homepage = https://github.com/Palakis/obs-ndi;
+    maintainers = with maintainers; [ peti ];
+    license = licenses.gpl2;
+    platforms = with platforms; linux;
+  };
+}
diff --git a/overlays/patches/nixpkgs-wayland/pkgs/obs-studio/wlrobs.nix b/overlays/patches/nixpkgs-wayland/pkgs/obs-studio/wlrobs.nix
new file mode 100644
index 000000000000..05b826c9cefc
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs/obs-studio/wlrobs.nix
@@ -0,0 +1,42 @@
+# (the following is somewhat lifted from ./linuxbrowser.nix)
+# We don't have a wrapper which can supply obs-studio plugins so you have to
+# somewhat manually install this:
+
+# nix-env -f . -iA obs-wlrobs
+# mkdir -p ~/.config/obs-studio/plugins/wlrobs/bin/64bit
+# ln -s ~/.nix-profile/share/obs/obs-plugins/wlrobs/bin/64bit/libwlrobs.so ~/.config/obs-studio/plugins/wlrobs/bin/64bit
+{ stdenv, fetchhg, wayland, obs-studio
+, meson, ninja, pkgconfig, libX11
+, dmabufSupport ? false, libdrm ? null, libGL ? null}:
+
+assert dmabufSupport -> libdrm != null && libGL != null;
+
+stdenv.mkDerivation {
+  pname = "obs-wlrobs";
+  version = "20200111";
+
+  src = fetchhg {
+    url = "https://hg.sr.ht/~scoopta/wlrobs";
+    rev = "8345bf985e390896d89e35e2feae1fa37722f4be";
+    sha256 = "0j01wkhwhhla4qx8mwyrq2qj9cfhxksxaq2k8rskmy2qbdkvvdpb";
+  };
+
+  buildInputs = [ libX11 libGL libdrm meson ninja pkgconfig wayland obs-studio ];
+
+  installPhase = ''
+    mkdir -p $out/share/obs/obs-plugins/wlrobs/bin/64bit
+    cp ./libwlrobs.so $out/share/obs/obs-plugins/wlrobs/bin/64bit/
+  '';
+
+  mesonFlags = [
+    "-Duse_dmabuf=${if dmabufSupport then "true" else "false"}"
+  ];
+
+  meta = with stdenv.lib; {
+    description = "An obs-studio plugin that allows you to screen capture on wlroots based wayland compositors";
+    homepage = https://hg.sr.ht/~scoopta/wlrobs;
+    maintainers = with maintainers; [ grahamc ];
+    license = licenses.gpl3;
+    platforms = [ "x86_64-linux" ];
+  };
+}
diff --git a/overlays/patches/nixpkgs-wayland/pkgs/obs-wlrobs/default.nix b/overlays/patches/nixpkgs-wayland/pkgs/obs-wlrobs/default.nix
new file mode 100644
index 000000000000..e1ac542559aa
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs/obs-wlrobs/default.nix
@@ -0,0 +1,40 @@
+# We don't have a wrapper which can supply obs-studio plugins so you have to
+# somewhat manually install this:
+
+# nix-env -f . -iA wlrobs
+# mkdir -p ~/.config/obs-studio/plugins
+# ln -s ~/.nix-profile/share/obs/obs-plugins/wlrobs ~/.config/obs-studio/plugins/
+
+{ stdenv, fetchhg
+, meson, ninja, pkg-config
+, obs-studio, wlroots, wayland
+, libX11, libGL, libdrm
+}:
+
+let
+  metadata = import ./metadata.nix;
+in
+stdenv.mkDerivation rec {
+  name = "wlrobs-${version}";
+  version = metadata.rev;
+  src = fetchhg {
+    url = "https://hg.sr.ht/~scoopta/wlrobs";
+    rev = metadata.rev;
+    sha256 = metadata.sha256;
+  };
+  nativeBuildInputs = [ meson ninja pkg-config ];
+  buildInputs = [ obs-studio wayland wlroots libX11 libGL libdrm ];
+
+  installPhase = ''
+    mkdir -p $out/share/obs/obs-plugins/wlrobs/bin/64bit
+    cp libwlrobs.so $out/share/obs/obs-plugins/wlrobs/bin/64bit
+  '';
+
+  meta = with stdenv.lib; {
+    description = "wlrobs is an obs-studio plugin that allows you to screen capture on wlroots based wayland compositors";
+    homepage = "https://sr.ht/~scoopta/wlrobs";
+    maintainers = with maintainers; [ colemickens ];
+    platforms = [ "x86_64-linux" "i686-linux" ];
+    #platforms = with platforms; linux;
+  };
+}
diff --git a/overlays/patches/nixpkgs-wayland/pkgs/obs-wlrobs/metadata.nix b/overlays/patches/nixpkgs-wayland/pkgs/obs-wlrobs/metadata.nix
new file mode 100644
index 000000000000..73cf32ddd133
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs/obs-wlrobs/metadata.nix
@@ -0,0 +1,7 @@
+{
+  repo_hg = "https://hg.sr.ht/~scoopta/wlrobs";
+  branch = "default";
+  rev = "c0b86a1f57b8";
+  sha256 = "sha256-GiYNV8KRWTStbmI3BhHmR46jYCPxhdj/OB2FQmkcot4=";
+  revdate = "2020-08-12 12:00:28";
+}
diff --git a/overlays/patches/nixpkgs-wayland/pkgs/oguri/default.nix b/overlays/patches/nixpkgs-wayland/pkgs/oguri/default.nix
new file mode 100644
index 000000000000..70606885f934
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs/oguri/default.nix
@@ -0,0 +1,33 @@
+{ stdenv, fetchFromGitHub
+, meson, ninja, pkgconfig
+, cairo, gdk_pixbuf, wayland, wayland-protocols
+}:
+
+let
+  metadata = import ./metadata.nix;
+in
+stdenv.mkDerivation rec {
+  name = "oguri-${version}";
+  version = metadata.rev;
+
+  src = fetchFromGitHub {
+    owner = "vilhalmer";
+    repo = "oguri";
+    rev = version;
+    sha256 = metadata.sha256;
+  };
+
+  nativeBuildInputs = [ pkgconfig meson ninja ];
+  buildInputs = [ cairo gdk_pixbuf wayland wayland-protocols ];
+  mesonFlags = [ "-Dauto_features=enabled" ];
+
+  enableParallelBuilding = true;
+
+  meta = with stdenv.lib; {
+    description = "A very nice animated wallpaper tool for Wayland compositors";
+    homepage    = https://github.com/vilhalmer/oguri;
+    license     = licenses.mit;
+    platforms   = platforms.linux;
+    maintainers = with maintainers; [ colemickens ];
+  };
+}
diff --git a/overlays/patches/nixpkgs-wayland/pkgs/oguri/metadata.nix b/overlays/patches/nixpkgs-wayland/pkgs/oguri/metadata.nix
new file mode 100644
index 000000000000..e9e078e561ef
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs/oguri/metadata.nix
@@ -0,0 +1,7 @@
+{
+  repo_git = "https://github.com/vilhalmer/oguri";
+  branch = "master";
+  rev = "abf26bf2646d00d91b27cf0336cca38d17057bed";
+  sha256 = "1bkd448d6359cylwjar7xnlpic3bvzc650a7fbdcc11l1jw21gq5";
+  revdate = "2020-05-27 14:14:43Z";
+}
diff --git a/overlays/patches/nixpkgs-wayland/pkgs/redshift-wayland/575.patch b/overlays/patches/nixpkgs-wayland/pkgs/redshift-wayland/575.patch
new file mode 100644
index 000000000000..d731d8ec43ad
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs/redshift-wayland/575.patch
@@ -0,0 +1,51 @@
+From 467156efccc5e36a36bec8c0b64cc5a70f14d5ed Mon Sep 17 00:00:00 2001
+From: Yegor Timoshenko <yegortimoshenko@riseup.net>
+Date: Tue, 16 Jan 2018 11:43:46 +0000
+Subject: [PATCH] Fix Autoconf script
+
+gettext/intltool macros are not used correctly, see:
+https://bugs.launchpad.net/inkscape/+bug/1418943
+---
+ bootstrap    | 6 +-----
+ configure.ac | 5 +----
+ 2 files changed, 2 insertions(+), 9 deletions(-)
+
+diff --git a/bootstrap b/bootstrap
+index 0599cf5..40b1dca 100755
+--- a/bootstrap
++++ b/bootstrap
+@@ -1,7 +1,3 @@
+ #!/bin/sh
+ 
+-# change to root directory
+-cd $(dirname "$0")
+-
+-autopoint --force && \
+-	AUTOPOINT="intltoolize --automake --copy" autoreconf --force --install --verbose
++autoreconf --force --install && intltoolize
+diff --git a/configure.ac b/configure.ac
+index be0b51a..a2e7c42 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -17,6 +17,7 @@ AC_PROG_OBJC # For macOS support modules
+ AC_LANG([C])
+ 
+ AC_PROG_INTLTOOL([0.50])
++AC_SUBST(LIBINTL)
+ 
+ AC_CANONICAL_HOST
+ 
+@@ -51,10 +52,6 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])], [
+ ])
+ AC_LANG_POP([Objective C])
+ 
+-# Checks for libraries.
+-AM_GNU_GETTEXT_VERSION([0.17])
+-AM_GNU_GETTEXT([external])
+-
+ GETTEXT_PACKAGE=redshift
+ AC_SUBST(GETTEXT_PACKAGE)
+ AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Package name for gettext])
+-- 
+2.15.1
+
diff --git a/overlays/patches/nixpkgs-wayland/pkgs/redshift-wayland/default.nix b/overlays/patches/nixpkgs-wayland/pkgs/redshift-wayland/default.nix
new file mode 100644
index 000000000000..e1f177831b90
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs/redshift-wayland/default.nix
@@ -0,0 +1,90 @@
+{ stdenv, fetchFromGitHub, autoconf, automake, gettext, intltool
+, libtool, pkgconfig, wrapGAppsHook, wrapPython, gobjectIntrospection
+, gtk3, python, pygobject3, hicolor-icon-theme, pyxdg
+
+, withRandr ? stdenv.isLinux, libxcb
+, withDrm ? stdenv.isLinux, libdrm
+, withWayland ? stdenv.isLinux, wayland, wayland-protocols, wlroots
+, withGeoclue ? stdenv.isLinux, geoclue }:
+
+let
+  metadata = import ./metadata.nix;
+in
+stdenv.mkDerivation rec {
+  name = "redshift-${version}";
+  version = metadata.rev;
+
+  src = fetchFromGitHub {
+    owner = "minus7";
+    repo = "redshift";
+    rev = version;
+    sha256 = metadata.sha256;
+  };
+
+  patches = [
+    # https://github.com/jonls/redshift/pull/575
+    ./575.patch
+  ];
+
+  nativeBuildInputs = [
+    autoconf
+    automake
+    gettext
+    intltool
+    libtool
+    pkgconfig
+    wrapGAppsHook
+    wrapPython
+  ];
+
+  configureFlags = [
+    "--enable-randr=${if withRandr then "yes" else "no"}"
+    "--enable-geoclue2=${if withGeoclue then "yes" else "no"}"
+    "--enable-drm=${if withDrm then "yes" else "no"}"
+    "--enable-wayland=${if withWayland then "yes" else "no"}"
+  ];
+
+  buildInputs = [
+    gobjectIntrospection
+    gtk3
+    python
+    hicolor-icon-theme
+  ] ++ stdenv.lib.optional  withRandr        libxcb
+    ++ stdenv.lib.optional  withGeoclue      geoclue
+    ++ stdenv.lib.optional  withDrm          libdrm
+    ++ stdenv.lib.optionals withWayland      [ wayland wayland-protocols wlroots ]
+    ;
+
+  pythonPath = [ pygobject3 pyxdg ];
+
+  preConfigure = "./bootstrap";
+
+  postFixup = "wrapPythonPrograms";
+
+  # the geoclue agent may inspect these paths and expect them to be
+  # valid without having the correct $PATH set
+  postInstall = ''
+    substituteInPlace $out/share/applications/redshift.desktop \
+      --replace 'Exec=redshift' "Exec=$out/bin/redshift"
+    substituteInPlace $out/share/applications/redshift.desktop \
+      --replace 'Exec=redshift-gtk' "Exec=$out/bin/redshift-gtk"
+  '';
+
+  enableParallelBuilding = true;
+
+  meta = with stdenv.lib; {
+    description = "Screen color temperature manager";
+    longDescription = ''
+      Redshift adjusts the color temperature according to the position
+      of the sun. A different color temperature is set during night and
+      daytime. During twilight and early morning, the color temperature
+      transitions smoothly from night to daytime temperature to allow
+      your eyes to slowly adapt. At night the color temperature should
+      be set to match the lamps in your room.
+    '';
+    license = licenses.gpl3Plus;
+    homepage = http://jonls.dk/redshift;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ yegortimoshenko ];
+  };
+}
diff --git a/overlays/patches/nixpkgs-wayland/pkgs/redshift-wayland/metadata.nix b/overlays/patches/nixpkgs-wayland/pkgs/redshift-wayland/metadata.nix
new file mode 100644
index 000000000000..7ba22c2eed93
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs/redshift-wayland/metadata.nix
@@ -0,0 +1,7 @@
+{
+  repo_git = "https://github.com/minus7/redshift";
+  branch = "wayland";
+  rev = "7da875d34854a6a34612d5ce4bd8718c32bec804";
+  sha256 = "0nbkcw3avmzjg1jr1g9yfpm80kzisy55idl09b6wvzv2sz27n957";
+  revdate = "2019-08-24 15:20:17Z";
+}
diff --git a/overlays/patches/nixpkgs-wayland/pkgs/rootbar/default.nix b/overlays/patches/nixpkgs-wayland/pkgs/rootbar/default.nix
new file mode 100644
index 000000000000..d045c37c14a4
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs/rootbar/default.nix
@@ -0,0 +1,39 @@
+{ stdenv, fetchhg
+, meson, ninja, pkgconfig
+, wayland, wayland-protocols
+, gtk3, json_c, libpulseaudio
+}:
+
+let
+  metadata = import ./metadata.nix;
+in
+stdenv.mkDerivation rec {
+  name = "${pname}-${version}";
+  pname = "rootbar";
+  version = metadata.rev;
+
+  src = fetchhg {
+    url = "https://hg.sr.ht/~scoopta/rootbar";
+    rev = version;
+    sha256 = metadata.sha256;
+  };
+
+  nativeBuildInputs = [
+    meson ninja pkgconfig
+  ];
+
+  buildInputs = [
+    wayland wayland-protocols
+    gtk3 json_c libpulseaudio
+  ];
+
+  enableParallelBuilding = true;
+
+  meta = with stdenv.lib; {
+    description = "Root Bar is a bar for wlroots based wayland compositors such as sway and was designed to address the lack of good bars for wayland";
+    homepage    = "https://hg.sr.ht/~scoopta/rootbar";
+    #license     = #TODO;
+    platforms   = platforms.linux;
+    maintainers = with maintainers; [ colemickens ];
+  };
+}
diff --git a/overlays/patches/nixpkgs-wayland/pkgs/rootbar/metadata.nix b/overlays/patches/nixpkgs-wayland/pkgs/rootbar/metadata.nix
new file mode 100644
index 000000000000..6a31762368a8
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs/rootbar/metadata.nix
@@ -0,0 +1,7 @@
+{
+  repo_hg = "https://hg.sr.ht/~scoopta/rootbar";
+  branch = "default";
+  rev = "1fdbe65e12e2";
+  sha256 = "0p24jhi7lghhcbn6r13kk9156vp3zplandibb8d8nzxf5sr6jnfw";
+  revdate = "2020-04-07 01:06:53";
+}
diff --git a/overlays/patches/nixpkgs-wayland/pkgs/slurp/default.nix b/overlays/patches/nixpkgs-wayland/pkgs/slurp/default.nix
new file mode 100644
index 000000000000..b556b921856f
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs/slurp/default.nix
@@ -0,0 +1,40 @@
+{ stdenv, fetchFromGitHub
+, meson, ninja, pkgconfig
+, cairo, wayland, wayland-protocols
+, scdoc, buildDocs ? true
+, libxkbcommon
+}:
+
+let
+  metadata = import ./metadata.nix;
+in
+stdenv.mkDerivation rec {
+  name = "slurp-${version}";
+  version = metadata.rev;
+
+  src = fetchFromGitHub {
+    owner = "emersion";
+    repo = "slurp";
+    rev = version;
+    sha256 = metadata.sha256;
+  };
+
+  nativeBuildInputs = [ pkgconfig meson ninja ] ++ stdenv.lib.optional buildDocs scdoc;
+  buildInputs = [
+    cairo wayland wayland-protocols
+    libxkbcommon
+  ];
+  mesonFlags = [
+    "-Dauto_features=enabled"
+  ] ++ stdenv.lib.optional (!buildDocs) "-Dman-pages=disabled";
+
+  enableParallelBuilding = true;
+
+  meta = with stdenv.lib; {
+    description = "Select a region in a Wayland compositor";
+    homepage    = https://github.com/emersion/slurp;
+    license     = licenses.mit;
+    platforms   = platforms.linux;
+    maintainers = with maintainers; [ colemickens ];
+  };
+}
diff --git a/overlays/patches/nixpkgs-wayland/pkgs/slurp/metadata.nix b/overlays/patches/nixpkgs-wayland/pkgs/slurp/metadata.nix
new file mode 100644
index 000000000000..4c9667795324
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs/slurp/metadata.nix
@@ -0,0 +1,7 @@
+{
+  repo_git = "https://github.com/emersion/slurp";
+  branch = "master";
+  rev = "24d30b74d8063659c22abbde6aea34a03e467aa6";
+  sha256 = "0fs4vfw01qxn1gznbypjl3asjwgwi8pb5l8awjv56jl0hzslqfzs";
+  revdate = "2020-08-03 09:44:19Z";
+}
diff --git a/overlays/patches/nixpkgs-wayland/pkgs/sway/default.nix b/overlays/patches/nixpkgs-wayland/pkgs/sway/default.nix
new file mode 100644
index 000000000000..9bc77b0f5b9b
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs/sway/default.nix
@@ -0,0 +1,56 @@
+{ stdenv, fetchFromGitHub, makeWrapper
+, meson, ninja
+, pkgconfig, scdoc
+, wayland, libxkbcommon, pcre, json_c, dbus, libevdev
+, pango, cairo, libinput, libcap, pam, gdk-pixbuf
+, wlroots, wayland-protocols
+}:
+
+let metadata = import ./metadata.nix; in
+stdenv.mkDerivation rec {
+  pname = "sway-unwrapped";
+  version = "${metadata.rev}";
+
+  src = fetchFromGitHub {
+    owner = "swaywm";
+    repo = "sway";
+    rev = metadata.rev;
+    sha256 = metadata.sha256;
+  };
+
+  patches = [
+    ./sway-config-no-nix-store-references.patch
+    ./load-configuration-from-etc.patch
+  ];
+
+  postPatch = ''
+    # replace the version
+    date="$(date -d '${metadata.revdate}' +'%b %d %Y')"
+    sed -i "s/\([ \t]\)version: '\(.*\)',/\1version: '\2-${stdenv.lib.substring 0 8 metadata.rev} ($date, branch \\\'${metadata.branch}\\\')',/" meson.build
+  '';
+
+  nativeBuildInputs = [
+    pkgconfig meson ninja scdoc
+  ];
+
+  buildInputs = [
+    wayland libxkbcommon pcre json_c dbus libevdev
+    pango cairo libinput libcap pam gdk-pixbuf
+    wlroots wayland-protocols
+  ];
+
+  enableParallelBuilding = true;
+
+  mesonFlags = [
+    "-Ddefault-wallpaper=false" "-Dxwayland=enabled" "-Dgdk-pixbuf=enabled"
+    "-Dtray=enabled" "-Dman-pages=enabled"
+  ];
+
+  meta = with stdenv.lib; {
+    description = "i3-compatible tiling Wayland compositor";
+    homepage    = https://swaywm.org;
+    license     = licenses.mit;
+    platforms   = platforms.linux;
+    maintainers = with maintainers; [ primeos synthetica ];
+  };
+}
diff --git a/overlays/patches/nixpkgs-wayland/pkgs/sway/load-configuration-from-etc.patch b/overlays/patches/nixpkgs-wayland/pkgs/sway/load-configuration-from-etc.patch
new file mode 100644
index 000000000000..ba883682e7bb
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs/sway/load-configuration-from-etc.patch
@@ -0,0 +1,43 @@
+From 26f9c65ef037892977a824f0d7d7111066856b53 Mon Sep 17 00:00:00 2001
+From: Michael Weiss <dev.primeos@gmail.com>
+Date: Sat, 27 Apr 2019 14:26:16 +0200
+Subject: [PATCH] Load configs from /etc but fallback to /nix/store
+
+This change will load all configuration files from /etc, to make it easy
+to override them, but fallback to /nix/store/.../etc/sway/config to make
+Sway work out-of-the-box with the default configuration on non NixOS
+systems.
+---
+ meson.build   | 3 ++-
+ sway/config.c | 1 +
+ 2 files changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/meson.build b/meson.build
+index 02b5d606..c03a9c0f 100644
+--- a/meson.build
++++ b/meson.build
+@@ -129,7 +129,8 @@ if scdoc.found()
+ 	endforeach
+ endif
+ 
+-add_project_arguments('-DSYSCONFDIR="/@0@"'.format(join_paths(prefix, sysconfdir)), language : 'c')
++add_project_arguments('-DSYSCONFDIR="/@0@"'.format(sysconfdir), language : 'c')
++add_project_arguments('-DNIX_SYSCONFDIR="/@0@"'.format(join_paths(prefix, sysconfdir)), language : 'c')
+ 
+ version = '"@0@"'.format(meson.project_version())
+ if git.found()
+diff --git a/sway/config.c b/sway/config.c
+index 4cd21bbc..dd855753 100644
+--- a/sway/config.c
++++ b/sway/config.c
+@@ -317,6 +317,7 @@ static char *get_config_path(void) {
+ 		"$XDG_CONFIG_HOME/i3/config",
+ 		SYSCONFDIR "/sway/config",
+ 		SYSCONFDIR "/i3/config",
++		NIX_SYSCONFDIR "/sway/config",
+ 	};
+ 
+ 	char *config_home = getenv("XDG_CONFIG_HOME");
+-- 
+2.19.2
+
diff --git a/overlays/patches/nixpkgs-wayland/pkgs/sway/metadata.nix b/overlays/patches/nixpkgs-wayland/pkgs/sway/metadata.nix
new file mode 100644
index 000000000000..463484605992
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs/sway/metadata.nix
@@ -0,0 +1,8 @@
+{
+  repo_git = "https://github.com/swaywm/sway";
+  branch = "master";
+  upattr = "sway-unwrapped";
+  rev = "6991ac8c70869ca19a87cfc173e280cab7ff20d0";
+  sha256 = "sha256-LJFnprMblFxmTv782gwCls2X+6qDLD//b6fbuDJ8cTg=";
+  revdate = "2020-08-11 22:37:11Z";
+}
diff --git a/overlays/patches/nixpkgs-wayland/pkgs/sway/sway-config-no-nix-store-references.patch b/overlays/patches/nixpkgs-wayland/pkgs/sway/sway-config-no-nix-store-references.patch
new file mode 100644
index 000000000000..009c12959430
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs/sway/sway-config-no-nix-store-references.patch
@@ -0,0 +1,21 @@
+diff --git a/config.in b/config.in
+--- a/config.in
++++ b/config.in
+@@ -21,8 +21,8 @@ set $menu dmenu_path | dmenu | xargs swaymsg exec
+ 
+ ### Output configuration
+ #
+-# Default wallpaper (more resolutions are available in @datadir@/backgrounds/sway/)
+-output * bg @datadir@/backgrounds/sway/Sway_Wallpaper_Blue_1920x1080.png fill
++# Default wallpaper
++#output * bg ~/.config/sway/backgrounds/Sway_Wallpaper_Blue_1920x1080.png fill
+ #
+ # Example configuration:
+ #
+@@ -213,5 +213,3 @@ bar {
+         inactive_workspace #32323200 #32323200 #5c5c5c
+     }
+ }
+-
+-include @sysconfdir@/sway/config.d/*
+
diff --git a/overlays/patches/nixpkgs-wayland/pkgs/swaybg/default.nix b/overlays/patches/nixpkgs-wayland/pkgs/swaybg/default.nix
new file mode 100644
index 000000000000..738a17f24a49
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs/swaybg/default.nix
@@ -0,0 +1,42 @@
+{ stdenv, fetchFromGitHub
+, meson, ninja, pkgconfig
+, cairo, wayland, wayland-protocols
+, gdk_pixbuf, nonPngSupport ? true
+, scdoc, buildDocs ? true
+}:
+
+let
+  metadata = import ./metadata.nix;
+in
+stdenv.mkDerivation rec {
+  pname = "swaybg";
+  version = metadata.rev;
+
+  src = fetchFromGitHub {
+    owner = "swaywm";
+    repo = "swaybg";
+    rev = version;
+    sha256 = metadata.sha256;
+  };
+
+  postPatch = ''
+    sed -iE "0,/version: '.*',/ s//version: '${version}',/" meson.build
+  '';
+
+  nativeBuildInputs = [ pkgconfig meson ninja ] ++ stdenv.lib.optional buildDocs scdoc;
+
+  buildInputs = [ cairo wayland wayland-protocols ] ++ stdenv.lib.optional nonPngSupport gdk_pixbuf;
+
+  mesonFlags = stdenv.lib.optional nonPngSupport "-Dgdk-pixbuf=enabled"
+    ++ stdenv.lib.optional buildDocs "-Dman-pages=enabled";
+
+  enableParallelBuilding = true;
+
+  meta = with stdenv.lib; {
+    description = "Wallpaper tool for Wayland compositors";
+    homepage    = https://github.com/swaywm/swaybg;
+    license     = licenses.mit;
+    platforms   = platforms.linux;
+    maintainers = with maintainers; [  ];
+  };
+}
diff --git a/overlays/patches/nixpkgs-wayland/pkgs/swaybg/metadata.nix b/overlays/patches/nixpkgs-wayland/pkgs/swaybg/metadata.nix
new file mode 100644
index 000000000000..19ba8baddc8b
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs/swaybg/metadata.nix
@@ -0,0 +1,7 @@
+{
+  repo_git = "https://github.com/swaywm/swaybg";
+  branch = "master";
+  rev = "a8f109af90353369e7e2e689efe8ce06eb9c60ac";
+  sha256 = "0w0vyckh01mzr479jjqdc6dyj84gcc2k8q7x8v4b0d445za4hrar";
+  revdate = "2019-08-08 23:03:44Z";
+}
diff --git a/overlays/patches/nixpkgs-wayland/pkgs/swayidle/default.nix b/overlays/patches/nixpkgs-wayland/pkgs/swayidle/default.nix
new file mode 100644
index 000000000000..b495654894a6
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs/swayidle/default.nix
@@ -0,0 +1,51 @@
+{ stdenv, fetchFromGitHub
+, meson, ninja
+, pkgconfig, scdoc
+, wayland, wayland-protocols
+, systemd
+, buildDocs ? true
+}:
+
+let
+  metadata = import ./metadata.nix;
+in
+stdenv.mkDerivation rec {
+  name = "${pname}-${version}";
+  pname = "swayidle";
+  version = metadata.rev;
+
+  src = fetchFromGitHub {
+    owner = "swaywm";
+    repo = "swayidle";
+    rev = version;
+    sha256 = metadata.sha256;
+  };
+
+  postPatch = ''
+    sed -iE "0,/version: '.*',/ s//version: '${version}',/" meson.build
+  '';
+
+  nativeBuildInputs = [
+    pkgconfig meson ninja
+  ] ++ stdenv.lib.optional buildDocs scdoc;
+
+  buildInputs = [
+    systemd
+    wayland wayland-protocols
+  ];
+
+  mesonFlags = [
+    "-Dlogind=enabled"
+    "-Dlogind-provider=systemd"
+  ] ++ stdenv.lib.optional buildDocs "-Dman-pages=enabled";
+
+  enableParallelBuilding = true;
+
+  meta = with stdenv.lib; {
+    description = "Sway's idle management daemon";
+    homepage    = https://swaywm.org;
+    license     = licenses.mit;
+    platforms   = platforms.linux;
+    maintainers = with maintainers; [ primeos synthetica ]; # Trying to keep it up-to-date.
+  };
+}
diff --git a/overlays/patches/nixpkgs-wayland/pkgs/swayidle/metadata.nix b/overlays/patches/nixpkgs-wayland/pkgs/swayidle/metadata.nix
new file mode 100644
index 000000000000..2ab0ce765e93
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs/swayidle/metadata.nix
@@ -0,0 +1,7 @@
+{
+  repo_git = "https://github.com/swaywm/swayidle";
+  branch = "master";
+  rev = "04a176ee91aee6cca45aa91b95f2626ecb2fbb28";
+  sha256 = "0g5h1fvc8g6ap0p2zj3srkxy4gp296ycacxnd08x1gh4gah97242";
+  revdate = "2020-04-30 10:15:57Z";
+}
diff --git a/overlays/patches/nixpkgs-wayland/pkgs/swaylock/default.nix b/overlays/patches/nixpkgs-wayland/pkgs/swaylock/default.nix
new file mode 100644
index 000000000000..2ec64efdbec4
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs/swaylock/default.nix
@@ -0,0 +1,52 @@
+{ stdenv, fetchFromGitHub
+, meson, ninja
+, pkgconfig, scdoc
+, wayland, wayland-protocols
+, libxkbcommon, cairo, pango, gdk_pixbuf, pam
+, buildDocs ? true
+}:
+
+let
+  metadata = import ./metadata.nix;
+in
+stdenv.mkDerivation rec {
+  name = "${pname}-${version}";
+  pname = "swaylock";
+  version = metadata.rev;
+
+  src = fetchFromGitHub {
+    owner = "swaywm";
+    repo = "swaylock";
+    rev = version;
+    sha256 = metadata.sha256;
+  };
+
+  postPatch = ''
+    sed -iE "0,/version: '.*',/ s//version: '${version}',/" meson.build
+  '';
+
+  nativeBuildInputs = [
+    pkgconfig meson ninja
+  ] ++ stdenv.lib.optional buildDocs scdoc;
+
+  buildInputs = [
+    wayland wayland-protocols
+    libxkbcommon cairo pango gdk_pixbuf pam
+  ];
+
+  mesonFlags = [
+    "-Dswaylock-version=${version}"
+    "-Dpam=enabled"
+    "-Dgdk-pixbuf=enabled"
+  ] ++ stdenv.lib.optional buildDocs "-Dman-pages=enabled";
+
+  enableParallelBuilding = true;
+
+  meta = with stdenv.lib; {
+    description = "Screen locker for Wayland";
+    homepage    = https://swaywm.org;
+    license     = licenses.mit;
+    platforms   = platforms.linux;
+    maintainers = with maintainers; [ primeos synthetica ]; # Trying to keep it up-to-date.
+  };
+}
diff --git a/overlays/patches/nixpkgs-wayland/pkgs/swaylock/metadata.nix b/overlays/patches/nixpkgs-wayland/pkgs/swaylock/metadata.nix
new file mode 100644
index 000000000000..9f50a0e2113f
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs/swaylock/metadata.nix
@@ -0,0 +1,7 @@
+{
+  repo_git = "https://github.com/swaywm/swaylock";
+  branch = "master";
+  rev = "c46a5197a24c7597404199165763239eb60fe714";
+  sha256 = "0lklk9j90wnziakya25j6y3x6iq6vqjvhj3iazpwkfmhd8rvkdr5";
+  revdate = "2020-07-13 13:49:10Z";
+}
diff --git a/overlays/patches/nixpkgs-wayland/pkgs/waybar/default.nix b/overlays/patches/nixpkgs-wayland/pkgs/waybar/default.nix
new file mode 100644
index 000000000000..715f3e098c91
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs/waybar/default.nix
@@ -0,0 +1,61 @@
+{ stdenv, fetchFromGitHub
+, meson, ninja, pkgconfig, scdoc
+, wayland, wayland-protocols, sway, wlroots
+, libpulseaudio, libinput, libnl, gtkmm3
+, fmt, jsoncpp, libdbusmenu-gtk3
+, glib
+, spdlog
+, mpd_clientlib
+, gtk-layer-shell
+, coreutils
+, howard-hinnant-date
+}:
+
+let
+  metadata = import ./metadata.nix;
+in
+stdenv.mkDerivation rec {
+  name = "waybar-${version}";
+  version = metadata.rev;
+
+  src = fetchFromGitHub {
+    owner = "Alexays";
+    repo = "Waybar";
+    rev = version;
+    sha256 = metadata.sha256;
+  };
+
+  postPatch = ''
+      date="$(date -d '${metadata.revdate}' +'%b %d %Y')"
+      sed -i "s/\([ \t]\)version: '\(.*\)',/\1version: '\2-${stdenv.lib.substring 0 8 metadata.rev} ($date, branch \\\'${metadata.branch}\\\')',/" meson.build
+  '';
+
+  nativeBuildInputs = [ meson ninja pkgconfig scdoc ];
+  buildInputs = [
+    wayland wayland-protocols sway wlroots
+    libpulseaudio libinput libnl gtkmm3
+    fmt jsoncpp libdbusmenu-gtk3
+    glib
+    spdlog
+    mpd_clientlib
+    gtk-layer-shell
+    coreutils
+    howard-hinnant-date
+  ];
+  mesonFlags = [
+    "-Dauto_features=enabled"
+    "-Dout=${placeholder "out"}"
+    "-Dsystemd=disabled"
+  ];
+
+  enableParallelBuilding = true;
+
+  meta = with stdenv.lib; {
+    description = "Highly customizable Wayland Polybar like bar for Sway and Wlroots based compositors.";
+    homepage    = https://github.com/Alexays/Waybar;
+    license     = licenses.mit;
+    platforms   = platforms.linux;
+    maintainers = with maintainers; [ colemickens ];
+  };
+}
+
diff --git a/overlays/patches/nixpkgs-wayland/pkgs/waybar/metadata.nix b/overlays/patches/nixpkgs-wayland/pkgs/waybar/metadata.nix
new file mode 100644
index 000000000000..ce251b9934e9
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs/waybar/metadata.nix
@@ -0,0 +1,7 @@
+{
+  repo_git = "https://github.com/Alexays/Waybar";
+  branch = "master";
+  rev = "0cf3b25d50c4ef0fc3b57913685add5fd65e2c42";
+  sha256 = "1pci4xgr1x4fq6mi8s7zzvk3m8smrm09igg6sp330kgz3qzpbj4l";
+  revdate = "2020-08-15 08:59:12Z";
+}
diff --git a/overlays/patches/nixpkgs-wayland/pkgs/waybox/default.nix b/overlays/patches/nixpkgs-wayland/pkgs/waybox/default.nix
new file mode 100644
index 000000000000..1dce3390b247
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs/waybox/default.nix
@@ -0,0 +1,40 @@
+{ stdenv, fetchFromGitHub
+, meson, ninja, pkgconfig
+, wlroots, wayland, wayland-protocols
+, pixman, libxkbcommon
+, libudev, mesa_noglu, libX11 # not mentioned in meson.build...
+, libGL
+}:
+
+let
+  metadata = import ./metadata.nix;
+in
+stdenv.mkDerivation rec {
+  name = "waybox-${version}";
+  version = metadata.rev;
+
+  src = fetchFromGitHub {
+    owner = "wizbright";
+    repo = "waybox";
+    rev = version;
+    sha256 = metadata.sha256;
+  };
+
+  nativeBuildInputs = [ pkgconfig meson ninja ];
+  buildInputs = [
+    wlroots wayland wayland-protocols wlroots
+    pixman libxkbcommon libudev mesa_noglu libX11
+    libGL
+  ];
+  mesonFlags = [ "-Dauto_features=enabled" ];
+
+  enableParallelBuilding = true;
+
+  meta = with stdenv.lib; {
+    description = "An openbox clone on Wayland (WIP)";
+    homepage    = "https://github.com/wizbright/waybox";
+    license     = licenses.mit;
+    platforms   = platforms.linux;
+    maintainers = with maintainers; [ colemickens ];
+  };
+}
diff --git a/overlays/patches/nixpkgs-wayland/pkgs/waybox/metadata.nix b/overlays/patches/nixpkgs-wayland/pkgs/waybox/metadata.nix
new file mode 100644
index 000000000000..894abbca1812
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs/waybox/metadata.nix
@@ -0,0 +1,7 @@
+{
+  repo_git = "https://github.com/wizbright/waybox";
+  branch = "master";
+  rev = "93811898f0eea3035145f593938d49d5af759b46";
+  sha256 = "08q5iid7jsj5w4xf8jhhm4bx3jc08kaz0pbvng8ww3qhl0x4mrr0";
+  revdate = "2020-05-01 03:02:14Z";
+}
diff --git a/overlays/patches/nixpkgs-wayland/pkgs/wayfire/default.nix b/overlays/patches/nixpkgs-wayland/pkgs/wayfire/default.nix
new file mode 100644
index 000000000000..9459d7d14c56
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs/wayfire/default.nix
@@ -0,0 +1,55 @@
+{ stdenv, fetchFromGitHub
+, meson, pkgconfig, ninja
+, wayland, wayland-protocols
+, cairo, glm
+, libevdev, freetype, libinput
+, pixman, libxkbcommon, libdrm
+, libjpeg, libpng
+, libGL, mesa
+, libcap, xcbutilerrors, xcbutilwm, libxml2
+, buildDocs ? true
+}:
+
+let
+  metadata = import ./metadata.nix;
+in
+stdenv.mkDerivation rec {
+  name = "${pname}-${version}";
+  pname = "wayfire";
+  version = metadata.rev;
+
+  src = fetchFromGitHub {
+    owner = "WayfireWM";
+    repo = "wayfire";
+    rev = version;
+    sha256 = metadata.sha256;
+    fetchSubmodules = true;
+  };
+
+  nativeBuildInputs = [ pkgconfig meson ninja ];
+  buildInputs = [
+    # egl glesv2
+    wayland wayland-protocols
+    cairo glm
+    libevdev freetype libinput
+    pixman libxkbcommon libdrm
+    libjpeg libpng
+    libGL mesa
+    libcap xcbutilerrors xcbutilwm libxml2
+  ];
+  mesonFlags = [
+    "-Duse_system_wlroots=disabled"
+    "-Duse_system_wfconfig=disabled"
+    "-Dwlroots:logind-provider=systemd"
+  ];
+
+  enableParallelBuilding = true;
+
+  meta = with stdenv.lib; {
+    description = "3D wayland compositor";
+    homepage    = "https://wayfire.org/";
+    license     = licenses.mit;
+    platforms   = platforms.linux;
+    maintainers = with maintainers; [ colemickens ];
+  };
+}
diff --git a/overlays/patches/nixpkgs-wayland/pkgs/wayfire/metadata.nix b/overlays/patches/nixpkgs-wayland/pkgs/wayfire/metadata.nix
new file mode 100644
index 000000000000..239ef9979bb0
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs/wayfire/metadata.nix
@@ -0,0 +1,7 @@
+{
+  repo_git = "https://github.com/WayfireWM/wayfire";
+  branch = "master";
+  rev = "66e9a6480105efc52c9e9264c7881c8efd4b6286";
+  sha256 = "0jflybnr2c94l3fzd1d6bavi2m8hwddnpirs7pgrhyx9kfn7mma6";
+  revdate = "2020-08-15 15:55:56Z";
+}
diff --git a/overlays/patches/nixpkgs-wayland/pkgs/waypipe/default.nix b/overlays/patches/nixpkgs-wayland/pkgs/waypipe/default.nix
new file mode 100644
index 000000000000..1a5de663b237
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs/waypipe/default.nix
@@ -0,0 +1,40 @@
+{ stdenv, fetchgit
+, meson, ninja, pkgconfig, python3
+, wayland, wayland-protocols
+, libffi, mesa_noglu
+, lz4, zstd, ffmpeg_4, libva
+, scdoc
+}:
+
+let
+  metadata = import ./metadata.nix;
+in
+stdenv.mkDerivation rec {
+  name = "waypipe-${version}";
+  version = metadata.rev;
+
+  src = fetchgit {
+    url = "https://gitlab.freedesktop.org/mstoeckl/waypipe.git";
+    rev = version;
+    sha256 = metadata.sha256;
+  };
+
+  nativeBuildInputs = [ pkgconfig meson ninja python3 scdoc ];
+  buildInputs = [
+    wayland wayland-protocols
+    libffi mesa_noglu
+    lz4 zstd ffmpeg_4 libva
+  ];
+  mesonFlags = [ "-Dauto_features=enabled" ];
+  NIX_CFLAGS_COMPILE = "-Wno-error=unused-result";
+
+  enableParallelBuilding = true;
+
+  meta = with stdenv.lib; {
+    description = "Network transparency with Wayland";
+    homepage    = "https://gitlab.freedesktop.org/mstoeckl/waypipe/";
+    license = licenses.mit; # expat?? TODO
+    platforms   = platforms.linux;
+    maintainers = with maintainers; [ colemickens ];
+  };
+}
diff --git a/overlays/patches/nixpkgs-wayland/pkgs/waypipe/metadata.nix b/overlays/patches/nixpkgs-wayland/pkgs/waypipe/metadata.nix
new file mode 100644
index 000000000000..c316ce75af61
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs/waypipe/metadata.nix
@@ -0,0 +1,7 @@
+{
+  repo_git = "https://gitlab.freedesktop.org/mstoeckl/waypipe.git";
+  branch = "master";
+  rev = "5eef66b997400d7beecc2ef914f59b27e5505b2c";
+  sha256 = "0bkmibask7gfnwkn3fg3l6zaabp95n1zsdnz3dwng8j80a0kakyy";
+  revdate = "2020-07-06 00:16:52Z";
+}
diff --git a/overlays/patches/nixpkgs-wayland/pkgs/wayvnc/default.nix b/overlays/patches/nixpkgs-wayland/pkgs/wayvnc/default.nix
new file mode 100644
index 000000000000..3c299cffa64d
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs/wayvnc/default.nix
@@ -0,0 +1,44 @@
+{ stdenv, fetchFromGitHub
+, pkgconfig, meson, ninja
+, wayland, wayland-protocols
+, libxkbcommon, libvncserver
+, libpthreadstubs
+, pixman, libuv, libglvnd
+, neatvnc, libX11, libdrm
+, aml, mesa
+}:
+
+let
+  metadata = import ./metadata.nix;
+in
+stdenv.mkDerivation rec {
+  name = "wayvnc-${version}";
+  version = metadata.rev;
+
+  src = fetchFromGitHub {
+    owner = "any1";
+    repo = "wayvnc";
+    rev = metadata.rev;
+    sha256 = metadata.sha256;
+  };
+
+  nativeBuildInputs = [ pkgconfig meson ninja ];
+  buildInputs = [
+    wayland wayland-protocols
+    libxkbcommon libvncserver
+    libpthreadstubs
+    pixman libuv libglvnd
+    neatvnc libX11 libdrm
+    aml mesa
+  ];
+
+  enableParallelBuilding = true;
+
+  meta = with stdenv.lib; {
+    description = "A VNC server for wlroots based Wayland compositors";
+    homepage    = "https://github.com/any1/wayvnc";
+    license     = licenses.isc;
+    platforms   = platforms.linux;
+    maintainers = with maintainers; [ colemickens ];
+  };
+}
diff --git a/overlays/patches/nixpkgs-wayland/pkgs/wayvnc/metadata.nix b/overlays/patches/nixpkgs-wayland/pkgs/wayvnc/metadata.nix
new file mode 100644
index 000000000000..807973abfbf0
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs/wayvnc/metadata.nix
@@ -0,0 +1,7 @@
+{
+  repo_git = "https://github.com/any1/wayvnc";
+  branch = "master";
+  rev = "d8f94d261386c47559e9681757805829388dcbc3";
+  sha256 = "0vgfr5hyvivkj3hsp1ajcl9ncdj6icghyj95w24xwziy0rx3ldhz";
+  revdate = "2020-07-31 18:23:25Z";
+}
diff --git a/overlays/patches/nixpkgs-wayland/pkgs/wdisplays/default.nix b/overlays/patches/nixpkgs-wayland/pkgs/wdisplays/default.nix
new file mode 100644
index 000000000000..ccd2cf3a5756
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs/wdisplays/default.nix
@@ -0,0 +1,36 @@
+{stdenv, fetchFromGitHub
+, meson, ninja, pkgconfig
+, gtk3, epoxy
+, wayland, wayland-protocols
+, scdoc, buildDocs ? true
+}:
+
+let
+  metadata = import ./metadata.nix;
+in
+stdenv.mkDerivation rec {
+  pname = "wdisplays";
+  version = metadata.rev;
+
+  src = fetchFromGitHub {
+    owner = "cyclopsian";
+    repo = "wdisplays";
+    rev = version;
+    sha256 = metadata.sha256;
+  };
+
+  nativeBuildInputs = [ pkgconfig meson ninja ] ++ stdenv.lib.optional buildDocs scdoc;
+  buildInputs = [ gtk3 epoxy wayland wayland-protocols ];
+  mesonFlags = [ "-Dauto_features=enabled" ]
+    ++ stdenv.lib.optional (!buildDocs) "-Dman-pages=disabled";
+
+  enableParallelBuilding = true;
+
+  meta = with stdenv.lib; {
+    description = "GUI display configurator for wlroots compositors";
+    homepage    = "https://github.com/cyclopsian/wdisplays";
+    license     = licenses.mit;
+    platforms   = platforms.linux;
+    maintainers = with maintainers; [ colemickens ];
+  };
+}
diff --git a/overlays/patches/nixpkgs-wayland/pkgs/wdisplays/metadata.nix b/overlays/patches/nixpkgs-wayland/pkgs/wdisplays/metadata.nix
new file mode 100644
index 000000000000..0d3206aad58f
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs/wdisplays/metadata.nix
@@ -0,0 +1,7 @@
+{
+  repo_git = "https://github.com/cyclopsian/wdisplays";
+  branch = "master";
+  rev = "dd7e1e22ee04cf37ecc8b48cdb0c103de18e8761";
+  sha256 = "1dyaqhlfv4s5w9mgyl2li2ca7ya5wx2j8942vkkra8z0rbs3m3qi";
+  revdate = "2020-05-09 19:42:15Z";
+}
diff --git a/overlays/patches/nixpkgs-wayland/pkgs/wev/default.nix b/overlays/patches/nixpkgs-wayland/pkgs/wev/default.nix
new file mode 100644
index 000000000000..6ab67d0385cb
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs/wev/default.nix
@@ -0,0 +1,40 @@
+{ stdenv, fetchgit
+, pkgconfig, scdoc
+, wayland, wayland-protocols
+, libxkbcommon
+}:
+
+let
+  metadata = import ./metadata.nix;
+in
+stdenv.mkDerivation rec {
+  name = "${pname}-${version}";
+  pname = "wev";
+  version = metadata.rev;
+
+  src = fetchgit {
+    url = metadata.repo_git;
+    rev = metadata.rev;
+    sha256 = metadata.sha256;
+  };
+
+  nativeBuildInputs = [ pkgconfig scdoc ];
+  buildInputs = [
+    wayland wayland-protocols
+    libxkbcommon
+  ];
+
+  installFlags = [
+    "PREFIX=$(out)"
+  ];
+
+  enableParallelBuilding = true;
+
+  meta = with stdenv.lib; {
+    description = "A tool for debugging events on a Wayland window, analagous to the X11 tool xev.";
+    homepage    = "https://git.sr.ht/~sircmpwn/wev";
+    #license     = licenses.unknown;
+    platforms   = platforms.linux;
+    maintainers = with maintainers; [ primeos synthetica ];
+  };
+}
diff --git a/overlays/patches/nixpkgs-wayland/pkgs/wev/metadata.nix b/overlays/patches/nixpkgs-wayland/pkgs/wev/metadata.nix
new file mode 100644
index 000000000000..dcaab9ad7ec5
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs/wev/metadata.nix
@@ -0,0 +1,7 @@
+{
+  repo_git = "https://git.sr.ht/~sircmpwn/wev";
+  branch = "master";
+  rev = "0be512fb705831b55020e1eaf86eedba0eae4a75";
+  sha256 = "0dbw4fc7j28mvvd85kj941vpjikdj2wvkw5kpz61h1akg9m0pdg2";
+  revdate = "2020-07-07 15:20:53Z";
+}
diff --git a/overlays/patches/nixpkgs-wayland/pkgs/wf-recorder/default.nix b/overlays/patches/nixpkgs-wayland/pkgs/wf-recorder/default.nix
new file mode 100644
index 000000000000..c88a008136ca
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs/wf-recorder/default.nix
@@ -0,0 +1,31 @@
+{ stdenv, fetchFromGitHub
+, meson, ninja, pkgconfig
+, wayland, wayland-protocols
+, ffmpeg, x264, libpulseaudio
+, scdoc, opencl-headers, ocl-icd
+}:
+
+let
+  metadata = import ./metadata.nix;
+in
+stdenv.mkDerivation rec {
+  pname = "wf-recorder";
+  version = metadata.rev;
+
+  src = fetchFromGitHub {
+    owner = "ammen99";
+    repo = pname;
+    inherit (metadata) rev sha256;
+  };
+
+  nativeBuildInputs = [ meson ninja pkgconfig scdoc ];
+  buildInputs = [ wayland wayland-protocols ffmpeg x264 libpulseaudio opencl-headers ocl-icd ];
+
+  meta = with stdenv.lib; {
+    description = "Utility program for screen recording of wlroots-based compositors";
+    homepage = https://github.com/ammen99/wf-recorder;
+    license = licenses.mit;
+    maintainers = with maintainers; [ CrazedProgrammer ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/overlays/patches/nixpkgs-wayland/pkgs/wf-recorder/metadata.nix b/overlays/patches/nixpkgs-wayland/pkgs/wf-recorder/metadata.nix
new file mode 100644
index 000000000000..50b606c98bed
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs/wf-recorder/metadata.nix
@@ -0,0 +1,7 @@
+{
+  repo_git = "https://github.com/ammen99/wf-recorder";
+  branch = "master";
+  rev = "02a527aba870629283208667d2a66a1b2c9523c1";
+  sha256 = "0c3j1vk084qb4qb803488mzrwvh9jh3y3k645wsxj2csdmnanxzb";
+  revdate = "2020-07-19 12:45:44Z";
+}
diff --git a/overlays/patches/nixpkgs-wayland/pkgs/wl-clipboard/default.nix b/overlays/patches/nixpkgs-wayland/pkgs/wl-clipboard/default.nix
new file mode 100644
index 000000000000..f8f5bac2561f
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs/wl-clipboard/default.nix
@@ -0,0 +1,33 @@
+{ stdenv, fetchFromGitHub
+, meson, ninja, pkgconfig
+, wayland, wayland-protocols
+}:
+
+let
+  metadata = import ./metadata.nix;
+in
+stdenv.mkDerivation rec {
+  name = "wl-clipboard-${version}";
+  version = metadata.rev;
+
+  src = fetchFromGitHub {
+    owner = "bugaevc";
+    repo = "wl-clipboard";
+    rev = version;
+    sha256 = metadata.sha256;
+  };
+
+  nativeBuildInputs = [ pkgconfig meson ninja ];
+  buildInputs = [ wayland wayland-protocols ];
+  mesonFlags = [ "-Dfishcompletiondir=no"];
+
+  enableParallelBuilding = true;
+
+  meta = with stdenv.lib; {
+    description = "Select a region in a Wayland compositor";
+    homepage    = https://github.com/bugaevc/wl-clipboard;
+    #license     = licenses.mit; # TODO none listed
+    platforms   = platforms.linux;
+    maintainers = with maintainers; [ colemickens ];
+  };
+}
diff --git a/overlays/patches/nixpkgs-wayland/pkgs/wl-clipboard/metadata.nix b/overlays/patches/nixpkgs-wayland/pkgs/wl-clipboard/metadata.nix
new file mode 100644
index 000000000000..a4d1379ba678
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs/wl-clipboard/metadata.nix
@@ -0,0 +1,7 @@
+{
+  repo_git = "https://github.com/bugaevc/wl-clipboard";
+  branch = "master";
+  rev = "2c3cee1c8173d75b1411997b2c0f3e486194ac0c";
+  sha256 = "1apdzrs7l6gqjg05z2xv1ib2wm05c5856v0xlc1kpcp3wm3g5ph0";
+  revdate = "2020-02-13 16:44:26Z";
+}
diff --git a/overlays/patches/nixpkgs-wayland/pkgs/wl-gammactl/default.nix b/overlays/patches/nixpkgs-wayland/pkgs/wl-gammactl/default.nix
new file mode 100644
index 000000000000..0efa75221324
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs/wl-gammactl/default.nix
@@ -0,0 +1,38 @@
+{ stdenv, fetchFromGitHub
+, meson, ninja, pkgconfig
+, wayland, wayland-protocols
+, gtk3, wlroots
+}:
+
+let
+  metadata = import ./metadata.nix;
+in
+stdenv.mkDerivation rec {
+  pname = "wl-gammactl";
+  version = metadata.rev;
+
+  src = fetchFromGitHub {
+    owner = "mischw";
+    repo = pname;
+    inherit (metadata) rev sha256;
+    fetchSubmodules = true;
+  };
+
+  nativeBuildInputs = [ meson ninja pkgconfig ];
+  buildInputs = [
+    gtk3 wlroots
+    wayland wayland-protocols
+  ];
+
+  preConfigure = ''
+    sed -i 32,46d ./meson.build
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Small GTK GUI application to set contrast, brightness and gamma for wayland compositors which support the wlr-gamma-control protocol extension.";
+    homepage = "https://github.com/mischw/wl-gammactl";
+    license = licenses.mit;
+    maintainers = with maintainers; [ colemickens ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/overlays/patches/nixpkgs-wayland/pkgs/wl-gammactl/metadata.nix b/overlays/patches/nixpkgs-wayland/pkgs/wl-gammactl/metadata.nix
new file mode 100644
index 000000000000..f78c3e83b975
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs/wl-gammactl/metadata.nix
@@ -0,0 +1,7 @@
+{
+  repo_git = "https://github.com/mischw/wl-gammactl";
+  branch = "master";
+  rev = "611846ce8f5f6e7fe1afb100416cceb8af54afb2";
+  sha256 = "0s54hq6l2552bwm0c7v0higlj5bpiwf12nc6wb130a06jgrbgxz2";
+  revdate = "2020-02-16 12:53:36Z";
+}
diff --git a/overlays/patches/nixpkgs-wayland/pkgs/wlay/default.nix b/overlays/patches/nixpkgs-wayland/pkgs/wlay/default.nix
new file mode 100644
index 000000000000..10499971866f
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs/wlay/default.nix
@@ -0,0 +1,43 @@
+{ stdenv, fetchFromGitHub
+, cmake, extra-cmake-modules, pkgconfig
+, wayland, wayland-protocols
+, epoxy, libpthreadstubs
+, libGL, glfw3
+, libX11, libXau, libXdmcp, libXrandr, libXext, libXinerama
+, libXcursor, libXfixes
+}:
+
+let
+  metadata = import ./metadata.nix;
+in
+stdenv.mkDerivation rec {
+  pname = "wlay";
+  version = metadata.rev;
+
+  src = fetchFromGitHub {
+    owner = "atx";
+    repo = "wlay";
+    fetchSubmodules = true;
+    rev = version;
+    sha256 = metadata.sha256;
+  };
+
+  nativeBuildInputs = [ pkgconfig cmake extra-cmake-modules ];
+  buildInputs = [
+    wayland wayland-protocols
+    epoxy libpthreadstubs
+    libGL glfw3
+    libX11 libXau libXdmcp libXrandr libXext libXinerama
+    libXcursor libXfixes
+  ];
+
+  enableParallelBuilding = true;
+
+  meta = with stdenv.lib; {
+    description = "Graphical output management for Wayland";
+    homepage    = "https://github.com/atx/wlay";
+    license     = licenses.mit;
+    platforms   = platforms.linux;
+    maintainers = with maintainers; [ colemickens ];
+  };
+}
diff --git a/overlays/patches/nixpkgs-wayland/pkgs/wlay/metadata.nix b/overlays/patches/nixpkgs-wayland/pkgs/wlay/metadata.nix
new file mode 100644
index 000000000000..b8f4401ecaf2
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs/wlay/metadata.nix
@@ -0,0 +1,7 @@
+{
+  repo_git = "https://github.com/atx/wlay";
+  branch = "master";
+  rev = "1e316ca92d38856c517af4a0a7d88c8589bd2131";
+  sha256 = "1p19zr9qfd94wrjf53gcqn8cc9axjrcgkv5jvlhblhqal2vfnzp7";
+  revdate = "2019-07-04 17:03:15Z";
+}
diff --git a/overlays/patches/nixpkgs-wayland/pkgs/wldash/default.nix b/overlays/patches/nixpkgs-wayland/pkgs/wldash/default.nix
new file mode 100644
index 000000000000..d7afca489853
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs/wldash/default.nix
@@ -0,0 +1,41 @@
+{ lib, rustPlatform, fetchFromGitHub
+, pkgconfig
+, dbus, libpulseaudio, alsaLib, libxkbcommon
+, wayland, fontconfig
+}:
+
+let
+  metadata = import ./metadata.nix;
+  libraryPath = lib.makeLibraryPath [ wayland libxkbcommon ];
+in
+rustPlatform.buildRustPackage rec {
+  name = "wldash-${version}";
+  version = metadata.rev;
+
+  src = fetchFromGitHub {
+    owner = "kennylevinsen";
+    repo = "wldash";
+    rev = metadata.rev;
+    sha256 = metadata.sha256;
+  };
+
+  cargoSha256 = metadata.cargoSha256;
+
+  nativeBuildInputs = [ pkgconfig ];
+
+  buildInputs = [ dbus libpulseaudio alsaLib fontconfig ];
+
+  dontPatchELF = true;
+  
+  postInstall = ''
+    patchelf --set-rpath ${libraryPath}:$(patchelf --print-rpath $out/bin/wldash) $out/bin/wldash
+  '';
+
+  meta = with lib; {
+    description = "Wayland launcher/dashboard";
+    homepage = "https://wldash.org";
+    licence = licenses.gpl3;
+    maintainers = with maintainers; [ alexarice ];
+    platforms = [ "x86_64-linux" "i686-linux" ];
+  };
+}
diff --git a/overlays/patches/nixpkgs-wayland/pkgs/wldash/metadata.nix b/overlays/patches/nixpkgs-wayland/pkgs/wldash/metadata.nix
new file mode 100644
index 000000000000..331bbeb49dc2
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs/wldash/metadata.nix
@@ -0,0 +1,8 @@
+{
+  repo_git = "https://github.com/kennylevinsen/wldash";
+  branch = "master";
+  rev = "2e49b98b82427fde046554b9ead825680348fb17";
+  sha256 = "1w1b8gznswdrd778si4pnz67957mqgsvfag0kpdazzhq1mmcxxz4";
+  cargoSha256 = "1vzwnz0a86idwxbfjmhb6rakv7h9ypsbayjngdndpc82vggnkmmc";
+  revdate = "2020-07-22 10:42:48Z";
+}
diff --git a/overlays/patches/nixpkgs-wayland/pkgs/wlfreerdp/default.nix b/overlays/patches/nixpkgs-wayland/pkgs/wlfreerdp/default.nix
new file mode 100644
index 000000000000..ded46e5fa0b9
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs/wlfreerdp/default.nix
@@ -0,0 +1,81 @@
+{ stdenv, lib, fetchFromGitHub, cmake, pkgconfig
+, alsaLib, ffmpeg, glib, openssl, pcre, zlib
+, libX11, libXcursor, libXdamage, libXext, libXi, libXinerama, libXrandr, libXrender, libXv
+, libxkbcommon, libxkbfile
+, libusb1
+, wayland
+, gstreamer, gst-plugins-base, gst-plugins-good, libunwind, orc
+, libpulseaudio ? null
+, cups ? null
+, pcsclite ? null
+, systemd ? null
+, buildServer ? true
+, nocaps ? false
+}:
+
+let
+  metadata = import ./metadata.nix;
+in
+stdenv.mkDerivation rec {
+  pname = "freerdp";
+  version = metadata.rev;
+
+  src = fetchFromGitHub {
+    owner  = "FreeRDP";
+    repo   = "FreeRDP";
+    rev    = version;
+    sha256 = metadata.sha256;
+  };
+
+  # outputs = [ "bin" "out" "dev" ];
+
+  prePatch = ''
+    export HOME=$TMP
+    substituteInPlace "libfreerdp/freerdp.pc.in" \
+      --replace "Requires:" "Requires: @WINPR_PKG_CONFIG_FILENAME@"
+  '' + lib.optionalString (pcsclite != null) ''
+    substituteInPlace "winpr/libwinpr/smartcard/smartcard_pcsc.c" \
+      --replace "libpcsclite.so" "${stdenv.lib.getLib pcsclite}/lib/libpcsclite.so"
+  '' + lib.optionalString nocaps ''
+    substituteInPlace "libfreerdp/locale/keyboard_xkbfile.c" \
+      --replace "RDP_SCANCODE_CAPSLOCK" "RDP_SCANCODE_LCONTROL"
+  '';
+
+  buildInputs = with lib; [
+    alsaLib cups ffmpeg glib openssl pcre pcsclite libpulseaudio zlib
+    gstreamer gst-plugins-base gst-plugins-good libunwind orc
+    libX11 libXcursor libXdamage libXext libXi libXinerama libXrandr libXrender libXv
+    libxkbcommon libxkbfile
+    wayland libusb1
+  ] ++ optional stdenv.isLinux systemd;
+
+  nativeBuildInputs = [
+    cmake pkgconfig
+  ];
+
+  enableParallelBuilding = true;
+
+  doCheck = false;
+
+  cmakeFlags = with lib; [
+    "-DCMAKE_INSTALL_LIBDIR=lib"
+    "-DWITH_CUNIT=OFF"
+    "-DWITH_OSS=OFF"
+  ] ++ optional (libpulseaudio != null)       "-DWITH_PULSE=ON"
+    ++ optional (cups != null)                "-DWITH_CUPS=ON"
+    ++ optional (pcsclite != null)            "-DWITH_PCSC=ON"
+    ++ optional buildServer                   "-DWITH_SERVER=ON"
+    ++ optional (stdenv.isx86_64)             "-DWITH_SSE2=ON";
+
+  meta = with lib; {
+    description = "A Remote Desktop Protocol Client";
+    longDescription = ''
+      FreeRDP is a client-side implementation of the Remote Desktop Protocol (RDP)
+      following the Microsoft Open Specifications.
+    '';
+    homepage = http://www.freerdp.com/;
+    license = licenses.asl20;
+    maintainers = with maintainers; [ peterhoeg ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/overlays/patches/nixpkgs-wayland/pkgs/wlfreerdp/metadata.nix b/overlays/patches/nixpkgs-wayland/pkgs/wlfreerdp/metadata.nix
new file mode 100644
index 000000000000..0b707dfe2a0b
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs/wlfreerdp/metadata.nix
@@ -0,0 +1,7 @@
+{
+  repo_git = "https://github.com/FreeRDP/FreeRDP";
+  branch = "master";
+  rev = "2d715e4681b92108d012fede181fd0a9b401e7e3";
+  sha256 = "sha256-ybTQ4bhdKoR+F5H+ezYjHXjdjHeTYL4ZOIzs4mCiUTU=";
+  revdate = "2020-08-11 12:34:07Z";
+}
diff --git a/overlays/patches/nixpkgs-wayland/pkgs/wlogout/default.nix b/overlays/patches/nixpkgs-wayland/pkgs/wlogout/default.nix
new file mode 100644
index 000000000000..df693b2e0fed
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs/wlogout/default.nix
@@ -0,0 +1,52 @@
+{ stdenv, fetchgit
+, pkgconfig, meson, ninja, scdoc
+, wayland, wayland-protocols
+, libxkbcommon, gtk3
+}:
+
+let
+  metadata = import ./metadata.nix;
+in
+stdenv.mkDerivation rec {
+  name = "${pname}-${version}";
+  pname = "wlogout";
+  version = metadata.rev;
+
+  src = fetchgit {
+    url = metadata.repo_git;
+    rev = metadata.rev;
+    sha256 = metadata.sha256;
+  };
+
+  nativeBuildInputs = [ pkgconfig meson ninja scdoc ];
+  buildInputs = [
+    wayland wayland-protocols
+    libxkbcommon gtk3
+  ];
+
+  patchPhase = ''
+    substituteInPlace style.css --replace \
+      "/usr/share/wlogout" \
+      "$out/share/${pname}"
+
+    # Fix path in `access(/etc/wlogout/$config_file$)`
+    substituteInPlace main.c --replace \
+      "/etc/wlogout" \
+      "$out/etc/${pname}"
+  '';
+
+  mesonFlags = [
+    "--datadir=${placeholder "out"}/share"
+    "--sysconfdir=${placeholder "out"}/etc"
+  ];
+
+  enableParallelBuilding = true;
+
+  meta = with stdenv.lib; {
+    description = "A wayland based logout menu";
+    homepage    = "https://github.com/ArtsyMacaw/wlogout";
+    license     = licenses.mit;
+    platforms   = platforms.linux;
+    maintainers = with maintainers; [];
+  };
+}
diff --git a/overlays/patches/nixpkgs-wayland/pkgs/wlogout/metadata.nix b/overlays/patches/nixpkgs-wayland/pkgs/wlogout/metadata.nix
new file mode 100644
index 000000000000..db8e780e4f20
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs/wlogout/metadata.nix
@@ -0,0 +1,7 @@
+{
+  repo_git = "https://github.com/ArtsyMacaw/wlogout";
+  branch = "master";
+  rev = "0a4289e02c6c4337756d4df7ff31605f8c8795c3";
+  sha256 = "1swhzkqkzli59c89pvrakfvicd00x7ga860c3x2pbb4y3xziqfvi";
+  revdate = "2020-03-14 05:34:47Z";
+}
diff --git a/overlays/patches/nixpkgs-wayland/pkgs/wlr-randr/default.nix b/overlays/patches/nixpkgs-wayland/pkgs/wlr-randr/default.nix
new file mode 100644
index 000000000000..7f0d9ab1c691
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs/wlr-randr/default.nix
@@ -0,0 +1,31 @@
+{ stdenv, fetchFromGitHub
+, meson, ninja, pkgconfig
+, wayland, wayland-protocols
+}:
+
+let
+  metadata = import ./metadata.nix;
+in
+stdenv.mkDerivation rec {
+  pname = "wlr-randr";
+  version = metadata.rev;
+
+  src = fetchFromGitHub {
+    owner = "emersion";
+    repo = pname;
+    inherit (metadata) rev sha256;
+  };
+
+  nativeBuildInputs = [ meson ninja pkgconfig ];
+  buildInputs = [
+    wayland wayland-protocols
+  ];
+
+  meta = with stdenv.lib; {
+    description = "An xrandr clone for wlroots compositors";
+    homepage = "https://github.com/emersion/wlr-randr";
+    license = licenses.mit;
+    maintainers = with maintainers; [ colemickens ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/overlays/patches/nixpkgs-wayland/pkgs/wlr-randr/metadata.nix b/overlays/patches/nixpkgs-wayland/pkgs/wlr-randr/metadata.nix
new file mode 100644
index 000000000000..07949898e25f
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs/wlr-randr/metadata.nix
@@ -0,0 +1,7 @@
+{
+  repo_git = "https://github.com/emersion/wlr-randr";
+  branch = "master";
+  rev = "988a802f5b4050dd3db1138a0cf3464789131dfb";
+  sha256 = "10c8zzp78s5bw34vvjhilipa28bsdx3jbyhnxgp8f8kawh3cvgsc";
+  revdate = "2020-07-27 14:33:25Z";
+}
diff --git a/overlays/patches/nixpkgs-wayland/pkgs/wlroots/default.nix b/overlays/patches/nixpkgs-wayland/pkgs/wlroots/default.nix
new file mode 100644
index 000000000000..2b9a27080513
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs/wlroots/default.nix
@@ -0,0 +1,59 @@
+{ stdenv, fetchFromGitHub, fetchpatch, meson, ninja, pkgconfig
+, wayland, libGL, wayland-protocols, libinput, libxkbcommon, pixman
+, xcbutilwm, libX11, libcap, xcbutilimage, xcbutilerrors, mesa_noglu
+, libglvnd
+, libpng, ffmpeg_4
+}:
+
+let
+  metadata = import ./metadata.nix;
+  pname = "wlroots";
+  version = metadata.rev;
+in stdenv.mkDerivation rec {
+  name = "${pname}-${version}";
+
+  src = fetchFromGitHub {
+    owner = "swaywm";
+    repo = "wlroots";
+    rev = metadata.rev;
+    sha256 = metadata.sha256;
+  };
+
+  # $out for the library, $bin for rootston, and $examples for the example
+  # programs (in examples) AND rootston
+  outputs = [ "out" "examples" ];
+
+  nativeBuildInputs = [ meson ninja pkgconfig ];
+
+  buildInputs = [
+    wayland libGL wayland-protocols libinput libxkbcommon pixman
+    xcbutilwm libX11 libcap xcbutilimage xcbutilerrors mesa_noglu
+    libpng ffmpeg_4
+    libglvnd
+  ];
+
+  mesonFlags = [
+    "-Dlibcap=enabled" "-Dlogind-provider=systemd" "-Dxwayland=enabled" "-Dx11-backend=enabled"
+    "-Dxcb-icccm=enabled" "-Dxcb-xkb=enabled" "-Dxcb-errors=enabled"
+  ];
+
+  postInstall = ''
+    # Install ALL example programs to $examples:
+    # screencopy dmabuf-capture input-inhibitor layer-shell idle-inhibit idle
+    # screenshot output-layout multi-pointer rotation tablet touch pointer
+    # simple
+    mkdir -p $examples/bin
+    cd ./examples
+    for binary in $(find . -executable -type f -printf '%P\n' | grep -vE '\.so'); do
+      cp "$binary" "$examples/bin/wlroots-$binary"
+    done
+  '';
+
+  meta = with stdenv.lib; {
+    description = "A modular Wayland compositor library";
+    inherit (src.meta) homepage;
+    license     = licenses.mit;
+    platforms   = platforms.linux;
+    maintainers = with maintainers; [ primeos ];
+  };
+}
diff --git a/overlays/patches/nixpkgs-wayland/pkgs/wlroots/metadata.nix b/overlays/patches/nixpkgs-wayland/pkgs/wlroots/metadata.nix
new file mode 100644
index 000000000000..f43dcce25b33
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs/wlroots/metadata.nix
@@ -0,0 +1,7 @@
+{
+  repo_git = "https://github.com/swaywm/wlroots";
+  branch = "master";
+  rev = "379835c42f182aa2c8fa814dea20a325361f8bdf";
+  sha256 = "sha256-6+wsyT328lEFWXuIzc3acvPhcofK/TzRj6B7Tn36T0I=";
+  revdate = "2020-08-14 15:57:31Z";
+}
diff --git a/overlays/patches/nixpkgs-wayland/pkgs/wltrunk/default.nix b/overlays/patches/nixpkgs-wayland/pkgs/wltrunk/default.nix
new file mode 100644
index 000000000000..bb2274adb2d4
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs/wltrunk/default.nix
@@ -0,0 +1,39 @@
+{ stdenv, fetchgit
+, meson, ninja, pkgconfig
+, wlroots, wayland, wayland-protocols
+, pixman, libxkbcommon
+, libudev, mesa_noglu, libX11
+, libGL
+}:
+
+let
+  metadata = import ./metadata.nix;
+in
+stdenv.mkDerivation rec {
+  name = "wltrunk-${version}";
+  version = metadata.rev;
+
+  src = fetchgit {
+    url = "https://git.sr.ht/~bl4ckb0ne/wltrunk";
+    rev = version;
+    sha256 = metadata.sha256;
+  };
+
+  nativeBuildInputs = [ pkgconfig meson ninja ];
+  buildInputs = [
+    wlroots wayland wayland-protocols
+    pixman libxkbcommon libudev mesa_noglu libX11
+    libGL
+  ];
+  mesonFlags = [ "-Dauto_features=enabled" ];
+
+  enableParallelBuilding = true;
+
+  meta = with stdenv.lib; {
+    description = "High-level Wayland compositor library based on wlroots";
+    homepage    = "https://git.sr.ht/~bl4ckb0ne/wltrunk";
+    license     = licenses.mit;
+    platforms   = platforms.linux;
+    maintainers = with maintainers; [ colemickens ];
+  };
+}
diff --git a/overlays/patches/nixpkgs-wayland/pkgs/wltrunk/metadata.nix b/overlays/patches/nixpkgs-wayland/pkgs/wltrunk/metadata.nix
new file mode 100644
index 000000000000..4745521a6994
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs/wltrunk/metadata.nix
@@ -0,0 +1,8 @@
+{
+  repo_git = "https://git.sr.ht/~bl4ckb0ne/wltrunk";
+  branch = "master";
+  rev = "af40ca52bd0023130b680f407eabf8424f23d058";
+  sha256 = "0kpjp5s17w0lyk3rqzhgdpi6s2fhi526n67li2k0al22vw7sj33d";
+  revdate = "2020-03-11 13:38:35Z";
+  skip = true;
+}
diff --git a/overlays/patches/nixpkgs-wayland/pkgs/wofi/default.nix b/overlays/patches/nixpkgs-wayland/pkgs/wofi/default.nix
new file mode 100644
index 000000000000..41d500ca65ce
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs/wofi/default.nix
@@ -0,0 +1,52 @@
+{ stdenv, fetchhg
+, meson, ninja, pkgconfig
+, wayland, wayland-protocols
+, gtk3
+}:
+
+let
+  metadata = import ./metadata.nix;
+in
+stdenv.mkDerivation rec {
+  name = "${pname}-${version}";
+  pname = "wofi";
+  version = metadata.rev;
+
+  src = fetchhg {
+    url = "https://hg.sr.ht/~scoopta/wofi";
+    rev = version;
+    sha256 = metadata.sha256;
+  };
+
+  postPatch = ''
+    sed -i "s/run_command('hg', 'identify').stdout().strip()/\'${version}\'/g" ./meson.build
+  '';
+
+  nativeBuildInputs = [
+    meson ninja pkgconfig
+  ];
+
+  buildInputs = [
+    wayland wayland-protocols
+    gtk3
+  ];
+
+#  preConfigure = ''
+#    cd Release
+#  '';
+
+#  installPhase = ''
+#    mkdir -p "$out/bin"
+#    mv wofi $out/bin/
+#  '';
+
+  enableParallelBuilding = true;
+
+  meta = with stdenv.lib; {
+    description = "Wofi is a launcher/menu program for wlroots based wayland compositors such as sway";
+    homepage    = "https://hg.sr.ht/~scoopta/wofi";
+    #license     = #TODO;
+    platforms   = platforms.linux;
+    maintainers = with maintainers; [ colemickens ];
+  };
+}
diff --git a/overlays/patches/nixpkgs-wayland/pkgs/wofi/metadata.nix b/overlays/patches/nixpkgs-wayland/pkgs/wofi/metadata.nix
new file mode 100644
index 000000000000..dd1124e51556
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs/wofi/metadata.nix
@@ -0,0 +1,7 @@
+{
+  repo_hg = "https://hg.sr.ht/~scoopta/wofi";
+  branch = "default";
+  rev = "3414ab984249";
+  sha256 = "sha256-rvjqKslUDntpVDWcuFFlW2p8BM/JDrHPI9Yx3Oc9S8o=";
+  revdate = "2020-08-11 19:07:49";
+}
diff --git a/overlays/patches/nixpkgs-wayland/pkgs/wtype/default.nix b/overlays/patches/nixpkgs-wayland/pkgs/wtype/default.nix
new file mode 100644
index 000000000000..40acdd235d74
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs/wtype/default.nix
@@ -0,0 +1,36 @@
+{ stdenv, fetchFromGitHub
+, pkgconfig, meson, ninja
+, wayland, wayland-protocols
+, libxkbcommon
+}:
+
+let
+  metadata = import ./metadata.nix;
+in
+stdenv.mkDerivation rec {
+  name = "wtype-${version}";
+  version = metadata.rev;
+
+  src = fetchFromGitHub {
+    owner = "atx";
+    repo = "wtype";
+    rev = metadata.rev;
+    sha256 = metadata.sha256;
+  };
+
+  nativeBuildInputs = [ pkgconfig meson ninja ];
+  buildInputs = [
+    wayland wayland-protocols
+    libxkbcommon
+  ];
+
+  enableParallelBuilding = true;
+
+  meta = with stdenv.lib; {
+    description = "xdotool type for wayland";
+    homepage    = "https://github.com/atx/wtype";
+    license     = licenses.mit;
+    platforms   = platforms.linux;
+    maintainers = with maintainers; [ colemickens ];
+  };
+}
diff --git a/overlays/patches/nixpkgs-wayland/pkgs/wtype/metadata.nix b/overlays/patches/nixpkgs-wayland/pkgs/wtype/metadata.nix
new file mode 100644
index 000000000000..ec015495a5a2
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs/wtype/metadata.nix
@@ -0,0 +1,7 @@
+{
+  repo_git = "https://github.com/atx/wtype";
+  branch = "master";
+  rev = "643400d7c9f4b20e3f8a05f5329c60ff338cf105";
+  sha256 = "0mfhr3qxdvmv8rlfwc3n30srx6l69dw0ihqg6jikc7icwqhhliyv";
+  revdate = "2020-08-05 16:06:59Z";
+}
diff --git a/overlays/patches/nixpkgs-wayland/pkgs/xdg-desktop-portal-wlr/default.nix b/overlays/patches/nixpkgs-wayland/pkgs/xdg-desktop-portal-wlr/default.nix
new file mode 100644
index 000000000000..a0463240144a
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs/xdg-desktop-portal-wlr/default.nix
@@ -0,0 +1,34 @@
+{ stdenv, fetchFromGitHub
+, meson, ninja, pkgconfig
+, systemd, wayland, wayland-protocols
+, pipewire, libdrm
+}:
+
+let
+  metadata = import ./metadata.nix;
+in
+stdenv.mkDerivation rec {
+  name = "xdg-desktop-portal-wlr-${version}";
+  version = metadata.rev;
+
+  src = fetchFromGitHub {
+    owner = "emersion";
+    repo = "xdg-desktop-portal-wlr";
+    rev = version;
+    sha256 = metadata.sha256;
+  };
+
+  nativeBuildInputs = [ pkgconfig meson ninja ];
+  buildInputs = [ systemd wayland wayland-protocols pipewire libdrm ];
+  mesonFlags = [ "-Dauto_features=enabled" ];
+
+  enableParallelBuilding = true;
+
+  meta = with stdenv.lib; {
+    description = "xdg-desktop-portal backend for wlroots";
+    homepage    = "https://github.com/emersion/xdg-desktop-portal-wlr";
+    license     = licenses.mit;
+    platforms   = platforms.linux;
+    maintainers = with maintainers; [ colemickens ];
+  };
+}
diff --git a/overlays/patches/nixpkgs-wayland/pkgs/xdg-desktop-portal-wlr/metadata.nix b/overlays/patches/nixpkgs-wayland/pkgs/xdg-desktop-portal-wlr/metadata.nix
new file mode 100644
index 000000000000..a1790cc42973
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/pkgs/xdg-desktop-portal-wlr/metadata.nix
@@ -0,0 +1,7 @@
+{
+  repo_git = "https://github.com/emersion/xdg-desktop-portal-wlr";
+  branch = "master";
+  rev = "68f9759a78935db01dbad34035e5fa2648ca1f71";
+  sha256 = "sha256-G/a+vhlSTWM0FRaIjlI5C+pqX/wA0BDNZ4SrEE4jm5w=";
+  revdate = "2020-08-07 16:33:26Z";
+}
diff --git a/overlays/patches/nixpkgs-wayland/shell.nix b/overlays/patches/nixpkgs-wayland/shell.nix
new file mode 100644
index 000000000000..e6f0cf1db938
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/shell.nix
@@ -0,0 +1,6 @@
+(import (fetchTarball {
+  url="https://github.com/edolstra/flake-compat/archive/c75e76f80c57784a6734356315b306140646ee84.tar.gz";
+  sha256="071aal00zp2m9knnhddgr2wqzlx6i6qa1263lv1y7bdn2w20h10h";
+}) {
+  src = builtins.fetchGit ./.;
+}).shellNix
\ No newline at end of file
diff --git a/overlays/patches/nixpkgs-wayland/update.sh b/overlays/patches/nixpkgs-wayland/update.sh
new file mode 100755
index 000000000000..0965f801938c
--- /dev/null
+++ b/overlays/patches/nixpkgs-wayland/update.sh
@@ -0,0 +1,195 @@
+#!/usr/bin/env bash
+DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
+set -euo pipefail
+set -x
+
+unset NIX_PATH
+
+# build up commit msg
+defaultcommitmsg="auto-updates:"
+commitmsg="${defaultcommitmsg}";
+
+# keep track of what we build for the README
+pkgentries=(); nixpkgentries=();
+cache="nixpkgs-wayland";
+build_attr="${1:-"waylandPkgs"}"
+
+function update() {
+  set +x
+  typ="${1}"
+  pkg="${2}"
+
+  echo "============================================================================"
+  echo "${pkg}: checking"
+
+  metadata="${pkg}/metadata.nix"
+  pkgname="$(basename "${pkg}")"
+
+  # TODO: nix2json, update in parallel
+  # TODO: aka, not in bash
+
+  branch="$(nix-instantiate "${metadata}" --eval --json -A branch 2>/dev/null | jq -r .)"
+  rev="$(nix-instantiate "${metadata}" --eval --json -A rev  2>/dev/null | jq -r .)"
+  date="$(nix-instantiate "${metadata}" --eval --json -A revdate  2>/dev/null | jq -r .)"
+  sha256="$(nix-instantiate "${metadata}" --eval --json -A sha256  2>/dev/null | jq -r .)"
+  upattr="$(nix-instantiate "${metadata}" --eval --json -A upattr  2>/dev/null | jq -r . || echo "${pkgname}")"
+  url="$(nix-instantiate "${metadata}" --eval --json -A url  2>/dev/null | jq -r . || echo "missing_url")"
+  cargoSha256="$(nix-instantiate "${metadata}" --eval --json -A cargoSha256  2>/dev/null | jq -r . || echo "missing_cargoSha256")"
+  vendorSha256="$(nix-instantiate "${metadata}" --eval --json -A vendorSha256  2>/dev/null | jq -r . || echo "missing_vendorSha256")"
+  skip="$(nix-instantiate "${metadata}" --eval --json -A skip  2>/dev/null | jq -r . || echo "false")"
+
+  newdate="${date}"
+  if [[ "${skip}" != "true" ]]; then
+    # Determine RepoTyp (git/hg)
+    if   nix-instantiate "${metadata}" --eval --json -A repo_git &>/dev/null; then repotyp="git";
+    elif nix-instantiate "${metadata}" --eval --json -A repo_hg &>/dev/null; then repotyp="hg";
+    else echo "unknown repo_typ" && exit 1;
+    fi
+
+    # Update Rev
+    if [[ "${repotyp}" == "git" ]]; then
+      repo="$(nix-instantiate "${metadata}" --eval --json -A repo_git | jq -r .)"
+      newrev="$(git ls-remote "${repo}" "${branch}" | awk '{ print $1}')"
+    elif [[ "${repotyp}" == "hg" ]]; then
+      repo="$(nix-instantiate "${metadata}" --eval --json -A repo_hg | jq -r .)"
+      newrev="$(hg identify "${repo}" -r "${branch}")"
+    fi
+
+    if [[ "${rev}" != "${newrev}" ]]; then
+      commitmsg="${commitmsg} ${pkgname},"
+
+      echo "${pkg}: ${rev} => ${newrev}"
+
+      set -x
+
+      # Update RevDate
+      d="$(mktemp -d)"
+      if [[ "${repotyp}" == "git" ]]; then
+        git clone -b "${branch}" --single-branch --depth=1 "${repo}" "${d}" &>/dev/null
+        newdate="$(cd "${d}"; TZ=UTC git show --quiet --date='format-local:%Y-%m-%d %H:%M:%SZ' --format="%cd")"
+      elif [[ "${repotyp}" == "hg" ]]; then
+        hg clone "${repo}#${branch}" "${d}"
+        newdate="$(cd "${d}"; TZ=UTC hg log -l1 --template "{date(date, '%Y-%m-%d %H:%M:%S')}\n")" &>/dev/null
+      fi
+      rm -rf "${d}"
+
+      # Update Sha256
+      if [[ "${typ}" == "pkgs" ]]; then
+        newsha256="$(NIX_PATH="nixpkgs=https://github.com/nixos/nixpkgs/archive/nixos-unstable.tar.gz" \
+          nix-prefetch --output raw \
+            -E "(import ./packages.nix).${upattr}" \
+            --rev "${newrev}")"
+      elif [[ "${typ}" == "nixpkgs" ]]; then
+        newsha256="$(NIX_PATH="${tmpnixpath}" nix-prefetch-url --unpack "${url}" 2>/dev/null)"
+      fi
+
+      # TODO: do this with nix instead of sed?
+      sed -i "s/${rev}/${newrev}/" "${metadata}"
+      sed -i "s|${date}|${newdate}|" "${metadata}"
+      sed -i "s|${sha256}|${newsha256}|" "${metadata}"
+
+      # CargoSha256 has to happen AFTER the other rev/sha256 bump
+      if [[ "${cargoSha256}" != "missing_cargoSha256" ]]; then
+        newcargoSha256="$(NIX_PATH="nixpkgs=https://github.com/nixos/nixpkgs/archive/nixos-unstable.tar.gz" \
+          nix-prefetch \
+            "{ sha256 }: let p=(import ./packages.nix).${upattr}; in p.cargoDeps.overrideAttrs (_: { cargoSha256 = sha256; })")"
+        sed -i "s|${cargoSha256}|${newcargoSha256}|" "${metadata}"
+      fi
+
+      # VendorSha256 has to happen AFTER the other rev/sha256 bump
+      if [[ "${vendorSha256}" != "missing_vendorSha256" ]]; then
+        newvendorSha256="$(NIX_PATH="nixpkgs=https://github.com/nixos/nixpkgs/archive/nixos-unstable.tar.gz" \
+          nix-prefetch \
+            "{ sha256 }: let p=(import ./packages.nix).${upattr}; in p.go-modules.overrideAttrs (_: { vendorSha256 = sha256; })")"
+        sed -i "s|${vendorSha256}|${newvendorSha256}|" "${metadata}"
+      fi
+
+      set +x
+    fi
+  fi
+
+  if [[ "${skip}" == "true" ]]; then
+    newdate="${newdate} (pinned)"
+  fi
+  if [[ "${typ}" == "pkgs" ]]; then
+    desc="$(nix-instantiate --eval -E "(import ./packages.nix).${upattr}.meta.description" | jq -r .)"
+    home="$(nix-instantiate --eval -E "(import ./packages.nix).${upattr}.meta.homepage" | jq -r .)"
+    pkgentries=("${pkgentries[@]}" "| [${pkgname}](${home}) | ${newdate} | ${desc} |");
+  elif [[ "${typ}" == "nixpkgs" ]]; then
+    nixpkgentries=("${nixpkgentries[@]}" "| ${pkgname} | ${newdate} |");
+  fi
+}
+
+function update_readme() {
+  set +x
+
+  replace="$(printf "<!--pkgs-->")"
+  replace="$(printf "%s\n| Package | Last Updated (UTC) | Description |" "${replace}")"
+  replace="$(printf "%s\n| ------- | ------------------ | ----------- |" "${replace}")"
+  for p in "${pkgentries[@]}"; do
+    replace="$(printf "%s\n%s\n" "${replace}" "${p}")"
+  done
+  replace="$(printf "%s\n<!--pkgs-->" "${replace}")"
+
+  rg --multiline '(?s)(.*)<!--pkgs-->(.*)<!--pkgs-->(.*)' "README.md" \
+    --replace "\$1${replace}\$3" \
+      > README2.md; mv README2.md README.md
+
+  replace="$(printf "<!--nixpkgs-->")"
+  replace="$(printf "%s\n| Channel | Last Channel Commit Time |" "${replace}")"
+  replace="$(printf "%s\n| ------- | ------------------------ |" "${replace}")"
+  for p in "${nixpkgentries[@]}"; do
+    replace="$(printf "%s\n%s\n" "${replace}" "${p}")"
+  done
+  replace="$(printf "%s\n<!--nixpkgs-->" "${replace}")"
+
+  rg --multiline '(?s)(.*)<!--nixpkgs-->(.*)<!--nixpkgs-->(.*)' "README.md" \
+    --replace "\$1${replace}\$3" \
+      > README2.md; mv README2.md README.md
+}
+
+# update flake inputs
+nix --experimental-features 'nix-command flakes' \
+  flake update \
+    --update-input master \
+    --update-input nixpkgs \
+    --update-input cachixpkgs \
+    --update-input flake-utils
+
+# update our package sources/sha256s
+for p in `ls -d -- pkgs/*/`; do
+  update "pkgs" "${p}"
+done
+
+update_readme
+
+set -x
+
+out="$(mktemp -d)"
+nix-build-uncached \
+  --option "extra-binary-caches" "https://cache.nixos.org https://nixpkgs-wayland.cachix.org" \
+  --option "trusted-public-keys" "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= nixpkgs-wayland.cachix.org-1:3lwxaILxMRkVhehr5StQprHdEo4IrE8sRho9R9HOLYA=" \
+  --option "build-cores" "0" \
+  --option "narinfo-cache-negative-ttl" "0" \
+  --out-link "${out}/result" packages.nix
+
+results=(); shopt -s nullglob
+
+ls "${out}"
+
+for f in ${out}/result*; do
+  results=("${results[@]}" "${f}")
+done
+
+echo "${results[@]}" | cachix push "${cache}"
+
+if [[ "${JOB_ID:-""}" != "" ]]; then
+  git status
+  git add -A .
+  git status
+  git diff-index --cached --quiet HEAD || git commit -m "${commitmsg}"
+
+  echo "we're building on sr.ht, pushing..."
+  git push origin HEAD
+fi
+
diff --git a/overlays/patches/public-inbox/0003-view-don-t-show-page-if-no-links-follow-it.patch b/overlays/patches/public-inbox/0003-view-don-t-show-page-if-no-links-follow-it.patch
new file mode 100644
index 000000000000..811d6149d994
--- /dev/null
+++ b/overlays/patches/public-inbox/0003-view-don-t-show-page-if-no-links-follow-it.patch
@@ -0,0 +1,27 @@
+From 054697a5129725f900a84bbdfee356a4f5373376 Mon Sep 17 00:00:00 2001
+From: Alyssa Ross <hi@alyssa.is>
+Date: Thu, 16 Jan 2020 18:08:33 +0000
+Subject: [PATCH 3/5] view: don't show `page:' if no links follow it
+
+---
+ lib/PublicInbox/View.pm | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm
+index 39b04174..aebf7fe9 100644
+--- a/lib/PublicInbox/View.pm
++++ b/lib/PublicInbox/View.pm
+@@ -1157,7 +1157,9 @@ sub pagination_footer ($$) {
+ 		$next = $next ? "$next " : '     ';
+ 		$prev .= qq! <a\nhref='$latest'>latest</a>!;
+ 	}
+-	"<hr><pre>page: $next$prev</pre>";
++	if ($prev || $next) {
++		"<hr><pre>page: $next$prev</pre>";
++	}
+ }
+ 
+ sub index_nav { # callback for WwwStream
+-- 
+2.26.1
+
diff --git a/overlays/patches/public-inbox/0004-view-don-t-500-if-no-mail-received-yet.patch b/overlays/patches/public-inbox/0004-view-don-t-500-if-no-mail-received-yet.patch
new file mode 100644
index 000000000000..eb33468e1992
--- /dev/null
+++ b/overlays/patches/public-inbox/0004-view-don-t-500-if-no-mail-received-yet.patch
@@ -0,0 +1,25 @@
+From 2712913f07d83a6a33bbdc55a1edee0a008e5b2e Mon Sep 17 00:00:00 2001
+From: Alyssa Ross <hi@alyssa.is>
+Date: Thu, 16 Jan 2020 18:09:12 +0000
+Subject: [PATCH 4/5] view: don't 500 if no mail received yet
+
+---
+ lib/PublicInbox/View.pm | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm
+index aebf7fe9..b40108bc 100644
+--- a/lib/PublicInbox/View.pm
++++ b/lib/PublicInbox/View.pm
+@@ -1083,7 +1083,7 @@ sub acc_topic {
+ sub dump_topics {
+ 	my ($ctx) = @_;
+ 	my $order = delete $ctx->{order}; # [ ds, subj1, subj2, subj3, ... ]
+-	if (!@$order) {
++	if (!defined $order || !@$order) {
+ 		$ctx->{-html_tip} = '<pre>[No topics in range]</pre>';
+ 		return 404;
+ 	}
+-- 
+2.26.1
+
diff --git a/overlays/patches/public-inbox/0005-wwwstream-make-source-info-configurable.patch b/overlays/patches/public-inbox/0005-wwwstream-make-source-info-configurable.patch
new file mode 100644
index 000000000000..605100cd38ae
--- /dev/null
+++ b/overlays/patches/public-inbox/0005-wwwstream-make-source-info-configurable.patch
@@ -0,0 +1,112 @@
+From f119d4315be998de65d5a1b56fa643fb9084410b Mon Sep 17 00:00:00 2001
+From: Alyssa Ross <hi@alyssa.is>
+Date: Fri, 17 Jan 2020 15:21:42 +0000
+Subject: [PATCH 5/5] wwwstream: make source info configurable
+
+---
+ Documentation/public-inbox-config.pod |  6 ++++++
+ lib/PublicInbox/WwwListing.pm         |  9 +++++----
+ lib/PublicInbox/WwwStream.pm          | 28 +++++++++++++++++++++++----
+ 3 files changed, 35 insertions(+), 8 deletions(-)
+
+diff --git a/Documentation/public-inbox-config.pod b/Documentation/public-inbox-config.pod
+index 1c5ba015..5ae23924 100644
+--- a/Documentation/public-inbox-config.pod
++++ b/Documentation/public-inbox-config.pod
+@@ -186,6 +186,12 @@ and the path may be "/dev/null" or any empty file.
+ Multiple files may be specified and will be included in the
+ order specified.
+ 
++=item publicinbox.sourceinfo
++
++Path to a file containing HTML instructions for downloading the
++public-inbox source code.  Useful for AGPL compliance.  If not
++specified, default git clone instructions are used.
++
+ =item publicinboxmda.spamcheck
+ 
+ This may be set to C<none> to disable the use of SpamAssassin
+diff --git a/lib/PublicInbox/WwwListing.pm b/lib/PublicInbox/WwwListing.pm
+index 03534f03..f1a1fd81 100644
+--- a/lib/PublicInbox/WwwListing.pm
++++ b/lib/PublicInbox/WwwListing.pm
+@@ -87,8 +87,8 @@ sub ibx_entry {
+ 	$tmp;
+ }
+ 
+-sub html ($$) {
+-	my ($env, $list) = @_;
++sub html ($$$) {
++	my ($pi_config, $env, $list) = @_;
+ 	my $title = 'public-inbox';
+ 	my $out = '';
+ 	my $code = 404;
+@@ -107,7 +107,8 @@ sub html ($$) {
+ 		$out = '<pre>'.$l->linkify_2(ascii_html($tmp)).'</pre><hr>';
+ 	}
+ 	$out = "<html><head><title>$title</title></head><body>" . $out;
+-	$out .= '<pre>'. PublicInbox::WwwStream::code_footer($env) .
++	$out .= '<pre>' .
++	        PublicInbox::WwwStream::code_footer($pi_config, $env) .
+ 		'</pre></body></html>';
+ 
+ 	my $h = [ 'Content-Type', 'text/html; charset=UTF-8' ];
+@@ -231,7 +232,7 @@ sub call {
+ 		js($env, $list);
+ 	} else { # /
+ 		my $list = $self->{www_cb}->($self, $env, 'www');
+-		html($env, $list);
++		html($self->{pi_config}, $env, $list);
+ 	}
+ }
+ 
+diff --git a/lib/PublicInbox/WwwStream.pm b/lib/PublicInbox/WwwStream.pm
+index 0f4f55d0..09473c9f 100644
+--- a/lib/PublicInbox/WwwStream.pm
++++ b/lib/PublicInbox/WwwStream.pm
+@@ -76,10 +76,30 @@ sub _html_top ($) {
+ 		"</head><body>". $top . $tip;
+ }
+ 
+-sub code_footer ($) {
+-	my ($env) = @_;
++sub get_user_source_info ($) {
++	my ($pi_config) = @_;
++
++	local $/;
++	my $path = $pi_config->{'publicinbox.sourceinfo'};
++	if (!defined($path)) {
++		return;
++	}
++	open my $fh, '<', $path or do {
++		warn "Failed to open publicinbox.sourceinfo=$path: $!\n";
++		return;
++	};
++	<$fh>;
++}
++
++sub code_footer {
++	my ($pi_config, $env) = @_;
++
+ 	my $u = PublicInbox::Hval::prurl($env, $CODE_URL);
+-	qq(AGPL code for this site: git clone <a\nhref="$u">$u</a>)
++	my $default_info = qq(git clone <a\n href="$u">$u</a>);
++
++	my $info = get_user_source_info($pi_config) || $default_info;
++
++	"AGPL code for this site: $info"
+ }
+ 
+ sub _html_end {
+@@ -153,7 +173,7 @@ EOF
+ 	'<hr><pre>'.join("\n\n",
+ 		$desc,
+ 		$urls,
+-		code_footer($ctx->{env})
++		code_footer($ctx->{www}->{pi_config}, $ctx->{env})
+ 	).'</pre></body></html>';
+ }
+ 
+-- 
+2.26.1
+
diff --git a/overlays/patches/public-inbox/default.nix b/overlays/patches/public-inbox/default.nix
new file mode 100644
index 000000000000..f9f573787c1c
--- /dev/null
+++ b/overlays/patches/public-inbox/default.nix
@@ -0,0 +1,9 @@
+{ public-inbox }:
+
+public-inbox.overrideAttrs ({ patches ? [], ... }: {
+  patches = patches ++ [
+    ./0003-view-don-t-show-page-if-no-links-follow-it.patch
+    ./0004-view-don-t-500-if-no-mail-received-yet.patch
+    ./0005-wwwstream-make-source-info-configurable.patch
+  ];
+})
diff --git a/overlays/patches/python/default.nix b/overlays/patches/python/default.nix
new file mode 100644
index 000000000000..332cebfcb3fc
--- /dev/null
+++ b/overlays/patches/python/default.nix
@@ -0,0 +1,11 @@
+{ python, lib }:
+
+python.override {
+  packageOverrides = lib.composeExtensions python.packageOverrides (
+    final: super: with final; {
+      hyperkitty = callPackage ./packages/hyperkitty {
+        inherit (super) hyperkitty;
+      };
+    }
+  );
+}
diff --git a/overlays/patches/python/packages/hyperkitty/0001-Improve-look-of-fixed-width-messages.patch b/overlays/patches/python/packages/hyperkitty/0001-Improve-look-of-fixed-width-messages.patch
new file mode 100644
index 000000000000..cbf9083ed5e9
--- /dev/null
+++ b/overlays/patches/python/packages/hyperkitty/0001-Improve-look-of-fixed-width-messages.patch
@@ -0,0 +1,29 @@
+From bd62e0ac83b46d763bb6d083e2979032d75c7587 Mon Sep 17 00:00:00 2001
+From: Alyssa Ross <hi@alyssa.is>
+Date: Sat, 4 Apr 2020 11:11:45 +0000
+Subject: [PATCH] Improve look of fixed-width messages
+
+Use the system monospace font, which can be set to whatever the user
+wants, and decrease the font size a bit, because monospace fonts
+usually feel a bit bigger than their variable-width counterparts.
+---
+ hyperkitty/static/hyperkitty/sass/_hyperkitty-message.scss | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/hyperkitty/static/hyperkitty/sass/_hyperkitty-message.scss b/hyperkitty/static/hyperkitty/sass/_hyperkitty-message.scss
+index 25f7f1e..f035d69 100644
+--- a/hyperkitty/static/hyperkitty/sass/_hyperkitty-message.scss
++++ b/hyperkitty/static/hyperkitty/sass/_hyperkitty-message.scss
+@@ -127,7 +127,8 @@ $oddEmailColor: rgb(238, 238, 238);
+     }
+ }
+ .email-body.fixed {
+-    font-family: 'Droid Sans Mono', monospace;
++    font-family: monospace;
++    font-size: 0.9em;
+     white-space: pre;
+ }
+ 
+-- 
+2.24.1
+
diff --git a/overlays/patches/python/packages/hyperkitty/default.nix b/overlays/patches/python/packages/hyperkitty/default.nix
new file mode 100644
index 000000000000..e8a4315e2be4
--- /dev/null
+++ b/overlays/patches/python/packages/hyperkitty/default.nix
@@ -0,0 +1,7 @@
+{ hyperkitty, fetchpatch }:
+
+hyperkitty.overridePythonAttrs ({ patches ? [], ... }: {
+  patches = patches ++ [
+    ./0001-Improve-look-of-fixed-width-messages.patch
+  ];
+})
diff --git a/overlays/patches/tmux/default.nix b/overlays/patches/tmux/default.nix
new file mode 100644
index 000000000000..cc13ac2a86c2
--- /dev/null
+++ b/overlays/patches/tmux/default.nix
@@ -0,0 +1,7 @@
+{ tmux }:
+
+tmux.overrideAttrs ({ CPPFLAGS ? [], ... }: {
+  CPPFLAGS = CPPFLAGS ++ [
+    ''-DTMUX_CONF="\"\$$XDG_CONFIG_HOME/tmux/tmux.conf"\"''
+  ];
+})
diff --git a/overlays/scripts/choose/choose.in b/overlays/scripts/choose/choose.in
new file mode 100644
index 000000000000..7f60b47386a3
--- /dev/null
+++ b/overlays/scripts/choose/choose.in
@@ -0,0 +1,20 @@
+#! @execline@/bin/execlineb -S0
+
+define -s fzf_opts "--reverse"
+
+ifelse { importas -i _ DISPLAY }
+{
+  alacritty --class float -e
+  getpid my_pid
+  importas -i -u my_pid my_pid
+  backtick -i -n term_pid { awk "{print $4}" /proc/${my_pid}/stat }
+  importas -i -u term_pid term_pid
+  redirfd -r 0 /proc/${term_pid}/fd/0
+  redirfd -w 1 /proc/${term_pid}/fd/1
+  @fzf@/bin/fzf $fzf_opts $@
+}
+
+ifelse { importas -i _ TMUX }
+{ @fzf@/bin/fzf-tmux $fzf_opts $@ }
+
+@fzf@/bin/fzf $fzf_opts $@
diff --git a/overlays/scripts/choose/choosebin.in b/overlays/scripts/choose/choosebin.in
new file mode 100644
index 000000000000..7f8ea520c994
--- /dev/null
+++ b/overlays/scripts/choose/choosebin.in
@@ -0,0 +1,17 @@
+#! @execline@/bin/execlineb -S0
+
+backtick -i entry_points {
+  importas PATH PATH
+  heredoc 0 $PATH
+  tr : " "
+}
+importas -s -i -u entry_points entry_points
+
+pipeline {
+  redirfd -w 2 /dev/null
+  find -L $entry_points -mindepth 1 -maxdepth 1 -executable -type f
+}
+
+pipeline { awk -F / "{print $NF}" }
+
+@out@/bin/choose --prompt "$ " $@
diff --git a/overlays/scripts/choose/default.nix b/overlays/scripts/choose/default.nix
new file mode 100644
index 000000000000..d4e845f8b967
--- /dev/null
+++ b/overlays/scripts/choose/default.nix
@@ -0,0 +1,8 @@
+{ runCommand, makeWrapper, execline, fzf }:
+
+runCommand "choose" { inherit execline fzf; } ''
+  install -d $out/bin
+  substituteAll ${./choose.in} $out/bin/choose
+  substituteAll ${./choosebin.in} $out/bin/choosebin
+  chmod +x $out/bin/*
+''
diff --git a/overlays/scripts/default.nix b/overlays/scripts/default.nix
new file mode 100644
index 000000000000..983d32d867a4
--- /dev/null
+++ b/overlays/scripts/default.nix
@@ -0,0 +1,3 @@
+self: super: {
+  choose = self.callPackage ./choose { };
+}