diff --git a/nix-os/core.nix b/nix-os/core.nix index 7f07c00..273753f 100644 --- a/nix-os/core.nix +++ b/nix-os/core.nix @@ -6,20 +6,24 @@ let /* - * pkgs: package - nixpkgs package + * pkg: package - nixpkgs package * exe: string - executable (under bin) in pkgs * wrapperArgs: string[] - arguments to pass to the wrapper */ - mkWrappedExecutable = {pkg, exe ? pkg.meta.mainProgram, wrapperArgs}: let inherit (pkgs) lib makeWrapper; in pkgs.stdenv.mkDerivation { - name = "${pkg.name}-wrap-${exe}"; - nativeBuildInputs = [ makeWrapper ]; - phases = ["installPhase"]; - installPhase = '' - mkdir -p $out/bin - makeWrapper ${pkg}/bin/${exe} $out/bin/${exe} ${lib.concatStringsSep " " wrapperArgs} - ''; - }; - wrapedNixPrograms = builtins.map lib.hiPrio [ + mkWrappedExecutable = {pkg, exe ? pkg.meta.mainProgram, wrapperArgs}: let inherit (pkgs) lib makeWrapper; in lib.hiPrio ( + pkgs.stdenv.mkDerivation { + inherit wrapperArgs; + name = "${pkg.name}-wrap-${exe}"; + nativeBuildInputs = [ makeWrapper ]; + phases = ["installPhase"]; + installPhase = '' + mkdir -p $out/bin + makeWrapper ${pkg}/bin/${exe} $out/bin/${exe} $wrapperArgs + ''; + } + ); + + wrapedNixPrograms = [ (mkWrappedExecutable {pkg = pkgs.nix; exe = "nix-build"; wrapperArgs = ["--add-flags" "\"--log-format\"" "--add-flags" "bar-with-logs"];}) (mkWrappedExecutable {pkg = pkgs.nix; exe = "nix-shell"; wrapperArgs = ["--add-flags" "\"--log-format\"" "--add-flags" "bar"];}) ];