From 09066b737a077e0e5f03cd9b67d9dfa49da8086b Mon Sep 17 00:00:00 2001 From: NullBite Date: Fri, 15 Mar 2024 01:22:38 -0400 Subject: [PATCH] rework backports to support time based expiration --- backports/README.md | 8 ++++++-- backports/default.nix | 14 ++++++++------ flake.nix | 2 +- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/backports/README.md b/backports/README.md index 119a82f..b359e1c 100644 --- a/backports/README.md +++ b/backports/README.md @@ -1,5 +1,9 @@ # backports This is a nixpkgs overlay that contains temporary fixes for build failures or other issues, usually backported from the nixpkgs master branch. Each package -defined in this overlay shall automatically disable itself once the upstream -package has been updated. +defined in this overlay shall automatically disable itself once a certain +condition is met, such as the upstream package being updated or the nixpkgs +modification date passing a certain time. + +This is in place because I am extremely forgetful; I will almost certainly +forget to undo a temporary fix later, so this takes care of it for me. diff --git a/backports/default.nix b/backports/default.nix index 5a74b8d..6115284 100644 --- a/backports/default.nix +++ b/backports/default.nix @@ -1,8 +1,12 @@ -final: prev: +nixfiles: final: prev: let - inherit (final) callPackage fetchFromGitHub; - inherit (final.lib) recurseIntoAttrs; + inherit (prev) callPackage fetchFromGitHub; + inherit (prev.lib) recurseIntoAttrs optionalAttrs; + # if you can't do version based just make it time based and deal with it in a + # month if it's not fixed + # 2024-04-10T08:11:11 + gap-hold = (nixfiles.inputs.nixpkgs-unstable.lastModified <= 1712751071); gimpPlugins-gap = let src = fetchFromGitHub { owner = "Scrumplex"; @@ -11,6 +15,4 @@ let hash="sha256-oat4TwOorFevUMZdBFgaQHx/UKqGW7CGMoOHVgQxVdM="; }; in recurseIntoAttrs (callPackage "${src}/pkgs/applications/graphics/gimp/plugins" {}); -in { - gimpPlugins = if prev.gimpPlugins.gap.version == "2.6.0" then gimpPlugins-gap else prev.gimpPlugins; -} +in (optionalAttrs gap-hold { gimpPlugins = gimpPlugins-gap; }) diff --git a/flake.nix b/flake.nix index c7b004f..6e087bb 100644 --- a/flake.nix +++ b/flake.nix @@ -68,7 +68,7 @@ }) # various temporary fixes that automatically revert - (import ./backports) + (import ./backports self) inputs.hyprwm-contrib.overlays.default inputs.rust-overlay.overlays.default