core: wrap nix-build and nix-shell with default log format
This commit is contained in:
parent
5acbee3237
commit
98bba7fa6a
1 changed files with 21 additions and 1 deletions
|
@ -4,6 +4,26 @@
|
||||||
|
|
||||||
{ config, pkgs, lib, ... }:
|
{ config, pkgs, lib, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
/*
|
||||||
|
* pkgs: 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 = [
|
||||||
|
(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"];})
|
||||||
|
];
|
||||||
|
in
|
||||||
{
|
{
|
||||||
# kernel
|
# kernel
|
||||||
boot.kernelPackages = pkgs.linuxPackages_latest;
|
boot.kernelPackages = pkgs.linuxPackages_latest;
|
||||||
|
@ -26,7 +46,7 @@
|
||||||
ranger
|
ranger
|
||||||
smartmontools
|
smartmontools
|
||||||
ddrescue
|
ddrescue
|
||||||
];
|
] ++ wrapedNixPrograms;
|
||||||
|
|
||||||
programs.git.enable = true;
|
programs.git.enable = true;
|
||||||
programs.git.config = {
|
programs.git.config = {
|
||||||
|
|
Loading…
Reference in a new issue