Skip to content

Commit

Permalink
devices/steamdeck: Create workarounds
Browse files Browse the repository at this point in the history
This, for now, handles saving the ALS data for use by steam.
  • Loading branch information
samueldr committed Oct 29, 2024
1 parent 52ef251 commit e0099a9
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 0 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
'';
};
}
]);
}

0 comments on commit e0099a9

Please sign in to comment.