Allow self-references in top-level package list

It now allows for package to use our own packages easily.

Though, having a recursive attribute set can be easier, setting our
package list this way is easier to maintain in the long-term since it is
a set-and-forget setup. The only disadvantage I can see is the need to
re-review what the hell the code is doing depending on my familiarity
for Nix in the future. ;p
This commit is contained in:
Gabriel Arazas 2022-01-18 18:21:20 +08:00
parent 3148121bf6
commit 8b5fd926ec

View File

@ -1,15 +1,20 @@
{ pkgs ? import <nixpkgs> { } }: { pkgs ? import <nixpkgs> { }, overrides ? (self: super: { }) }:
with pkgs; { with pkgs;
let
packages = self:
let callPackage = newScope self;
in {
doggo = callPackage ./doggo.nix { }; doggo = callPackage ./doggo.nix { };
gnome-shell-extension-pop-shell =
callPackage ./gnome-shell-extension-pop-shell.nix { };
gnome-shell-extension-burn-my-windows = gnome-shell-extension-burn-my-windows =
callPackage ./gnome-shell-extension-burn-my-windows.nix { }; callPackage ./gnome-shell-extension-burn-my-windows.nix { };
gnome-shell-extension-desktop-cube = gnome-shell-extension-desktop-cube =
callPackage ./gnome-shell-extension-desktop-cube.nix { }; callPackage ./gnome-shell-extension-desktop-cube.nix { };
gnome-shell-extension-fly-pie = gnome-shell-extension-fly-pie =
callPackage ./gnome-shell-extension-fly-pie.nix { }; callPackage ./gnome-shell-extension-fly-pie.nix { };
gnome-shell-extension-pop-shell =
callPackage ./gnome-shell-extension-pop-shell.nix { };
guile-config = callPackage ./guile-config.nix { }; guile-config = callPackage ./guile-config.nix { };
guile-hall = callPackage ./guile-hall.nix { }; guile-hall = callPackage ./guile-hall.nix { };
junction = callPackage ./junction.nix { }; junction = callPackage ./junction.nix { };
@ -24,4 +29,5 @@ with pkgs; {
tic-80 = callPackage ./tic-80 { }; tic-80 = callPackage ./tic-80 { };
sioyek = libsForQt5.callPackage ./sioyek.nix { }; sioyek = libsForQt5.callPackage ./sioyek.nix { };
vpaint = libsForQt5.callPackage ./vpaint.nix { }; vpaint = libsForQt5.callPackage ./vpaint.nix { };
} };
in lib.fix (lib.extends overrides packages)