From 92ca867f76d2f880a271a56ba02c3afffd28efc8 Mon Sep 17 00:00:00 2001 From: Guanran Wang Date: Fri, 13 Oct 2023 15:12:12 +0800 Subject: [PATCH] overlays: use `fetchgit` to fetch patches from aur --- nixos/packages/overlays/default.nix | 2 +- nixos/packages/overlays/firefox.nix | 21 ++++++++++++--------- nixos/packages/overlays/nautilus.nix | 16 ++++++++++++---- 3 files changed, 25 insertions(+), 14 deletions(-) diff --git a/nixos/packages/overlays/default.nix b/nixos/packages/overlays/default.nix index b11e730..7fc7ef3 100644 --- a/nixos/packages/overlays/default.nix +++ b/nixos/packages/overlays/default.nix @@ -2,7 +2,7 @@ { imports = [ - #./nautilus.nix patch is for nautilus 45, nixpkgs still at nautilus 44 + ./nautilus.nix ./sway.nix ./prismlauncher.nix ]; diff --git a/nixos/packages/overlays/firefox.nix b/nixos/packages/overlays/firefox.nix index f1daae8..e2d573b 100644 --- a/nixos/packages/overlays/firefox.nix +++ b/nixos/packages/overlays/firefox.nix @@ -1,4 +1,3 @@ - { ... }: { @@ -6,15 +5,19 @@ overlays = [ (final: prev: { - firefox-unwrapped = prev.firefox-unwrapped.overrideAttrs (old: { - # Firefox but with .mozilla moved to .config/mozilla - # .patch file from aur/firefox-xdg - # dont actually use this, =.= + firefox-unwrapped = prev.firefox-unwrapped.overrideAttrs (old: { + # Firefox but with .mozilla moved to .config/mozilla + # .patch file from aur/firefox-xdg + # dont actually use this, it take ages to build... =.= patches = (old.patches or []) ++ [ - (prev.fetchpatch { - url = "https://aur.archlinux.org/cgit/aur.git/plain/firefox-xdg-support.diff?h=firefox-xdg"; - hash = "sha256-9LibQ+dIZ7MeTcuKEuJ42AW8m7Q7mVBwT4KyGeJTJ88="; - }) + (prev.fetchgit { + url = "https://aur.archlinux.org/firefox-xdg.git"; + rev = "ab291ab81140867dea4c08e4e1e4e3da0c73e4a6"; + hash = "sha256-6VgCt028qs/Y5kl20qLUYwFI63pItsHPbLimOFIdsyo="; + sparseCheckout = [ + "firefox-xdg-support.diff" + ]; + } + "/firefox-xdg-support.diff") ]; }); } diff --git a/nixos/packages/overlays/nautilus.nix b/nixos/packages/overlays/nautilus.nix index 6f654b2..c3fe336 100644 --- a/nixos/packages/overlays/nautilus.nix +++ b/nixos/packages/overlays/nautilus.nix @@ -10,10 +10,18 @@ # .patch file from from aur/nautilus-typeahead nautilus = prev.gnome.nautilus.overrideAttrs (old: { patches = (old.patches or []) ++ [ - (prev.fetchpatch { - url = "https://aur.archlinux.org/cgit/aur.git/plain/nautilus-restore-typeahead.patch?h=nautilus-typeahead"; - hash = "sha256-a40vNo2Nw068GBtjVPUz6WAYRtjD0DB2bG/N14vSTxI="; - }) + (prev.fetchgit { + url = "https://aur.archlinux.org/nautilus-typeahead.git"; + ### 44.2 + rev = "dc295b3191818d16550400e645e108d9e265baa3"; + hash = "sha256-jCZcmPvmEodDzv+HHp7s+azLKVIno1ue72dQO+WbENU="; + ### 45.0 + #rev = "26776193230b0d56f714d31d79c5e716ac413a26"; + #hash = "sha256-hVWZCQwHzL4j+FcgsEhuumhBkl6d8IIbcYddh08QMJM="; + sparseCheckout = [ + "nautilus-restore-typeahead.patch" + ]; + } + "/nautilus-restore-typeahead.patch") ]; }); };