core: wrap nix with wrapped commands

This commit is contained in:
Wroclaw 2024-06-01 01:12:39 +02:00
parent 9abc9c10ba
commit 82bf8ab05f

View file

@ -23,10 +23,17 @@ let
} }
); );
wrapedNixPrograms = [ # bool -> nixpkgs[]
(mkWrappedExecutable {pkg = pkgs.nix; exe = "nix-build"; wrapperArgs = ["--add-flags" "\"--log-format\"" "--add-flags" "bar-with-logs"];}) wrappedNixExecutables = inEnvironment: assert builtins.isBool inEnvironment; [
(mkWrappedExecutable {pkg = pkgs.nix; exe = "nix-build"; wrapperArgs = ["--add-flags" "\"--log-format\"" "--add-flags" "bar${lib.optionalString inEnvironment "-with-logs"}"];})
(mkWrappedExecutable {pkg = pkgs.nix; exe = "nix-shell"; wrapperArgs = ["--add-flags" "\"--log-format\"" "--add-flags" "bar"];}) (mkWrappedExecutable {pkg = pkgs.nix; exe = "nix-shell"; wrapperArgs = ["--add-flags" "\"--log-format\"" "--add-flags" "bar"];})
]; ];
wrappedNix = (pkgs.buildEnv {
name = "wrappedNix-${pkgs.nix.version}";
paths = [ pkgs.nix ] ++ wrappedNixExecutables false;
}).overrideAttrs {
version = pkgs.nix.version;
};
in in
{ {
# kernel # kernel
@ -37,6 +44,7 @@ in
# Allow unfree packages # Allow unfree packages
nixpkgs.config.allowUnfree = true; nixpkgs.config.allowUnfree = true;
nix.package = wrappedNix;
# List packages installed in system profile. To search, run: # List packages installed in system profile. To search, run:
# $ nix search wget # $ nix search wget
@ -49,7 +57,7 @@ in
fastfetch fastfetch
smartmontools smartmontools
ddrescue ddrescue
] ++ wrapedNixPrograms; ] ++ wrappedNixExecutables true;
programs.git.enable = true; programs.git.enable = true;
programs.git.config = { programs.git.config = {