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