polybar: use writeShellScriptBin

(cherry picked from commit 41356ac267)
This commit is contained in:
Robert Helgesson 2019-03-21 00:39:36 +01:00
parent 6fcaef5235
commit deb2868d57
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89

View file

@ -27,12 +27,6 @@ let
configFile = pkgs.writeText "polybar.conf"
(toPolybarIni cfg.config + "\n" + cfg.extraConfig);
script = ''
#!${pkgs.stdenv.shell}
${cfg.script}
'';
in
{
@ -130,7 +124,11 @@ in
Service = {
Type = "forking";
Environment = "PATH=${cfg.package}/bin:/run/wrappers/bin";
ExecStart = ''${pkgs.writeScriptBin "polybar-start" script}/bin/polybar-start'';
ExecStart =
let
scriptPkg = pkgs.writeShellScriptBin "polybar-start" cfg.script;
in
"${scriptPkg}/bin/polybar-start";
};
Install = {