mirror of
https://cgit.krebsco.de/krops
synced 2024-11-23 03:29:48 +01:00
withNixOutputMonitor: run shell with know Nix path
This commit is contained in:
parent
6ee1d00b92
commit
e5c13343a6
1 changed files with 3 additions and 2 deletions
|
@ -9,7 +9,7 @@ in
|
||||||
}:
|
}:
|
||||||
args: target:
|
args: target:
|
||||||
runShell target {}
|
runShell target {}
|
||||||
(withNixOutputMonitor useNixOutputMonitor /* sh */ ''
|
(withNixOutputMonitor target useNixOutputMonitor /* sh */ ''
|
||||||
nixos-rebuild -I ${
|
nixos-rebuild -I ${
|
||||||
lib.concatMapStringsSep " " lib.escapeShellArg ([target.path] ++ args)
|
lib.concatMapStringsSep " " lib.escapeShellArg ([target.path] ++ args)
|
||||||
}
|
}
|
||||||
|
@ -37,7 +37,7 @@ in
|
||||||
])}
|
])}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
withNixOutputMonitor = mode_: command: let
|
withNixOutputMonitor = target: mode_: command: let
|
||||||
mode =
|
mode =
|
||||||
lib.getAttr (lib.typeOf mode_) {
|
lib.getAttr (lib.typeOf mode_) {
|
||||||
bool = lib.toJSON mode_;
|
bool = lib.toJSON mode_;
|
||||||
|
@ -57,6 +57,7 @@ in
|
||||||
(${command}) 2>&1 | nom
|
(${command}) 2>&1 | nom
|
||||||
'';
|
'';
|
||||||
pessimistic = /* sh */ ''
|
pessimistic = /* sh */ ''
|
||||||
|
NIX_PATH=${lib.escapeShellArg target.path} \
|
||||||
nix-shell -p nix-output-monitor --run ${lib.escapeShellArg optimistic}
|
nix-shell -p nix-output-monitor --run ${lib.escapeShellArg optimistic}
|
||||||
'';
|
'';
|
||||||
true = /* sh */ ''
|
true = /* sh */ ''
|
||||||
|
|
Loading…
Reference in a new issue