From e74c82fccfdafbbc34ecfa2174cf02f6bb34b9c5 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Wed, 10 Jul 2024 15:44:40 +0800 Subject: [PATCH] wrapper-manager-fds/lib: remove build-support subset It isn't used much and the module environment has gone into a much more than a single wrapper-per-module config. --- lib/build-support.nix | 66 ------------------------------------------- lib/default.nix | 2 -- 2 files changed, 68 deletions(-) delete mode 100644 lib/build-support.nix diff --git a/lib/build-support.nix b/lib/build-support.nix deleted file mode 100644 index ed7df6a..0000000 --- a/lib/build-support.nix +++ /dev/null @@ -1,66 +0,0 @@ -# Unless you're a third-party module author wanting to integrate -# wrapper-manager to whatever bespoke configuration environment, there is -# almost no reason to use the following functions, really. -{ pkgs, lib, self }: - -{ - /* The build function for making simple and single executable - wrappers similar to nixpkgs builders for various ecosystems (for example, - `buildGoPackage` and `buildRustPackage`). - */ - mkWrapper = { - arg0, - executableName ? arg0, - isBinary ? true, - - makeWrapperArgs ? [ ], - nativeBuildInputs ? [ ], - passthru ? { }, - }@args: - pkgs.runCommand "wrapper-manager-script-${executableName}" ( - (builtins.removeAttrs args [ "executableName" "arg0" "isBinary" ]) - // { - inherit makeWrapperArgs; - nativeBuildInputs = nativeBuildInputs ++ - (if isBinary then [ pkgs.makeBinaryWrapper ] else [ pkgs.makeWrapper ]); - - passthru = passthru // { - wrapperScript = { inherit arg0 executableName; }; - }; - } - ) '' - mkdir -p $out/bin - makeWrapper "${arg0}" "$out/bin/${executableName}" ''${makeWrapperArgs[@]} - ''; - - /* Similar to `mkWrapper` but include the output of the given package. */ - mkWrappedPackage = { - package, - executableName ? package.meta.mainProgram or package.pname, - arg0 ? executableName, - extraPackages ? [ ], - isBinary ? true, - - postBuild ? "", - nativeBuildInputs ? [ ], - makeWrapperArgs ? [ ], - passthru ? { }, - }@args: - pkgs.symlinkJoin ( - (builtins.removeAttrs args [ "package" "executableName" "extraPackages" "isBinary" ]) - // { - name = "wrapper-manager-wrapped-packages"; - paths = [ package ] ++ extraPackages; - - inherit makeWrapperArgs; - nativeBuildInputs = nativeBuildInputs ++ - (if isBinary then [ pkgs.makeBinaryWrapper ] else [ pkgs.makeWrapper ]); - passthru = passthru // { - wrapperScript = { inherit executableName package; }; - }; - postBuild = '' - ${postBuild} - makeWrapper "$out/bin/${arg0}" "$out/bin/${executableName}" ''${makeWrapperArgs[@]} - ''; - }); -} diff --git a/lib/default.nix b/lib/default.nix index c244de9..1ebb1b6 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -15,11 +15,9 @@ pkgs.lib.makeExtensible callLibs = file: import file { inherit (pkgs) lib; inherit pkgs self; }; in { - build-support = callLibs ./build-support.nix; env = import ./env.nix; utils = callLibs ./utils.nix; - inherit (self.build-support) mkWrapper mkWrappedPackage; inherit (self.env) build eval; inherit (self.utils) getBin getLibexec; })