diff options
| author | Ophestra Umiker <cat@ophivana.moe> | 2024-11-06 14:09:41 +0900 |
|---|---|---|
| committer | Ophestra Umiker <cat@ophivana.moe> | 2024-11-06 14:09:41 +0900 |
| commit | ad80be721be5bf60f69f0a244f882bb00edaf269 (patch) | |
| tree | c655faf7ed6ed5a88562089b240a9d44df6fa0b3 /nixos.nix | |
| parent | f831948bcab3ee8f9848ef14ea4062cfef6341c2 (diff) | |
nix: improve start script
Zsh store path in shebang. Replace writeShellScript with writeScript since runtimeShell is not overridable.
Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
Diffstat (limited to 'nixos.nix')
| -rw-r--r-- | nixos.nix | 16 |
1 files changed, 14 insertions, 2 deletions
@@ -64,12 +64,21 @@ in ''; }; + script = mkOption { + type = nullOr str; + default = null; + description = '' + Application launch script. + ''; + }; + command = mkOption { type = nullOr str; default = null; description = '' Command to run as the target user. Setting this to null will default command to wrapper name. + Has no effect when script is set. ''; }; @@ -298,6 +307,7 @@ in system_bus = launcher.dbus.system; }; command = if launcher.command == null then name else launcher.command; + script = if launcher.script == null then ("exec " + command + " $@") else launcher.script; enablements = (if wayland then 1 else 0) + (if x11 then 2 else 0) @@ -307,8 +317,10 @@ in inherit (launcher) id method; inherit user; command = [ - "/run/current-system/sw/bin/zsh" - (pkgs.writeShellScript "${name}-start" ("exec " + command + " $@")) + (pkgs.writeScript "${name}-start" '' + #!${pkgs.zsh}${pkgs.zsh.shellPath} + ${script} + '') ]; confinement = { sandbox = { |
