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 10, 2023
1 parent ad708a4 commit 5273ebc
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 @@ -22,6 +22,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 = "${cfg.package}/bin/decky-loader";
serviceConfig = let
decky-loader = if !cfg.enableFHSEnvironment then
"${cfg.package}"
else
pkgs.buildFHSEnv {
name = "decky-loader";
runScript = "${cfg.package}/bin/decky-loader";
};
in {
ExecStart = "${decky-loader}/bin/decky-loader";
KillSignal = "SIGINT";
};
};
Expand Down

0 comments on commit 5273ebc

Please sign in to comment.