From 8592cd47184eac6677abd819b15e6db5ffb2d3bb Mon Sep 17 00:00:00 2001 From: kat witch Date: Tue, 8 Dec 2020 16:59:50 +0000 Subject: [PATCH] better shell script thing thanks to abby --- .../hosts/samhain/services/thermal/thermal.nix | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/configuration/hosts/samhain/services/thermal/thermal.nix b/configuration/hosts/samhain/services/thermal/thermal.nix index 4235f9ac..d58103a3 100644 --- a/configuration/hosts/samhain/services/thermal/thermal.nix +++ b/configuration/hosts/samhain/services/thermal/thermal.nix @@ -8,31 +8,25 @@ }; systemd = { services = { - kaede-thermals = let - kaede-thermals-script = - pkgs.writeScriptBin "script" (builtins.readFile ./kaede-thermals.sh); - in { + kaede-thermals = { wantedBy = [ "multi-user.target" ]; path = [ pkgs.bash pkgs.coreutils-full ]; serviceConfig = { RemainAfterExit = "no"; Type = "simple"; - ExecStart = "${kaede-thermals-script}/bin/script start"; - ExecStop = "${kaede-thermals-script}/bin/script stop"; + ExecStart = "/usr/bin/env bash ${./kaede-thermals.sh} start"; + ExecStop = "/usr/bin/env bash ${./kaede-thermals.sh} stop"; User = "root"; }; }; - kaede-power = let - kaede-power-script = - pkgs.writeScriptBin "script" (builtins.readFile ./kaede-power.sh); - in { + kaede-power = { wantedBy = [ "multi-user.target" ]; path = [ pkgs.bash pkgs.linuxPackages.cpupower ]; serviceConfig = { RemainAfterExit = "yes"; Type = "oneshot"; - ExecStart = "${kaede-power-script}/bin/script start"; - ExecStop = "${kaede-power-script}/bin/script stop"; + ExecStart = "/usr/bin/env bash ${./kaede-power.sh} start"; + ExecStop = "/usr/bin/env bash ${./kaede-power.sh} stop"; User = "root"; }; };