summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2015-12-04 10:22:42 +0100
committermakefu <github@syntax-fehler.de>2015-12-04 10:22:42 +0100
commit0b1d441ddd1076bcb9bbb02abe13dddb3208efce (patch)
tree5e653916ff248185d074b48807845e801beac2f9
parent65cc52e01e18c823016a3043b8cf41822934cc3c (diff)
parentf9aceee5cce66503c069be2e01510f2a6215fb62 (diff)
Merge branch 'master' of pnp:stockholm
-rw-r--r--shared/2configs/shack-drivedroid.nix24
1 files changed, 13 insertions, 11 deletions
diff --git a/shared/2configs/shack-drivedroid.nix b/shared/2configs/shack-drivedroid.nix
index 66940bc08..08a6b0697 100644
--- a/shared/2configs/shack-drivedroid.nix
+++ b/shared/2configs/shack-drivedroid.nix
@@ -4,23 +4,25 @@ let
srepodir = lib.shell.escape repodir;
in
{
- systemd.paths.drivedroid = {
- wantedBy = [ "multi-user.target" ];
- Description = "triggers for changes in drivedroid dir";
- pathConfig = {
- PathModified = repodir;
- };
- };
+ environment.systemPackages = [ pkgs.drivedroid-gen-repo ];
systemd.services.drivedroid = {
- ServiceConfig = {
- ExecStartPre = pkgs.writeScript "prepare-drivedroid-repo-gen" ''
+ description = "generates drivedroid repo file";
+ restartIfChanged = true;
+ wantedBy = [ "multi-user.target" ];
+
+ serviceConfig = {
+ Type = "simple";
+ Restart = "always";
+ ExecStartPre = pkgs.writeScript "prepare-drivedroid-gen-repo" ''
#!/bin/sh
mkdir -p ${srepodir}/repos
'';
- ExecStart = pkgs.writeScript "start-drivedroid-repo-gen" ''
+ ExecStart = pkgs.writeScript "start-drivedroid-gen-repo" ''
#!/bin/sh
- {pkgs.drivedroid-gen-repo}/bin/drivedroid-gen-repo --chdir "${srepodir}" repos/ > "${srepodir}/main.json"
+ while sleep 60; do
+ ${pkgs.inotify-tools}/bin/inotifywait -r ${srepodir} && ${pkgs.drivedroid-gen-repo}/bin/drivedroid-gen-repo --chdir "${srepodir}" repos/ > "${srepodir}/main.json"
+ done
'';
};
};