Skip to content

Commit

Permalink
modules/decky-loader: Add enableFHSEnvironment option
Browse files Browse the repository at this point in the history
  • Loading branch information
pongo1231 committed Dec 23, 2024
1 parent dbae2fd commit f505920
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions modules/decky-loader.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ in
'';
};

enableFHSEnvironment = mkOption {
type = types.bool;
default = false;
description = lib.mdDoc ''
Allows plugins shipping with prebuilt binaries to function (e.g. PowerTools).
'';
};

package = mkOption {
type = types.package;
default = pkgs.decky-loader;
Expand Down Expand Up @@ -105,8 +113,16 @@ in
chown -R "${cfg.user}:" "${cfg.stateDir}"
'';

serviceConfig = {
ExecStart = "${package}/bin/decky-loader";
serviceConfig = let
decky-loader = if !cfg.enableFHSEnvironment then
"${package}"
else
pkgs.buildFHSEnv {
name = "decky-loader";
runScript = "${package}/bin/decky-loader";
};
in {
ExecStart = "${decky-loader}/bin/decky-loader";
KillMode = "process";
TimeoutStopSec = 45;
};
Expand Down

0 comments on commit f505920

Please sign in to comment.