diff --git a/overlays/pkgs.nix b/overlays/pkgs.nix index 61005ab5..ca61e4f4 100644 --- a/overlays/pkgs.nix +++ b/overlays/pkgs.nix @@ -1,24 +1,18 @@ (next: prev: let - additional = import ../pkgs/additional next; + additional = import ../pkgs/additional + { pkgs = next; lib = prev.lib; }; python-packages = { pythonPackagesExtensions = prev.pythonPackagesExtensions ++ [ (py-final: py-prev: import ../pkgs/python-packages { inherit (py-prev) callPackage; }) ]; }; - # to avoid infinite recursion, the patched packages require *unpatched* inputs, - # but we don't want to just send `prev` naively, else patched packages might - # take dependencies on unpatched versions of other packages we patch; or they - # won't be able to use inputs from `additional`, etc. - # - # so, call the patched packages using the `next` package set, except with - # they packages we're "about to" patch replaced with their versions from `prev`. - # - # we could alternatively pass `pkgs = prev // { inherit (next) callPackage; }`, - patched = import ../pkgs/patched (next // patchedInputs); - patchedInputs = builtins.mapAttrs (name: _patched: prev."${name}") patched; + patched = import ../pkgs/patched + { pkgs = next; lib = prev.lib; unpatched = prev; }; sane = additional // python-packages // patched; - in sane // { inherit sane; } + in sane // { + sane = next.recurseIntoAttrs sane; + } ) diff --git a/pkgs/additional/default.nix b/pkgs/additional/default.nix index eeb61d30..1bd766e3 100644 --- a/pkgs/additional/default.nix +++ b/pkgs/additional/default.nix @@ -1,35 +1,38 @@ # { callPackage, callPackages, libsForQt5, pkgs, recurseIntoAttrs }: -pkgs: +{ pkgs ? import {}, lib ? pkgs.lib }: let - inherit (pkgs) callPackage callPackages libsForQt5 recurseIntoAttrs; -in { - sane-lib = import ../../modules/lib pkgs; + me = lib.makeScope pkgs.newScope (self: with self; { + sane-lib = import ../../modules/lib pkgs; - bootpart-tow-boot-rpi-aarch64 = callPackage ./bootpart-tow-boot-rpi-aarch64 { }; - bootpart-u-boot-rpi-aarch64 = callPackage ./bootpart-u-boot-rpi-aarch64 { }; - bootpart-uefi-x86_64 = callPackage ./bootpart-uefi-x86_64 { }; - browserpass-extension = callPackage ./browserpass-extension { }; - cargo-docset = callPackage ./cargo-docset { }; - feeds = recurseIntoAttrs (callPackage ./feeds { }); - fluffychat-moby = callPackage ./fluffychat-moby { }; - fractal-latest = callPackage ./fractal-latest { }; - gopass-native-messaging-host = callPackage ./gopass-native-messaging-host { }; - gpodder-configured = callPackage ./gpodder-configured { }; - kaiteki = callPackage ./kaiteki { }; - lightdm-mobile-greeter = callPackage ./lightdm-mobile-greeter { }; - linux-megous = callPackage ./linux-megous { }; - mx-sanebot = callPackage ./mx-sanebot { }; - rtl8723cs-firmware = callPackage ./rtl8723cs-firmware { }; - sane-scripts = callPackage ./sane-scripts { }; - static-nix-shell = callPackages ./static-nix-shell { }; - sublime-music-mobile = callPackage ./sublime-music-mobile { }; - tokodon = libsForQt5.callPackage ./tokodon { }; - tow-boot-pinephone = callPackage ./tow-boot-pinephone { }; - tow-boot-rpi4 = callPackage ./tow-boot-rpi4 { }; + bootpart-uefi-x86_64 = callPackage ./bootpart-uefi-x86_64 { }; + browserpass-extension = callPackage ./browserpass-extension { }; + cargo-docset = callPackage ./cargo-docset { }; + feeds = recurseIntoAttrs (callPackage ./feeds { }); + gopass-native-messaging-host = callPackage ./gopass-native-messaging-host { }; + gpodder-configured = callPackage ./gpodder-configured { }; + lightdm-mobile-greeter = callPackage ./lightdm-mobile-greeter { }; + linux-megous = callPackage ./linux-megous { }; + mx-sanebot = callPackage ./mx-sanebot { }; + rtl8723cs-firmware = callPackage ./rtl8723cs-firmware { }; + sane-scripts = callPackage ./sane-scripts { }; + static-nix-shell = callPackage ./static-nix-shell { }; + sublime-music-mobile = callPackage ./sublime-music-mobile { }; + tow-boot-pinephone = callPackage ./tow-boot-pinephone { }; - # patch rpi uboot with something that fixes USB HDD boot - ubootRaspberryPi4_64bit = callPackage ./ubootRaspberryPi4_64bit { }; + # packages i haven't used for a while, may or may not still work + # fluffychat-moby = callPackage ./fluffychat-moby { }; + # fractal-latest = callPackage ./fractal-latest { }; + # kaiteki = callPackage ./kaiteki { }; + # tokodon = libsForQt5.callPackage ./tokodon { }; - # provided by nixpkgs patch or upstream PR - # splatmoji = callPackage ./splatmoji { }; -} + # old rpi packages that may or may not still work + # bootpart-tow-boot-rpi-aarch64 = callPackage ./bootpart-tow-boot-rpi-aarch64 { }; + # bootpart-u-boot-rpi-aarch64 = callPackage ./bootpart-u-boot-rpi-aarch64 { }; + # tow-boot-rpi4 = callPackage ./tow-boot-rpi4 { }; + # patch rpi uboot with something that fixes USB HDD boot + # ubootRaspberryPi4_64bit = callPackage ./ubootRaspberryPi4_64bit { }; + + # provided by nixpkgs patch or upstream PR + # splatmoji = callPackage ./splatmoji { }; + }); +in me.packages me diff --git a/pkgs/patched/default.nix b/pkgs/patched/default.nix index e0606005..3181b493 100644 --- a/pkgs/patched/default.nix +++ b/pkgs/patched/default.nix @@ -1,18 +1,18 @@ -pkgs: +{ pkgs, lib ? pkgs.lib, unpatched ? pkgs }: let - inherit (pkgs) callPackage; -in { - # XXX: the `inherit`s here are because: - # - pkgs.callPackage draws from the _final_ package set. - # - pkgs.XYZ draws (selectively) from the _previous_ package set. - # see - browserpass = callPackage ./browserpass { inherit (pkgs) browserpass; }; + me = lib.makeScope pkgs.newScope (self: with self; { + # XXX: the `inherit`s here are because: + # - pkgs.callPackage draws from the _final_ package set. + # - unpatched.XYZ draws (selectively) from the _unpatched_ package set. + # see + browserpass = callPackage ./browserpass { inherit (unpatched) browserpass; }; - # mozilla keeps nerfing itself and removing configuration options - firefox-unwrapped = callPackage ./firefox-unwrapped { inherit (pkgs) firefox-unwrapped; }; + # mozilla keeps nerfing itself and removing configuration options + firefox-unwrapped = callPackage ./firefox-unwrapped { inherit (unpatched) firefox-unwrapped; }; - gocryptfs = callPackage ./gocryptfs { inherit (pkgs) gocryptfs; }; + gocryptfs = callPackage ./gocryptfs { inherit (unpatched) gocryptfs; }; - # jackett doesn't allow customization of the bind address: this will probably always be here. - jackett = callPackage ./jackett { inherit (pkgs) jackett; }; -} + # jackett doesn't allow customization of the bind address: this will probably always be here. + jackett = callPackage ./jackett { inherit (unpatched) jackett; }; + }); +in me.packages me