From 444195a47eaa06d7e9f4d663f5dd3d218ed54baa Mon Sep 17 00:00:00 2001 From: Gustavo Coutinho de Souza Date: Sat, 25 Nov 2023 13:11:50 -0300 Subject: [PATCH] hare: refactor `harePackages` into `hareThirdParty` The name `harePackages` may give thet impression that programs written in Hare should be added to its scope, which is not true: its purpose is to encapsulate Hare third party libraries. Thus, changing it to `hareThirdParty` makes it clear what its purpose is --- just like renaming `hare-packages.nix` to `hare-third-party.nix` on `pkgs/top-level`. Moreover, remove the `hare` and `harec` packages from the newly renamed `hareThirdParty` scope, since they are not Hare libraries. Finally, remove the inheritance of `harePackages.hare` on `himitsu` and `himitsu-firefox`, the two programs using `hare` on nixpkgs: both `hare` and `harec` are directly accessible since 12449072[1], when they were moved from `aliases.nix` to `all-packages.nix`, with the difference now that they do not belong anymore to `harePackages` --- now `hareThirdParty`. [1]: https://github.com/NixOS/nixpkgs/commit/1244907222bc7dc5cf4396544796afa6c14c2e52 --- pkgs/top-level/all-packages.nix | 15 +++++++-------- pkgs/top-level/hare-packages.nix | 10 ---------- pkgs/top-level/hare-third-party.nix | 7 +++++++ 3 files changed, 14 insertions(+), 18 deletions(-) delete mode 100644 pkgs/top-level/hare-packages.nix create mode 100644 pkgs/top-level/hare-third-party.nix diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 44e8876d1977..0f644383f190 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -3945,13 +3945,9 @@ with pkgs; hime = callPackage ../tools/inputmethods/hime { }; - himitsu = callPackage ../tools/security/himitsu { - inherit (harePackages) hare; - }; + himitsu = callPackage ../tools/security/himitsu { }; - himitsu-firefox = callPackage ../tools/security/himitsu-firefox { - inherit (harePackages) hare; - }; + himitsu-firefox = callPackage ../tools/security/himitsu-firefox { }; hinit = haskell.lib.compose.justStaticExecutables haskellPackages.hinit; @@ -9126,8 +9122,11 @@ with pkgs; llvmPackages = llvmPackages_16; }; - harePackages = recurseIntoAttrs (callPackage ./hare-packages.nix { }); - inherit (harePackages) hare harec; + hare = callPackage ../development/compilers/hare { }; + + harec = callPackage ../development/compilers/harec { }; + + hareThirdParty = recurseIntoAttrs (callPackage ./hare-third-party.nix { }); ham = pkgs.perlPackages.ham; diff --git a/pkgs/top-level/hare-packages.nix b/pkgs/top-level/hare-packages.nix deleted file mode 100644 index c40cce493090..000000000000 --- a/pkgs/top-level/hare-packages.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ lib, newScope }: - -lib.makeScope newScope (self: -let - inherit (self) callPackage; -in -{ - harec = callPackage ../development/compilers/harec { }; - hare = callPackage ../development/compilers/hare { }; -}) diff --git a/pkgs/top-level/hare-third-party.nix b/pkgs/top-level/hare-third-party.nix new file mode 100644 index 000000000000..524df05659f4 --- /dev/null +++ b/pkgs/top-level/hare-third-party.nix @@ -0,0 +1,7 @@ +{ lib, newScope }: + +lib.makeScope newScope (self: +let + inherit (self) callPackage; +in +{ })