Skip to content

Commit ce1c6b1

Browse files
committed
modules: create an option to enable the overlay
This way, nothing changes in the configuration if you add the module to it and do nothing else
1 parent e26d456 commit ce1c6b1

File tree

13 files changed

+79
-17
lines changed

13 files changed

+79
-17
lines changed

modules/decky-loader.nix

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
let
44
inherit (lib)
5+
mkForce
56
mkIf
67
mkOption
78
types
@@ -86,6 +87,8 @@ in
8687
# run plugins. Running as non-root is unsupported and currently breaks:
8788
#
8889
# <https://github.com/SteamDeckHomebrew/decky-loader/issues/446#issuecomment-1637177368>
90+
jovian.overlay.enable = mkForce true;
91+
8992
systemd.services.decky-loader = {
9093
description = "Steam Deck Plugin Loader";
9194

modules/devices/steamdeck/fan-control.nix

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
let
66
inherit (lib)
7+
mkForce
78
mkIf
89
mkOption
910
types
@@ -27,6 +28,8 @@ in
2728
};
2829

2930
config = mkIf (cfg.enableOsFanControl) {
31+
jovian.overlay.enable = mkForce true;
32+
3033
systemd.services.jupiter-fan-control = {
3134
wantedBy = [ "multi-user.target" ];
3235
path = [ pkgs.dmidecode ];

modules/devices/steamdeck/firmware.nix

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
let
66
inherit (lib)
7+
mkForce
78
mkIf
89
mkMerge
910
mkOption
@@ -35,18 +36,24 @@ in
3536

3637
config = mkMerge [
3738
(mkIf (cfg.enable) {
39+
jovian.overlay.enable = mkForce true;
40+
3841
hardware.firmware = [
3942
(lib.hiPrio pkgs.linux-firmware-jupiter)
4043
(lib.hiPrio pkgs.steamdeck-dsp)
4144
];
4245
})
4346
(mkIf (cfg.autoUpdate) {
47+
jovian.overlay.enable = mkForce true;
48+
4449
systemd.packages = [pkgs.steamdeck-firmware];
4550

4651
systemd.services.jupiter-biosupdate.wantedBy = ["multi-user.target"];
4752
systemd.services.jupiter-controller-update.wantedBy = ["multi-user.target"];
4853
})
4954
(mkIf (cfg.enableFwupdBiosUpdates) {
55+
jovian.overlay.enable = mkForce true;
56+
5057
services.fwupd.enable = true;
5158

5259
environment.etc."fwupd/remotes.d/steamdeck-bios.conf".text = ''

modules/devices/steamdeck/kernel.nix

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
let
44
inherit (lib)
55
mkDefault
6+
mkForce
67
mkIf
78
mkMerge
89
mkOption
@@ -26,6 +27,8 @@ in
2627
};
2728
config = mkIf (cfg.enableKernelPatches) (mkMerge [
2829
{
30+
jovian.overlay.enable = mkForce true;
31+
2932
boot.kernelPackages = mkDefault pkgs.linuxPackages_jovian;
3033
# see https://github.com/Jovian-Experiments/steamos-customizations-jupiter/blob/jupiter-20241107.1/misc/modules-load.d/hid-preload.conf
3134
boot.kernelModules = ["hid_nintendo" "hid_playstation"];

modules/devices/steamdeck/sdgyrodsu.nix

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
let
44
inherit (lib)
5+
mkForce
56
mkIf
67
mkOption
78
types
@@ -24,6 +25,8 @@ in
2425
};
2526
};
2627
config = mkIf cfg.enableGyroDsuService {
28+
jovian.overlay.enable = mkForce true;
29+
2730
systemd.user.services.sdgyrodsu = {
2831
description = "Cemuhook DSU server for the Steam Deck Gyroscope";
2932
wantedBy = [ "graphical-session.target" ];

modules/devices/steamdeck/sound.nix

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ let
88
99
# override acp5x configs with Jovian stuff
1010
cp -rf ${pkgs.steamdeck-dsp}/share/alsa $out/share
11-
11+
1212
# remove more specific upstream symlink so Valve acp5x config is picked
1313
rm $out/share/alsa/ucm2/conf.d/acp5x/Valve-Jupiter-1.conf
1414
'';
@@ -32,6 +32,8 @@ in
3232

3333
extraEnv.ALSA_CONFIG_UCM2 = "${alsa-ucm-conf'}/share/alsa/ucm2";
3434
in lib.mkIf cfg.enableSoundSupport {
35+
jovian.overlay.enable = lib.mkForce true;
36+
3537
services.pulseaudio.enable = false;
3638

3739
services.pipewire = {

modules/jovian/overlay.nix

Lines changed: 36 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,39 @@
1-
{ lib, ... }:
2-
1+
{ config, lib, ... }:
2+
let
3+
inherit (lib)
4+
mkIf
5+
mkOption
6+
types
7+
;
8+
cfg = config.jovian.overlay;
9+
in
310
{
4-
nixpkgs.overlays = [
5-
(import ../../overlay.nix)
6-
];
11+
options = {
12+
jovian.overlay = {
13+
enable = mkOption {
14+
type = types.bool;
15+
default = config.jovian.steam.enable;
16+
defaultText = "config.jovian.steam.enable";
17+
description = ''
18+
Whether to enable the provided overlay over Nixpkgs.
19+
'';
20+
};
21+
};
22+
};
23+
24+
config = mkIf cfg.enable {
25+
nixpkgs.overlays = [
26+
(import ../../overlay.nix)
27+
];
728

8-
assertions = [
9-
{
10-
# Can't use 23.11 here because git versions are tracked as 23.11pre,
11-
# which is considered to be < 23.11.
12-
assertion = lib.versionAtLeast lib.version "23.10";
13-
message = "Jovian NixOS is only validated with the nixos-unstable branch of Nixpkgs. Please upgrade your Nixpkgs version.";
14-
}
15-
];
29+
assertions = [
30+
{
31+
# Can't use 23.11 here because git versions are tracked as 23.11pre,
32+
# which is considered to be < 23.11.
33+
assertion = lib.versionAtLeast lib.version "23.10";
34+
message = "Jovian NixOS is only validated with the nixos-unstable branch of Nixpkgs. Please upgrade your Nixpkgs version.";
35+
}
36+
];
37+
};
1638
}
39+

modules/steam/autostart.nix

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
let
44
inherit (lib)
55
mkDefault
6+
mkForce
67
mkIf
78
mkMerge
89
mkOption
@@ -32,7 +33,7 @@ in
3233
};
3334

3435
desktopSession = mkOption {
35-
type = with types ; nullOr str // {
36+
type = with types ; nullOr str // {
3637
check = userProvidedDesktopSession:
3738
lib.assertMsg (userProvidedDesktopSession != null -> (str.check userProvidedDesktopSession && lib.elem userProvidedDesktopSession config.services.displayManager.sessionData.sessionNames)) ''
3839
Desktop session '${userProvidedDesktopSession}' not found.
@@ -76,6 +77,8 @@ in
7677
to keep this behavior.
7778
'';
7879

80+
jovian.overlay.enable = mkForce true;
81+
7982
services.displayManager.enable = true;
8083

8184
systemd.user.services.gamescope-session = {

modules/steam/environment.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{ config, lib, pkgs, ... }:
1+
{ config, lib, ... }:
22

33
let
44
inherit (lib)

modules/steam/steam.nix

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
let
44
inherit (lib)
55
mkDefault
6+
mkForce
67
mkIf
78
mkMerge
89
;
@@ -17,6 +18,8 @@ in
1718
"The Steam Deck UI integrates with NetworkManager (networking.networkmanager.enable) which is not enabled. NetworkManager is required to complete the first-time setup process.";
1819
}
1920
{
21+
jovian.overlay.enable = mkForce true;
22+
2023
security.wrappers.gamescope = {
2124
owner = "root";
2225
group = "root";
@@ -32,6 +35,8 @@ in
3235
};
3336
}
3437
{
38+
jovian.overlay.enable = mkForce true;
39+
3540
# Enable the usual desktop Steam stuff
3641
programs.steam.enable = mkDefault true;
3742

0 commit comments

Comments
 (0)