Improve sleep-nag-script
This commit is contained in:
parent
7163f7ee39
commit
238da0a3b2
1 changed files with 4 additions and 2 deletions
|
@ -1,7 +1,9 @@
|
||||||
{ lib, pkgs, config, ... }:
|
{ lib, pkgs, config, ... }:
|
||||||
with lib;
|
with lib;
|
||||||
let
|
let
|
||||||
sleep-nag = pkgs.writeShellScriptBin "sleep-nag" ''
|
sleep-nag = pkgs.writeScript "sleep-nag" ''
|
||||||
|
#!${pkgs.stdenv.shell}
|
||||||
|
|
||||||
while true
|
while true
|
||||||
do
|
do
|
||||||
if [[ `date +%H` -ge 23 ]] || [[ `date +%H` -lt 6 ]]; then
|
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";
|
Description = "Sleep nag";
|
||||||
};
|
};
|
||||||
Service = {
|
Service = {
|
||||||
ExecStart="/bin/sh ${sleep-nag}/bin/sleep-nag";
|
ExecStart=toString sleep-nag;
|
||||||
};
|
};
|
||||||
Install = {
|
Install = {
|
||||||
WantedBy = [ "graphical-session.target" ];
|
WantedBy = [ "graphical-session.target" ];
|
||||||
|
|
Loading…
Reference in a new issue