From 0f54619563ce9948e27e0e35f7664b08824a569a Mon Sep 17 00:00:00 2001 From: Guanran Wang Date: Fri, 21 Jun 2024 11:20:42 +0800 Subject: [PATCH] scripts: use makeScope --- pkgs/default.nix | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/pkgs/default.nix b/pkgs/default.nix index ecf2467..938e460 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -1,13 +1,14 @@ # NOTE: 301: All packages are migrated to `github:Guanran928/nur-packages`, # only keeping some packages that only fits for personal use. -pkgs: { - scripts = rec { +pkgs: let + inherit (pkgs) lib; +in { + scripts = lib.makeScope pkgs.newScope (self: { # util - makeScript = pkgs.callPackage ./scripts/makeScript.nix {}; + makeScript = self.callPackage ./scripts/makeScript.nix {}; # scripts - # TODO: Do I really have to inherit `makeScript` for every script? - lofi = pkgs.callPackage ./scripts/lofi.nix {inherit makeScript;}; - screenshot = pkgs.callPackage ./scripts/screenshot.nix {inherit makeScript;}; - }; + lofi = self.callPackage ./scripts/lofi.nix {}; + screenshot = self.callPackage ./scripts/screenshot.nix {}; + }); }