From d84743b430fd52936ce201ef1b0c574080c026aa Mon Sep 17 00:00:00 2001 From: =?utf8?q?Isma=C3=ABl=20Bouya?= Date: Sat, 11 Apr 2020 20:53:31 +0200 Subject: [PATCH] Adjust some library functions --- lib/default.nix | 28 ++++++---------------------- 1 file changed, 6 insertions(+), 22 deletions(-) diff --git a/lib/default.nix b/lib/default.nix index 6b3dfdf4..86832d47 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -17,7 +17,8 @@ rec { json = lib.importJSON path; in rec { version = json.tag; - name = "${json.meta.name}-${version}"; + pname = json.meta.name; + name = "${pname}-${version}"; src = fetchFromGitHub json.github; }; @@ -26,7 +27,8 @@ rec { json = lib.importJSON path; in rec { version = json.tag; - name = "${json.meta.name}-${version}"; + pname = json.meta.name; + name = "${pname}-${version}"; src = fetchgit json.git; }; @@ -35,30 +37,12 @@ rec { json = lib.importJSON path; in rec { version = json.tag; - name = "${json.meta.name}-${version}"; + pname = json.meta.name; + name = "${pname}-${version}"; src = builtins.fetchGit { url = json.git.url; ref = "master"; rev = json.git.rev; }; }; - - wrap = { paths ? [], vars ? {}, file ? null, script ? null, name ? "wrap" }: - assert file != null || script != null || - abort "wrap needs 'file' or 'script' argument"; - with rec { - set = n: v: "--set ${pkgs.lib.escapeShellArg n} " + - "${pkgs.lib.escapeShellArg v}"; - args = (map (p: "--prefix PATH : ${p}/bin") paths) ++ - (builtins.attrValues (pkgs.lib.mapAttrs set vars)); - }; - runCommand name - { - f = if file == null then writeScript name script else file; - buildInputs = [ makeWrapper ]; - } - '' - makeWrapper "$f" "$out" ${toString args} - ''; - } // (if builtins.pathExists ./private then callPackage ./private {} else {}) -- 2.41.0