Skip to content

Commit 2a9a092

Browse files
committed
treewide: steamos-manager 25.12.0 -> 26.0.1, ship new CEC stack
1 parent 8492a2d commit 2a9a092

File tree

12 files changed

+234
-196
lines changed

12 files changed

+234
-196
lines changed

modules/steam/steam.nix

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -67,16 +67,6 @@ in
6767
# https://github.com/Jovian-Experiments/steamos-manager/blob/5fecc6bbb47719a65d0b10aacbd0ffe873fb1e43/data/user/orca.service#L9
6868
systemd.user.services.orca.serviceConfig.EnvironmentFile = "%t/gamescope-environment";
6969

70-
# Vendor patch: https://raw.githubusercontent.com/Jovian-Experiments/PKGBUILDs-mirror/cdaeca26642d59fc9109e98ac9ce2efe5261df1b/0001-Add-systemd-service.patch
71-
systemd.user.services.wakehook = {
72-
wantedBy = ["gamescope-session.service"];
73-
after = ["gamescope-session.service"];
74-
serviceConfig = {
75-
ExecStart = lib.getExe pkgs.wakehook;
76-
Restart = "always";
77-
};
78-
};
79-
8070
systemd.user.services.steamos-manager = {
8171
overrideStrategy = "asDropin";
8272
wantedBy = [ "gamescope-session.service" ];

modules/steamos/cec.nix

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
{
2+
config,
3+
lib,
4+
pkgs,
5+
...
6+
}:
7+
8+
let
9+
inherit (lib)
10+
mkIf
11+
mkOption
12+
types
13+
;
14+
cfg = config.jovian.steamos;
15+
in
16+
{
17+
options = {
18+
jovian.steamos = {
19+
enableHdmiCecIntegration = mkOption {
20+
default = cfg.useSteamOSConfig;
21+
defaultText = lib.literalExpression "config.jovian.steamos.useSteamOSConfig";
22+
type = types.bool;
23+
description = ''
24+
Whether to enable SteamOS HDMI-CEC integration.
25+
'';
26+
};
27+
};
28+
};
29+
30+
config = mkIf cfg.enableHdmiCecIntegration {
31+
environment.systemPackages = [ pkgs.cecd ];
32+
services.dbus.packages = [ pkgs.cecd ];
33+
services.udev.packages = [
34+
pkgs.cecd
35+
pkgs.inputattach-cec-units
36+
];
37+
systemd.packages = [
38+
pkgs.cecd
39+
pkgs.inputattach-cec-units
40+
];
41+
42+
systemd.user.services.cecd = {
43+
overrideStrategy = "asDropin";
44+
wantedBy = [ "graphical-session.target" ];
45+
wants = [ "steamos-manager-configure-cecd.service" ];
46+
after = [ "steamos-manager-configure-cecd.service" ];
47+
};
48+
};
49+
}

modules/steamos/default.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ in
1111
./automount.nix
1212
./bluetooth.nix
1313
./boot.nix
14+
./cec.nix
1415
./earlyoom.nix
1516
./misc.nix
1617
./sysctl.nix

overlay.nix

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ rec {
5151
jupiter-fan-control = final.callPackage ./pkgs/jupiter-fan-control { };
5252
powerbuttond = final.callPackage ./pkgs/powerbuttond { };
5353
steam_notif_daemon = final.callPackage ./pkgs/steam_notif_daemon { };
54-
wakehook = final.callPackage ./pkgs/wakehook { };
5554

5655
jupiter-hw-support = final.callPackage ./pkgs/jupiter-hw-support { };
5756
steamdeck-hw-theme = final.callPackage ./pkgs/jupiter-hw-support/theme.nix { };
@@ -100,6 +99,9 @@ rec {
10099
steam = prev.steam;
101100
};
102101

102+
cecd = final.callPackage ./pkgs/cecd { };
103+
inputattach-cec-units = final.callPackage ./pkgs/inputattach-cec-units { };
104+
103105
sdgyrodsu = final.callPackage ./pkgs/sdgyrodsu { };
104106

105107
decky-loader = final.callPackage ./pkgs/decky-loader { };

pkgs/cecd/default.nix

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
{
2+
lib,
3+
rustPlatform,
4+
fetchFromGitLab,
5+
replaceVars,
6+
coreutils,
7+
pkg-config,
8+
udev,
9+
}:
10+
11+
rustPlatform.buildRustPackage (finalAttrs: {
12+
pname = "cecd";
13+
version = "0.1.0";
14+
15+
src = fetchFromGitLab {
16+
domain = "gitlab.steamos.cloud";
17+
owner = "holo";
18+
repo = "linux-cec";
19+
# tag = "cecd-${finalAttrs.version}";
20+
# Use the very next commit for now, to include the dbus config
21+
rev = "d3aceb76811896c63a0f739d3059f4a426cf626d";
22+
hash = "sha256-oPOCQwFSCkDEcd4MUz1gkX3n+M2R30YTEWW0o2thTds=";
23+
};
24+
25+
cargoHash = "sha256-T3TSfinqm4ml5ncACFxmm5Bylnf09v/bWfIdtwe+bQw=";
26+
27+
# tests assume FHS paths
28+
doCheck = false;
29+
30+
patches = [
31+
(replaceVars ./hardcode-paths.patch {
32+
coreutils = coreutils;
33+
out = null;
34+
})
35+
];
36+
37+
postPatch = ''
38+
substituteInPlace \
39+
cecd/src/config.rs \
40+
cecd/data/cecd.service \
41+
--replace-warn "@out@" "$out"
42+
'';
43+
44+
strictDeps = true;
45+
46+
nativeBuildInputs = [
47+
pkg-config
48+
];
49+
50+
buildInputs = [
51+
udev
52+
];
53+
54+
postInstall = ''
55+
# copied from vendor makefile, mostly
56+
install -d -m 755 $out/lib/udev/rules.d
57+
install -d -m 755 $out/share/systemd/user
58+
install -d -m 755 $out/share/dbus-1/services
59+
60+
install -m 644 linux-cec/data/udev-rules.d/60-cec-uaccess.rules $out/lib/udev/rules.d
61+
install -m 644 cecd/data/udev-rules.d/60-cecd-uinput.rules $out/lib/udev/rules.d
62+
install -m 644 cecd/data/cecd.service $out/share/systemd/user
63+
install -m 644 cecd/data/com.steampowered.CecDaemon1.service $out/share/dbus-1/services
64+
'';
65+
66+
meta = {
67+
description = "SteamOS HDMI-CEC daemon";
68+
license = lib.licenses.gpl2;
69+
mainProgram = "cecd";
70+
};
71+
})

pkgs/cecd/hardcode-paths.patch

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
diff --git a/cecd/data/cecd.service b/cecd/data/cecd.service
2+
index 8953d3a..c518bbf 100644
3+
--- a/cecd/data/cecd.service
4+
+++ b/cecd/data/cecd.service
5+
@@ -5,7 +5,7 @@ Description=Consumer Electronics Control (CEC) Daemon
6+
Type=notify-reload
7+
BusName=com.steampowered.CecDaemon1
8+
Environment=RUST_LOG=info
9+
-ExecStart=/usr/bin/cecd -e
10+
+ExecStart=@out@/bin/cecd -e
11+
12+
[Install]
13+
WantedBy=graphical-session.target
14+
diff --git a/cecd/data/com.steampowered.CecDaemon1.service b/cecd/data/com.steampowered.CecDaemon1.service
15+
index fd823f1..9e1251b 100644
16+
--- a/cecd/data/com.steampowered.CecDaemon1.service
17+
+++ b/cecd/data/com.steampowered.CecDaemon1.service
18+
@@ -1,4 +1,4 @@
19+
[D-BUS Service]
20+
Name=com.steampowered.CecDaemon1
21+
-Exec=/bin/false
22+
+Exec=@coreutils@/bin/false
23+
SystemdService=cecd.service
24+
diff --git a/cecd/src/config.rs b/cecd/src/config.rs
25+
index 84d3924..237bd92 100644
26+
--- a/cecd/src/config.rs
27+
+++ b/cecd/src/config.rs
28+
@@ -165,7 +165,7 @@ async fn read_config_directory<P: AsRef<Path> + Sync + Send>(
29+
30+
pub(crate) async fn read_default_config() -> Result<Config> {
31+
let mut builder = ConfigBuilder::<AsyncState>::default();
32+
- let system_config_path = PathBuf::from("/usr/share/cecd");
33+
+ let system_config_path = PathBuf::from("@out@/share/cecd");
34+
let etc_config_path = PathBuf::from("/etc/cecd");
35+
let mut config_paths = vec![system_config_path, etc_config_path];
36+
if let Some(home) = BaseDirectories::new().get_config_home() {
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
stdenv,
3+
fetchFromGitLab,
4+
linuxConsoleTools,
5+
}:
6+
stdenv.mkDerivation (finalAttrs: {
7+
pname = "inputattach-cec-units";
8+
version = "1";
9+
10+
src = fetchFromGitLab {
11+
domain = "gitlab.steamos.cloud";
12+
owner = "holo";
13+
repo = "inputattach-cec-units";
14+
tag = "v${finalAttrs.version}";
15+
hash = "sha256-dLz+wZCqNP23Jg8cJH622SqlE7nb7tMkC+icYRHil8U=";
16+
};
17+
18+
postPatch = ''
19+
substituteInPlace *.service \
20+
--replace-fail /usr/bin/inputattach ${linuxConsoleTools}/bin/inputattach
21+
'';
22+
23+
dontBuild = true;
24+
25+
installPhase = ''
26+
runHook preInstall
27+
28+
install -d -m 755 $out/lib/udev/rules.d
29+
install -d -m 755 $out/lib/systemd/system
30+
31+
install -m 644 60-inputattach-cec.rules $out/lib/udev/rules.d
32+
install -m 644 *.service $out/lib/systemd/system
33+
34+
runHook postInstall
35+
'';
36+
})

pkgs/steamos-manager/default.nix

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,17 @@
2222
}:
2323
rustPlatform.buildRustPackage rec {
2424
pname = "steamos-manager";
25-
version = "25.12.0";
25+
version = "26.0.1";
2626

2727
src = fetchFromGitLab {
2828
domain = "gitlab.steamos.cloud";
2929
owner = "holo";
3030
repo = "steamos-manager";
3131
rev = "v${version}";
32-
hash = "sha256-6BNuIyqCZfAaHokfltoS65SwIY4boVUUltZCe9J++iY=";
32+
hash = "sha256-TdiKY9dCxgurkjh9vAVvwmBlAswMLvVb29Uy/KVYhjU=";
3333
};
3434

35-
cargoHash = "sha256-Nazojb3mP2rP5ybvwVsElaAATfZfeX3nUx+LVwQEuoc=";
35+
cargoHash = "sha256-45X3ixQ200LVfSDhMcBzqjQsebydw76nGeqn7c7/rDY=";
3636

3737
# tests assume Steam Deck hardware and FHS paths
3838
doCheck = false;
@@ -53,7 +53,6 @@ rustPlatform.buildRustPackage rec {
5353
dmidecode = dmidecode;
5454
out = null;
5555
})
56-
./search-xdg-dirs.patch
5756
# FIXME: build steamos-log-submitter and reenable this maybe?
5857
./disable-ftrace.patch
5958
];
@@ -107,6 +106,7 @@ rustPlatform.buildRustPackage rec {
107106
install -m644 "data/user/com.steampowered.SteamOSManager1.service" "$out/share/dbus-1/services/"
108107
install -m644 "data/user/steamos-manager.service" "$out/lib/systemd/user/"
109108
install -m644 "data/user/steamos-manager-session-cleanup.service" "$out/lib/systemd/user/"
109+
install -m644 "data/user/steamos-manager-configure-cecd.service" "$out/lib/systemd/user/"
110110
'';
111111

112112
postFixup = ''

0 commit comments

Comments
 (0)