1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-11-08 19:46:05 +01:00

files: move dry run logic out of onChange hooks

Fixes #751
This commit is contained in:
Naïm Favier 2021-08-01 00:54:47 +02:00 committed by Robert Helgesson
parent 8d68dbd144
commit 5569770d1e
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89
8 changed files with 24 additions and 31 deletions

View file

@ -309,10 +309,9 @@ in {
mkIf pkgs.stdenv.hostPlatform.isLinux {
text = qutebrowserConfig;
onChange = ''
hash="$(echo -n $USER | md5sum | cut -d' ' -f1)"
hash="$(echo -n "$USER" | md5sum | cut -d' ' -f1)"
socket="''${XDG_RUNTIME_DIR:-/run/user/$UID}/qutebrowser/ipc-$hash"
if [ -S $socket ]; then
echo "Reloading qutebrowser"
if [[ -S $socket ]]; then
command=${
escapeShellArg (builtins.toJSON {
args = [ ":config-source" ];
@ -320,7 +319,7 @@ in {
protocol_version = 1;
})
}
$DRY_RUN_CMD echo $command | ${pkgs.socat}/bin/socat -lf /dev/null - UNIX-CONNECT:$socket
echo "$command" | ${pkgs.socat}/bin/socat -lf /dev/null - UNIX-CONNECT:"$socket"
fi
unset hash socket command
'';