mirror of
https://github.com/nix-community/home-manager
synced 2024-11-30 06:59:45 +01:00
formatting according to HM's format tool
This commit is contained in:
parent
e091fe38a9
commit
2d676db43f
1 changed files with 14 additions and 15 deletions
|
@ -56,14 +56,10 @@ let
|
||||||
copyKeys = pkgs.writers.writeBash "syncthing-copy-keys" ''
|
copyKeys = pkgs.writers.writeBash "syncthing-copy-keys" ''
|
||||||
${install} -dm700 "${syncthing_dir}"
|
${install} -dm700 "${syncthing_dir}"
|
||||||
${optionalString (cfg.cert != null) ''
|
${optionalString (cfg.cert != null) ''
|
||||||
${install} -Dm400 ${
|
${install} -Dm400 ${toString cfg.cert} "${syncthing_dir}/cert.pem"
|
||||||
toString cfg.cert
|
|
||||||
} "${syncthing_dir}/cert.pem"
|
|
||||||
''}
|
''}
|
||||||
${optionalString (cfg.key != null) ''
|
${optionalString (cfg.key != null) ''
|
||||||
${install} -Dm400 ${
|
${install} -Dm400 ${toString cfg.key} "${syncthing_dir}/key.pem"
|
||||||
toString cfg.key
|
|
||||||
} "${syncthing_dir}/key.pem"
|
|
||||||
''}
|
''}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
@ -646,7 +642,8 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
Service = {
|
Service = {
|
||||||
ExecStartPre = mkIf (cfg.cert != null || cfg.key != null) "+${copyKeys}";
|
ExecStartPre =
|
||||||
|
mkIf (cfg.cert != null || cfg.key != null) "+${copyKeys}";
|
||||||
ExecStart = escapeShellArgs syncthingArgs;
|
ExecStart = escapeShellArgs syncthingArgs;
|
||||||
Restart = "on-failure";
|
Restart = "on-failure";
|
||||||
SuccessExitStatus = [ 3 4 ];
|
SuccessExitStatus = [ 3 4 ];
|
||||||
|
@ -692,13 +689,13 @@ in {
|
||||||
syncthing = {
|
syncthing = {
|
||||||
enable = true;
|
enable = true;
|
||||||
config = {
|
config = {
|
||||||
ProgramArguments = [ "${
|
ProgramArguments = [
|
||||||
pkgs.writers.writeBash "syncthing-wrapper" ''
|
"${pkgs.writers.writeBash "syncthing-wrapper" ''
|
||||||
${copyKeys} # simulate systemd's `syncthing-init.Service.ExecStartPre`
|
${copyKeys} # simulate systemd's `syncthing-init.Service.ExecStartPre`
|
||||||
touch "${syncthing_dir}/${watch_file}" # notify syncthing-init agent
|
touch "${syncthing_dir}/${watch_file}" # notify syncthing-init agent
|
||||||
exec ${lib.escapeShellArgs syncthingArgs}
|
exec ${lib.escapeShellArgs syncthingArgs}
|
||||||
''
|
''}"
|
||||||
}" ];
|
];
|
||||||
KeepAlive = {
|
KeepAlive = {
|
||||||
Crashed = true;
|
Crashed = true;
|
||||||
SuccessfulExit = false;
|
SuccessfulExit = false;
|
||||||
|
@ -711,7 +708,9 @@ in {
|
||||||
enable = true;
|
enable = true;
|
||||||
config = {
|
config = {
|
||||||
ProgramArguments = [ "${updateConfig}" ];
|
ProgramArguments = [ "${updateConfig}" ];
|
||||||
WatchPaths = [ "${config.home.homeDirectory}/Library/Application Support/Syncthing/${watch_file}" ];
|
WatchPaths = [
|
||||||
|
"${config.home.homeDirectory}/Library/Application Support/Syncthing/${watch_file}"
|
||||||
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue