Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/HEAD' into wrap-steam-override-args
Browse files Browse the repository at this point in the history
  • Loading branch information
Faupi committed Jan 29, 2025
2 parents 1f3f555 + 2dd65c3 commit fe8c70b
Show file tree
Hide file tree
Showing 26 changed files with 219 additions and 154 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ Pointers to helpful pages

- The [Getting Started](docs/getting-started.md) page may be your first stop.
- The [Configuration](docs/configuration.md) page guides you into configuring your system.
- The [Options](docs/options.md) is good to know all that you can do.

<div class="for-github -unneeded">
<hr />
Expand Down
8 changes: 3 additions & 5 deletions docs/FAQ.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
FAQ
===

> **Jovian**
> **Jovian**
> “Relating to [...] Jupiter or the class of [...] which Jupiter belongs.”
> What's Jupiter?
### What's Jupiter?

[There's a disambiguation page that won't help you](https://en.wikipedia.org/wiki/Jupiter_(disambiguation)).
It's not known *exactly* what it's the codename for.
It is either the codename for the Steam Deck, or the codename for the new Steam OS for the Steam Deck.
Things get awfully murky with *Neptune* also being a thing, and it's unclear from the outside what it is.
To the best of our knowledge, Jupiter is the OS.

* * *

> What channels are supported?
### What channels are supported?

Truthfully, no channel is *supported*, but the older the stable release was cut, the more likely the additions from Jovian NixOS won't work as expected.

Expand Down
20 changes: 13 additions & 7 deletions docs/configuration.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
Configuration
=============

All available module options along with their descriptions can be found under `modules`.
The options are also listed on the [options page in the documentation](https://jovian-experiments.github.io/Jovian-NixOS/options.html).

### Using the Steam Deck UI
## Using the Steam Deck UI

To use the Steam Deck UI, set `jovian.steam.enable = true;` in your configuration.

Expand All @@ -13,7 +10,7 @@ This will only enable the Steam Deck UI tooling.

The Steam Deck UI can be used in different manners.

#### Autostart
### Autostart

(*This is the preferred way to use the Steam Deck interface*)

Expand All @@ -28,14 +25,14 @@ If you want the *Switch to Desktop* menu option to switch to another session, yo
Configure it with the name of the X11 or Wayland session of your choosing.
The session name semantics are the same as for the `services.displayManager.defaultSession` NixOS option.

#### As a user session
### As a user session

Select the *Gaming Mode* sesssion in your Display Manager, or run `start-gamescope-session` in a VT.

The *Switch to Desktop* option will not work as intended, instead it will close Steam.


#### As a *nested* window
### As a *nested* window

Run `gamescope-session` within an existing desktop session.

Expand All @@ -44,3 +41,12 @@ This will run [gamescope](https://github.com/ValveSoftware/gamescope) in nested
Usage as a *nested* window is less tested, and may have other undesirable idiosyncrasies.

The *Switch to Desktop* option will not work as intended, instead it will close Steam.


## Going further

This is a NixOS system, you can do much more.
[All the usual NixOS options are available](https://search.nixos.org/options?channel=unstable).

In addition to that, all the Jovian NixOS options, including internal implementation details,
are listed on the [options page in the documentation](https://jovian-experiments.github.io/Jovian-NixOS/options.html).
2 changes: 1 addition & 1 deletion docs/devices/valve-steam-deck/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ Connect to the dock via USB-C and run `jupiter-dock-updater` to update.
Helpful Tips
------------

To enter the boot menu, power off the Steam Deck then hold down `Volume-` and tap the `Power` button.
To enter the boot menu, power off the Steam Deck then hold down `Volume Down` and tap the `Power` button.
2 changes: 2 additions & 0 deletions docs/in-depth.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ In-Depth
Learn more about:

- [Using Decky Loader](in-depth/decky-loader.md)
- [All the options](options.md)
- [All the packages](packages.md)
9 changes: 9 additions & 0 deletions docs/in-depth/decky-loader.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,12 @@ To enable *Decky Loader* in your configuration:
};
}
```


## It doesn't work

There is a known issue where Decky Loader relies on CEF debugging to work, but enabling/disabling it *correctly* is awkward.

See [the workaround in #460](https://github.com/Jovian-Experiments/Jovian-NixOS/issues/460#issuecomment-2599835660).

Make sure you also enable CEF debugging imperatively.
8 changes: 7 additions & 1 deletion docs/options.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,15 @@

Jovian-NixOS adds a set of extra options that can be used in your NixOS configurations under the `jovian` prefix.

Most of these options are implementation details, and likely are not needed to be changed.

See the [Getting Started](docs/getting-started.md) page and the [Configuration](docs/configuration.md) page for the options that matter.

* * *

<div class="for-github -unneeded">

> [!NOTE]
> The options listing is available on the website.
> [The options listing is available on the website.](https://jovian-experiments.github.io/Jovian-NixOS/options.html)
</div>
10 changes: 8 additions & 2 deletions docs/packages.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
# Packages

Jovian-NixOS adds a set of extra packages that can be used in your NixOS configurations.
Jovian-NixOS provides an overlay with a set of extra packages.

Most of these packages are used implicitly from the Jovian NixOS configuration, and are an implementation detail.

See the [Getting Started](docs/getting-started.md) page and the [Configuration](docs/configuration.md) page for the options that will end-up using or enabling them.

* * *

<div class="for-github -unneeded">

> [!NOTE]
> The options listing is available on the website only.
> [The packages listing is available on the website only.](https://jovian-experiments.github.io/Jovian-NixOS/packages.html)
</div>
6 changes: 3 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion modules/devices/steamdeck/sound.nix
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ in

extraEnv.ALSA_CONFIG_UCM2 = "${alsa-ucm-conf'}/share/alsa/ucm2";
in lib.mkIf cfg.enableSoundSupport {
hardware.pulseaudio.enable = false;
services.pulseaudio.enable = false;

services.pipewire = {
enable = true;
Expand Down
19 changes: 5 additions & 14 deletions modules/steam/autostart.nix
Original file line number Diff line number Diff line change
Expand Up @@ -134,21 +134,12 @@ in
'';
};

environment = {
systemPackages = [ pkgs.jovian-greeter.helper ];
pathsToLink = [ "lib/jovian-greeter" ];
security.wrappers.jovian-consume-session = {
source = "${pkgs.jovian-greeter.helper}/bin/consume-session";
owner = cfg.user;
group = "users";
setuid = true;
};
security.polkit.extraConfig = ''
polkit.addRule(function(action, subject) {
if (
action.id == "org.freedesktop.policykit.exec" &&
action.lookup("program") == "/run/current-system/sw/lib/jovian-greeter/consume-session" &&
subject.user == "jovian-greeter"
) {
return polkit.Result.YES;
}
});
'';

xdg.portal.configPackages = mkDefault [ pkgs.gamescope-session ];
})
Expand Down
2 changes: 1 addition & 1 deletion modules/steam/steam.nix
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ in
extraPackages32 = [ pkgs.pkgsi686Linux.gamescope-wsi ];
};

hardware.pulseaudio.support32Bit = true;
services.pulseaudio.support32Bit = true;
hardware.steam-hardware.enable = mkDefault true;

environment.systemPackages = [ pkgs.gamescope-session pkgs.steamos-polkit-helpers pkgs.steamos-manager ];
Expand Down
6 changes: 3 additions & 3 deletions pkgs/decky-loader/default.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{ lib
, fetchFromGitHub
, nodejs
, pnpm
, pnpm_9
, python3
, coreutils
, psmisc
Expand All @@ -17,7 +17,7 @@ python3.pkgs.buildPythonPackage rec {
hash = "sha256-PViSR4q3ZLo0pnrbqzWSOHgYy2QlkKKLWtQcflBIkdU=";
};

pnpmDeps = pnpm.fetchDeps {
pnpmDeps = pnpm_9.fetchDeps {
inherit pname version src;
sourceRoot = "${src.name}/frontend";
hash = "sha256-26p0RoMfuZRVgTnYWdWK2qJwEJXeGWsBkVhp5TQyfGw=";
Expand All @@ -29,7 +29,7 @@ python3.pkgs.buildPythonPackage rec {

nativeBuildInputs = [
nodejs
pnpm.configHook
pnpm_9.configHook
];

preBuild = ''
Expand Down
26 changes: 0 additions & 26 deletions pkgs/jovian-greeter/consume-session

This file was deleted.

46 changes: 46 additions & 0 deletions pkgs/jovian-greeter/consume-session/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions pkgs/jovian-greeter/consume-session/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[package]
name = "consume-session"
version = "0.1.0"
edition = "2021"

[dependencies]
nix = { version = "*", features = ["user"] }
23 changes: 23 additions & 0 deletions pkgs/jovian-greeter/consume-session/src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
use nix::unistd::{Uid, User};
use std::{fs, io};

fn main() {
let uid = Uid::effective();
let user = User::from_uid(uid)
.expect("Unable to get current user info")
.expect("Current user does not exist");
let mut path = user.dir;
path.push(".local/state/steamos-session-select");

let session = fs::read_to_string(&path);
match session {
Ok(s) => {
print!("{}", s);
fs::remove_file(&path).expect("Failed to remove session file");
},
Err(e) => match e.kind() {
io::ErrorKind::NotFound => {}
_ => eprintln!("Error when reading session file: {:?}", e),
},
}
}
19 changes: 13 additions & 6 deletions pkgs/jovian-greeter/default.nix
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
{ lib, stdenv, python3, plymouth, shellcheck, nodePackages }:
{ lib, stdenv, python3, plymouth, shellcheck, nodePackages, rustPlatform }:

stdenv.mkDerivation {
name = "jovian-greeter";

outputs = [ "out" "helper" ];

src = ./.;

nativeBuildInputs = [ python3.pkgs.wrapPython ];
Expand All @@ -19,7 +17,6 @@ stdenv.mkDerivation {
checkPhase = ''
runHook preCheck
shellcheck ./consume-session
pyright *.py
runHook postCheck
Expand All @@ -31,8 +28,18 @@ stdenv.mkDerivation {
install -Dm555 greeter.py $out/bin/jovian-greeter
wrapPythonPrograms --prefix PATH : ${lib.makeBinPath [ plymouth ]}
install -Dm555 ./consume-session $helper/lib/jovian-greeter/consume-session
runHook postInstall
'';

passthru.helper = rustPlatform.buildRustPackage {
pname = "jovian-consume-session";
version = "0.0.1";

src = ./consume-session;

cargoLock.lockFile = ./consume-session/Cargo.lock;

# avoid a second rebuild
doCheck = false;
};
}
Loading

0 comments on commit fe8c70b

Please sign in to comment.