diff --git a/modules/decky-loader.nix b/modules/decky-loader.nix index fa5c58d5..a47965ad 100644 --- a/modules/decky-loader.nix +++ b/modules/decky-loader.nix @@ -22,6 +22,14 @@ in ''; }; + enableFHSEnvironment = mkOption { + type = types.bool; + default = false; + description = lib.mkDoc '' + Allows plugins shipping with prebuilt binaries to function (e.g. PowerTools). + ''; + }; + package = mkOption { type = types.package; default = pkgs.decky-loader; @@ -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"; }; };