better shell script thing thanks to abby

This commit is contained in:
kat witch 2020-12-08 16:59:50 +00:00 committed by kat
parent 6934230103
commit 8592cd4718

View file

@ -8,31 +8,25 @@
}; };
systemd = { systemd = {
services = { services = {
kaede-thermals = let kaede-thermals = {
kaede-thermals-script =
pkgs.writeScriptBin "script" (builtins.readFile ./kaede-thermals.sh);
in {
wantedBy = [ "multi-user.target" ]; wantedBy = [ "multi-user.target" ];
path = [ pkgs.bash pkgs.coreutils-full ]; path = [ pkgs.bash pkgs.coreutils-full ];
serviceConfig = { serviceConfig = {
RemainAfterExit = "no"; RemainAfterExit = "no";
Type = "simple"; Type = "simple";
ExecStart = "${kaede-thermals-script}/bin/script start"; ExecStart = "/usr/bin/env bash ${./kaede-thermals.sh} start";
ExecStop = "${kaede-thermals-script}/bin/script stop"; ExecStop = "/usr/bin/env bash ${./kaede-thermals.sh} stop";
User = "root"; User = "root";
}; };
}; };
kaede-power = let kaede-power = {
kaede-power-script =
pkgs.writeScriptBin "script" (builtins.readFile ./kaede-power.sh);
in {
wantedBy = [ "multi-user.target" ]; wantedBy = [ "multi-user.target" ];
path = [ pkgs.bash pkgs.linuxPackages.cpupower ]; path = [ pkgs.bash pkgs.linuxPackages.cpupower ];
serviceConfig = { serviceConfig = {
RemainAfterExit = "yes"; RemainAfterExit = "yes";
Type = "oneshot"; Type = "oneshot";
ExecStart = "${kaede-power-script}/bin/script start"; ExecStart = "/usr/bin/env bash ${./kaede-power.sh} start";
ExecStop = "${kaede-power-script}/bin/script stop"; ExecStop = "/usr/bin/env bash ${./kaede-power.sh} stop";
User = "root"; User = "root";
}; };
}; };