core: wrap nix with wrapped commands
This commit is contained in:
parent
9abc9c10ba
commit
82bf8ab05f
1 changed files with 11 additions and 3 deletions
|
@ -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 = {
|
||||
|
|
Loading…
Reference in a new issue