1
0
Fork 0

Improve sleep-nag-script

This commit is contained in:
Malte Brandy 2019-05-27 23:48:21 +02:00
parent 7163f7ee39
commit 238da0a3b2
No known key found for this signature in database
GPG key ID: 226A2D41EF5378C9

View file

@ -1,7 +1,9 @@
{ lib, pkgs, config, ... }:
with lib;
let
sleep-nag = pkgs.writeShellScriptBin "sleep-nag" ''
sleep-nag = pkgs.writeScript "sleep-nag" ''
#!${pkgs.stdenv.shell}
while true
do
if [[ `date +%H` -ge 23 ]] || [[ `date +%H` -lt 6 ]]; then
@ -21,7 +23,7 @@ config = mkIf config.m-0.sleep-nag.enable {
Description = "Sleep nag";
};
Service = {
ExecStart="/bin/sh ${sleep-nag}/bin/sleep-nag";
ExecStart=toString sleep-nag;
};
Install = {
WantedBy = [ "graphical-session.target" ];