Skip to content

Commit

Permalink
Merge pull request #434 from Jovian-Experiments/als-workser
Browse files Browse the repository at this point in the history
  • Loading branch information
samueldr authored Oct 29, 2024
2 parents b0d86a6 + 5f658b5 commit 97c6019
Show file tree
Hide file tree
Showing 6 changed files with 62 additions and 5 deletions.
1 change: 1 addition & 0 deletions modules/devices/steamdeck/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ in
./perf-control.nix
./sdgyrodsu.nix
./sound.nix
./workarounds.nix
];

options = {
Expand Down
48 changes: 48 additions & 0 deletions modules/devices/steamdeck/workarounds.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{ config, lib, pkgs, ... }:

let
inherit (lib)
mkIf
mkMerge
mkOption
types
;

cfg = config.jovian.devices.steamdeck;
in
{
options = {
jovian.devices.steamdeck = {
enableDeviceDataWorkarounds = mkOption {
type = types.bool;
default = cfg.enable;
defaultText = lib.literalExpression "config.jovian.devices.steamdeck.enable";
description = ''
Whether to add some workarounds for (Steam Deck) device-specific data.
'';
# Don't expose to users.
internal = true;
readOnly = true;
};
};
};
config = mkIf (cfg.enableDeviceDataWorkarounds) (mkMerge [
{
systemd.services."jovian-dmidecode-workaround" = {
enable = true;
unitConfig.ConditionPathIsDirectory = "/run";
before = [ "multi-user.target" ];
wantedBy = [ "multi-user.target" ];
serviceConfig = {
Type = "oneshot";
RemainAfterExit = true;
};
script = ''
#!${pkgs.runtimeShell}
mkdir -p /run/jovian
${pkgs.dmidecode}/bin/dmidecode -t 11 > /run/jovian/dmidecode-11.txt
'';
};
}
]);
}
1 change: 1 addition & 0 deletions pkgs/jovian-stubs/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ stdenv.mkDerivation {
install -D -m 755 ${./steamos-select-branch} $out/bin/steamos-select-branch
install -D -m 755 ${./steamos-update} $out/bin/steamos-update
install -D -m 755 ${./dmidecode} $out/bin/dmidecode
install -D -m 755 ${./pkexec} $out/bin/pkexec
install -D -m 755 ${./sudo} $out/bin/sudo
'';
Expand Down
11 changes: 11 additions & 0 deletions pkgs/jovian-stubs/dmidecode
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env bash
>&2 echo "[JOVIAN] $0: stub called with: $*"

if [ "$*" == "-t 11" ]; then
>&2 echo "[JOVIAN] $0: replying with cached data"
cat /run/jovian/dmidecode-11.txt
exit 0
fi

>&2 echo "[JOVIAN] $0: don't know how to handle $*"
exit 1
3 changes: 1 addition & 2 deletions pkgs/jupiter-hw-support/polkit-helpers.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
resholve,
bash,
coreutils,
dmidecode,
gawk,
gnugrep,
jovian-stubs,
Expand All @@ -23,7 +22,6 @@ let
interpreter = "${bash}/bin/bash";
inputs = [
coreutils
dmidecode
gawk
gnugrep
"${jupiter-dock-updater-bin}/lib/jupiter-dock-updater"
Expand All @@ -40,6 +38,7 @@ let
"cannot:${jovian-stubs}/bin/steamos-factory-reset-config"
"cannot:${jovian-stubs}/bin/steamos-select-branch"
"cannot:${jovian-stubs}/bin/steamos-update"
"cannot:${jovian-stubs}/bin/dmidecode"
"cannot:${jupiter-dock-updater-bin}/lib/jupiter-dock-updater/jupiter-dock-updater.sh"
"cannot:${jupiter-hw-support}/bin/jupiter-check-support"
"cannot:${jupiter-hw-support}/lib/hwsupport/format-device.sh"
Expand Down
3 changes: 0 additions & 3 deletions pkgs/steam-jupiter/fhsenv.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# dependencies of the Steam Deck UI

{ writeShellScriptBin
, dmidecode
, jovian-stubs
, steam
# , steamos-polkit-helpers
Expand All @@ -14,7 +13,6 @@ let
"lib"
"runCommand"
"writeShellScriptBin"
"dmidecode"
"jovian-stubs"
"steam"
"steamos-polkit-helpers"
Expand Down Expand Up @@ -45,7 +43,6 @@ let

wrappedSteam = steam.override (extraArgs // {
extraPkgs = pkgs: (if args ? extraPkgs then args.extraPkgs pkgs else []) ++ [
dmidecode
jovian-stubs
sessionSwitcher

Expand Down

0 comments on commit 97c6019

Please sign in to comment.