1
0
Fork 0
mirror of https://cgit.krebsco.de/krops synced 2024-11-10 13:19:46 +01:00

withNixOutputMonitor: run shell with know Nix path

This commit is contained in:
tv 2022-09-07 11:55:35 +02:00
parent 6ee1d00b92
commit e5c13343a6

View file

@ -9,7 +9,7 @@ in
}:
args: target:
runShell target {}
(withNixOutputMonitor useNixOutputMonitor /* sh */ ''
(withNixOutputMonitor target useNixOutputMonitor /* sh */ ''
nixos-rebuild -I ${
lib.concatMapStringsSep " " lib.escapeShellArg ([target.path] ++ args)
}
@ -37,7 +37,7 @@ in
])}
'';
withNixOutputMonitor = mode_: command: let
withNixOutputMonitor = target: mode_: command: let
mode =
lib.getAttr (lib.typeOf mode_) {
bool = lib.toJSON mode_;
@ -57,6 +57,7 @@ in
(${command}) 2>&1 | nom
'';
pessimistic = /* sh */ ''
NIX_PATH=${lib.escapeShellArg target.path} \
nix-shell -p nix-output-monitor --run ${lib.escapeShellArg optimistic}
'';
true = /* sh */ ''