### List of Package Example Source: https://github.com/jovian-experiments/jovian-nixos/blob/development/_autodocs/types.md Example of defining an option that accepts a list of Nix packages. ```nix jovian.decky-loader.extraPackages = [ pkgs.curl pkgs.unzip ] ``` -------------------------------- ### NixOS Service Dependencies Example Source: https://github.com/jovian-experiments/jovian-nixos/blob/development/_autodocs/integration.md Example of configuring service dependencies in NixOS, ensuring services start in the correct order. This snippet shows 'gamescope-session' depending on 'inputplumber.service'. ```nix systemd.services.gamescope-session = { wantedBy = [ "multi-user.target" ]; after = [ "inputplumber.service" ]; }; ``` -------------------------------- ### Function to List of Packages Example Source: https://github.com/jovian-experiments/jovian-nixos/blob/development/_autodocs/types.md Example of a function that accepts a Python package set and returns a list of packages. ```nix jovian.decky-loader.extraPythonPackages = pythonPackages: with pythonPackages; [ hid ] ``` -------------------------------- ### Attribute Set of String Example Source: https://github.com/jovian-experiments/jovian-nixos/blob/development/_autodocs/types.md Example of defining an option that accepts an attribute set of strings for environment variables. ```nix jovian.steam.environment = { VAR1 = "value1"; VAR2 = "value2"; } ``` -------------------------------- ### Start Gamescope Session Source: https://github.com/jovian-experiments/jovian-nixos/blob/development/docs/configuration.md Alternative method to start the Steam Deck UI by running this command in a VT. Note that the "Switch to Desktop" option will close Steam when used this way. ```bash start-gamescope-session ``` -------------------------------- ### Type Composition Examples Source: https://github.com/jovian-experiments/jovian-nixos/blob/development/_autodocs/types.md Provides examples of composing NixOS types to create more complex type signatures. This includes creating lists of attribute sets, nullable functions, and unions of types. ```nix # List of attribute sets of strings type = types.listOf (types.attrsOf types.str); # Nullable function returning list type = types.nullOr (types.functionTo (types.listOf types.str)); # Enum or string type = types.enum [ "a" "b" ] // types.str; ``` -------------------------------- ### Apply Security Capabilities to Gamescope Wrapper Source: https://github.com/jovian-experiments/jovian-nixos/blob/development/_autodocs/integration.md Demonstrates how to use security.wrappers to apply specific capabilities, like cap_sys_nice, to an executable, using Gamescope as an example. ```nix security.wrappers.gamescope = { owner = "root"; source = "${pkgs.gamescope}/bin/gamescope"; capabilities = "cap_sys_nice+pie"; }; ``` -------------------------------- ### Nullable String Type Example Source: https://github.com/jovian-experiments/jovian-nixos/blob/development/_autodocs/types.md Example of a nullable string type for `jovian.steam.desktopSession`, allowing `null` or a string. ```nix jovian.steam.desktopSession = types.nullOr types.str; ``` -------------------------------- ### Autostart Steam Deck UI Source: https://github.com/jovian-experiments/jovian-nixos/blob/development/docs/configuration.md Set this option to true to automatically start the Steam Deck UI at boot. This also enables the "Switch to Desktop" option. ```nix jovian.steam.autoStart = true; ``` -------------------------------- ### Path Type Usage Source: https://github.com/jovian-experiments/jovian-nixos/blob/development/_autodocs/types.md Use `types.path` for filesystem paths. Example shows setting a state directory. ```nix jovian.decky-loader.stateDir = "/var/lib/decky-loader" ``` -------------------------------- ### Force Kernel Parameters Source: https://github.com/jovian-experiments/jovian-nixos/blob/development/_autodocs/integration.md Illustrates that options set with mkForce cannot be overridden, using kernel parameters as an example. ```nix # These cannot be changed after being set: boot.kernelParams = mkForce [ "custom=param" ]; ``` -------------------------------- ### String to Path Coercion Example Source: https://github.com/jovian-experiments/jovian-nixos/blob/development/_autodocs/types.md Demonstrates that a string literal can be coerced into a path type. ```nix # Both are equivalent: stateDir = "/var/lib/decky-loader"; stateDir = /var/lib/decky-loader; ``` -------------------------------- ### Set Desktop Session Source: https://github.com/jovian-experiments/jovian-nixos/blob/development/_autodocs/api-reference/steam.md Define the session to launch for Desktop Mode. Set to `"gamescope-wayland"` to return to Gaming Mode. Ensure the specified session is installed. ```nix jovian.steam.desktopSession = "plasma"; ``` ```nix jovian.steam.desktopSession = "gamescope-wayland"; ``` -------------------------------- ### Enable Decky Loader Source: https://github.com/jovian-experiments/jovian-nixos/blob/development/docs/in-depth/decky-loader.md Add this configuration to your NixOS setup to enable Decky Loader. ```nix { config, pkgs, ... }: { jovian.decky-loader = { enable = true; }; } ``` -------------------------------- ### String Type Usage Source: https://github.com/jovian-experiments/jovian-nixos/blob/development/_autodocs/types.md Use `types.str` for string options. Examples show setting user and desktop session names. ```nix jovian.steam.user = "deck" ``` -------------------------------- ### Configure Steam Deck UI Source: https://github.com/jovian-experiments/jovian-nixos/blob/development/_autodocs/configuration.md Enable and configure the Steam Deck UI (Gamescope session). This example enables the UI, sets it to auto-start, specifies the user and desktop session, and defines custom environment variables for the Gamescope session. ```nix jovian.steam = { enable = true; autoStart = true; user = "deck"; desktopSession = "plasma"; environment = { STEAM_COMPAT_TOOL_PATHS = "/home/deck/.steam/compatibilitytools.d"; }; }; ``` -------------------------------- ### Zram Swap Configuration Example Source: https://github.com/jovian-experiments/jovian-nixos/blob/development/_autodocs/api-reference/steamos.md Configures compressed in-memory swap using zram. This snippet sets zram to be enabled, with a higher priority than disk swap, using 50% of system RAM, and the zstd compression algorithm. ```nix zramSwap = { enable = true; priority = 100; memoryPercent = 50; algorithm = "zstd"; }; ``` -------------------------------- ### Enable All SteamOS Configuration Source: https://github.com/jovian-experiments/jovian-nixos/blob/development/_autodocs/api-reference/steamos.md This is the recommended approach to enable all SteamOS-related configurations provided by the Jovian module. It simplifies setup by activating multiple optimizations at once. ```nix jovian.steamos.useSteamOSConfig = true; ``` -------------------------------- ### Enum Type Example Source: https://github.com/jovian-experiments/jovian-nixos/blob/development/_autodocs/types.md Example of an enum type for the steam updater splash screen, with valid values listed. ```nix jovian.steam.updater.splash = types.enum [ "steamos" "jovian" "bgrt" "vendor" ]; ``` -------------------------------- ### Package Type Usage Source: https://github.com/jovian-experiments/jovian-nixos/blob/development/_autodocs/types.md Use `types.package` for Nix package derivations. Example shows assigning a package. ```nix jovian.decky-loader.package = pkgs.decky-loader ``` -------------------------------- ### Set Custom Environment Variables for Steam Source: https://github.com/jovian-experiments/jovian-nixos/blob/development/_autodocs/api-reference/steam.md Apply custom environment variables before the Steam session starts. Variables are written to `/etc/xdg/gamescope-session/environment` at build time. ```nix jovian.steam.environment.MYVAR = "value"; ``` -------------------------------- ### Auto-Launch Gaming Mode Source: https://github.com/jovian-experiments/jovian-nixos/blob/development/_autodocs/api-reference/steam.md Automatically boots into Gaming Mode as the 'deck' user with Plasma Wayland as the desktop alternative. Ensures Steam starts on system boot. ```nix jovian.steam = { enable = true; autoStart = true; user = "deck"; desktopSession = "plasmawayland"; }; ``` -------------------------------- ### Auto-Launch Gaming Mode Source: https://github.com/jovian-experiments/jovian-nixos/blob/development/_autodocs/README.md Configures Steam to automatically start in gaming mode with a specified user and desktop session. Requires Jovian NixOS modules to be imported. ```nix { imports = [ ]; jovian.devices.steamdeck.enable = true; jovian.steam = { enable = true; autoStart = true; user = "deck"; desktopSession = "plasmawayland"; }; } ``` -------------------------------- ### Implicit List Coercion Example Source: https://github.com/jovian-experiments/jovian-nixos/blob/development/_autodocs/types.md Shows that a single value might be implicitly coerced into a list in certain contexts. ```nix # Might be coerced to: kernelModules = "hid_nintendo"; # -> [ "hid_nintendo" ] ``` -------------------------------- ### Usage in Nix Flake with Flake Input Source: https://github.com/jovian-experiments/jovian-nixos/blob/development/_autodocs/api-reference/module-overview.md Example of using Jovian NixOS within a Nix flake by referencing its flake input. ```nix { inputs.jovian.url = "github:Jovian-Experiments/Jovian-NixOS"; outputs = { self, jovian, ... }: { nixosConfigurations.myhost = { modules = [ jovian.nixosModules.default ]; }; }; } ``` -------------------------------- ### Add Python 3 to Extra Packages for External Commands Source: https://github.com/jovian-experiments/jovian-nixos/blob/development/_autodocs/api-reference/decky-loader.md Example of adding the python3 package to `extraPackages` to ensure plugins can access external Python commands. ```nix jovian.decky-loader.extraPackages = [ pkgs.python3 ]; ``` -------------------------------- ### Configure Udev Rule for Uinput Device Source: https://github.com/jovian-experiments/jovian-nixos/blob/development/_autodocs/integration.md Provides an example of a udev rule to grant access to the uinput device for unprivileged users in the 'users' group. ```udev KERNEL=="uinput", SUBSYSTEM=="misc", TAG+="uaccess" ``` -------------------------------- ### Jovian NixOS with Flake Input Source: https://github.com/jovian-experiments/jovian-nixos/blob/development/_autodocs/README.md Integrates Jovian NixOS using a flake input for managing dependencies. This example shows how to include the default NixOS modules from the Jovian flake. ```nix { inputs.jovian.url = "github:Jovian-Experiments/Jovian-NixOS"; outputs = { self, jovian, ... }: { nixosConfigurations.myhost = { modules = [ jovian.nixosModules.default # ... your config ]; }; }; } ``` -------------------------------- ### Custom Validation Example Source: https://github.com/jovian-experiments/jovian-nixos/blob/development/_autodocs/types.md Demonstrates custom validation using `lib.assertMsg` to ensure an option's value meets specific criteria beyond basic type checking. This is useful for enforcing complex business logic or constraints. ```nix assert lib.assertMsg (desktopSession == null || builtins.elem desktopSession sessionNames) "Desktop session must be a valid installed session"; ``` -------------------------------- ### Configure Steam Updater Splash Screen Source: https://github.com/jovian-experiments/jovian-nixos/blob/development/_autodocs/configuration.md Customize the splash screen used by the Steam updater. This example sets the splash screen to use the Jovian Experiments logo. ```nix jovian.steam.updater.splash = "jovian"; ``` -------------------------------- ### Union Type with Custom Validation Example Source: https://github.com/jovian-experiments/jovian-nixos/blob/development/_autodocs/types.md Example of a union type for `jovian.steam.desktopSession` that is nullable string or passes a custom check function. ```nix jovian.steam.desktopSession = with types; nullOr str // { check = session: session == null || builtins.elem session sessionNames; }; ``` -------------------------------- ### Troubleshooting Module Loading: Correct Module Path Source: https://github.com/jovian-experiments/jovian-nixos/blob/development/_autodocs/api-reference/module-overview.md Illustrates the correct way to import Jovian modules, emphasizing importing the directory rather than a specific file. ```nix # Correct: imports = [ "${jovian}/modules" ]; # Wrong: imports = [ "${jovian}/modules/steam" ]; # Points to a file, not a directory ``` -------------------------------- ### Configure AutoStart User Source: https://github.com/jovian-experiments/jovian-nixos/blob/development/_autodocs/api-reference/steam.md Specify the local system user for automatic Steam Deck UI login. This user must exist on the system. This setting is required when `autoStart` is enabled. ```nix jovian.steam.user = "deck"; ``` -------------------------------- ### Steam with Environment Customization Source: https://github.com/jovian-experiments/jovian-nixos/blob/development/_autodocs/api-reference/steam.md Enables Steam and auto-start, while setting custom environment variables for compatibility tools and VKD3D memory allocation. ```nix jovian.steam = { enable = true; autoStart = true; user = "deck"; environment = { STEAM_COMPAT_TOOL_PATHS = "/home/deck/.steam/compatibilitytools.d"; VKD3D_MEMORY_ALLOCATOR = "device"; }; }; ``` -------------------------------- ### Boolean Type Usage Source: https://github.com/jovian-experiments/jovian-nixos/blob/development/_autodocs/types.md Use `types.bool` for boolean options. Example shows enabling a feature. ```nix jovian.devices.steamdeck.enable = true ``` -------------------------------- ### Enable Early Modesetting with AMDGPU Firmware Source: https://github.com/jovian-experiments/jovian-nixos/blob/development/_autodocs/integration.md Shows how to enable early modesetting by including the amdgpu kernel module in the initrd and setting hardware.enableRedistributableFirmware. ```nix hardware.enableRedistributableFirmware = true; boot.initrd.kernelModules = [ "amdgpu" ]; ``` -------------------------------- ### Enable Steam Deck Hardware Configuration Source: https://github.com/jovian-experiments/jovian-nixos/blob/development/docs/devices/valve-steam-deck/index.md Import local modules and enable Steam Deck hardware configurations in your system settings. ```nix jovian.devices.steamdeck.enable = true; ``` -------------------------------- ### Type Validation Error Example Source: https://github.com/jovian-experiments/jovian-nixos/blob/development/_autodocs/types.md Illustrates the error message produced when a value does not match the declared option type. ```text error: The option `jovian.steam.autoStart` is not of type boolean. ``` -------------------------------- ### Auto-Start Gaming Mode Source: https://github.com/jovian-experiments/jovian-nixos/blob/development/docs/steam.md Configure the system to automatically launch Gaming Mode on boot. This also enables desktop switching to Plasma 6 and specifies the user and desktop session for Steam. ```nix { services.desktopManager.plasma6.enable = true; jovian.steam = { enable = true; autoStart = true; user = "yourname"; desktopSession = "plasma"; }; } ``` -------------------------------- ### Basic Steam Enablement Source: https://github.com/jovian-experiments/jovian-nixos/blob/development/_autodocs/api-reference/steam.md Enables Steam functionality. Requires launching via a display manager or the 'start-gamescope-session' command. ```nix jovian.steam = { enable = true; }; ``` -------------------------------- ### List of Type Declaration Source: https://github.com/jovian-experiments/jovian-nixos/blob/development/_autodocs/types.md Declares a list where all elements must be of a specified type `T`. Usage example shows a list of packages. ```nix listOf (T: type) -> type ``` -------------------------------- ### Configure Desktop Session for Switch to Desktop Source: https://github.com/jovian-experiments/jovian-nixos/blob/development/docs/configuration.md Configure the name of the X11 or Wayland session to switch to when using the "Switch to Desktop" option. The semantics are the same as for the `services.displayManager.defaultSession` NixOS option. ```nix jovian.steam.desktopSession = "your-session-name"; ``` -------------------------------- ### Verify Systemd Service Dependencies Source: https://github.com/jovian-experiments/jovian-nixos/blob/development/_autodocs/integration.md Checks the dependencies and validity of a systemd service. Helps diagnose services that are not starting correctly. ```bash systemd-analyze verify gamescope-session ``` -------------------------------- ### Importing Selective Jovian Modules Source: https://github.com/jovian-experiments/jovian-nixos/blob/development/_autodocs/api-reference/module-overview.md Demonstrates how to import specific Jovian modules, though this approach is generally not recommended due to potential dependency chain breakage. ```nix { imports = [ /path/to/jovian-nixos/modules/steam /path/to/jovian-nixos/modules/hardware # Don't import decky-loader ]; jovian.steam.enable = true; } ``` -------------------------------- ### Nullable Type Declaration Source: https://github.com/jovian-experiments/jovian-nixos/blob/development/_autodocs/types.md Declares a type that can be either of type `T` or `null`. Usage example shows a nullable string for desktop session. ```nix nullOr (T: type) -> type ``` -------------------------------- ### Enable Decky Loader with Extra Tools Source: https://github.com/jovian-experiments/jovian-nixos/blob/development/_autodocs/api-reference/decky-loader.md Enables Decky Loader and adds curl, unzip, and wget to the service's PATH. ```nix jovian.decky-loader = { enable = true; extraPackages = [ pkgs.curl pkgs.unzip pkgs.wget ]; }; ``` -------------------------------- ### Enable Early Modesetting for AMD GPUs Source: https://github.com/jovian-experiments/jovian-nixos/blob/development/_autodocs/api-reference/hardware.md Enables early kernel modesetting by loading the 'amdgpu' driver in the initrd. This provides a graphical boot experience. Requires redistributable firmware. ```nix boot.initrd.kernelModules = [ "amdgpu" ]; hardware.enableRedistributableFirmware = true; ``` -------------------------------- ### Check Steam Session Journal Logs Source: https://github.com/jovian-experiments/jovian-nixos/blob/development/_autodocs/api-reference/steam.md View the last 50 lines of the gamescope-session journal to troubleshoot Steam startup issues. ```bash journalctl -u gamescope-session -n 50 ``` -------------------------------- ### Troubleshooting Module Loading: Correct Option Namespace Source: https://github.com/jovian-experiments/jovian-nixos/blob/development/_autodocs/api-reference/module-overview.md Shows the correct namespace for Jovian module options, highlighting the need for specific sub-namespaces like 'devices'. ```nix # Correct: jovian.devices.steamdeck.enable = true; # Wrong: jovian.steamdeck.enable = true; # Missing 'devices' namespace ``` -------------------------------- ### Enum Type Declaration Source: https://github.com/jovian-experiments/jovian-nixos/blob/development/_autodocs/types.md Declares an enum type, restricting values to a predefined list of strings. Usage example shows valid splash screen options. ```nix enum (values: list of strings) -> type ``` -------------------------------- ### NixOS Module Definition Pattern Source: https://github.com/jovian-experiments/jovian-nixos/blob/development/_autodocs/api-reference/module-overview.md Demonstrates the standard NixOS module system pattern used by Jovian modules, including option definition and conditional configuration. ```nix { config, lib, pkgs, ... }: let inherit (lib) mkIf mkMerge mkOption types ; cfg = config.jovian.module_name; in { options = { jovian.module_name = { enable = mkOption { type = types.bool; default = false; description = "..."; }; option2 = mkOption { type = types.str; default = "value"; description = "..."; }; }; }; config = mkIf cfg.enable { # Apply configuration when module is enabled }; } ``` -------------------------------- ### Enable Decky Loader Source: https://github.com/jovian-experiments/jovian-nixos/blob/development/_autodocs/api-reference/decky-loader.md Basic configuration to enable the Steam Deck Plugin Loader service. ```nix jovian.decky-loader.enable = true; ``` -------------------------------- ### Attribute Set of Type Declaration Source: https://github.com/jovian-experiments/jovian-nixos/blob/development/_autodocs/types.md Declares an attribute set (key-value map) where all values must be of a specified type `T`. Usage example shows an attribute set of strings. ```nix attrsOf (T: type) -> type ``` -------------------------------- ### Check SteamOS Manager Journal Logs Source: https://github.com/jovian-experiments/jovian-nixos/blob/development/_autodocs/api-reference/steam.md View the last 50 lines of the steamos-manager journal to troubleshoot Steam startup issues. ```bash journalctl -u steamos-manager -n 50 ``` -------------------------------- ### Usage in Nix Flake with Local Path Source: https://github.com/jovian-experiments/jovian-nixos/blob/development/_autodocs/api-reference/module-overview.md Shows how to integrate Jovian NixOS into a Nix flake using a local path reference. ```nix { inputs.jovian = { url = "path:./jovian-nixos"; flake = false; }; outputs = { self, jovian, ... }: { nixosConfigurations.myhost = { modules = [ "${jovian}/modules" ]; }; }; } ``` -------------------------------- ### Enable SteamOS Configuration Source: https://github.com/jovian-experiments/jovian-nixos/blob/development/_autodocs/configuration.md Enables a comprehensive set of SteamOS-like configurations for a more authentic SteamOS experience. This includes Bluetooth, auto-mount, HDMI-CEC, early OOM, default kernel command lines, product serial access, and zram. ```nix jovian.steamos = { useSteamOSConfig = true; enableBluetoothConfig = true; enableAutoMountUdevRules = true; enableHdmiCecIntegration = true; enableEarlyOOM = true; enableDefaultCmdlineConfig = true; enableProductSerialAccess = true; enableZram = true; }; ``` -------------------------------- ### Steam Deck with Auto-Start Gaming Mode Source: https://github.com/jovian-experiments/jovian-nixos/blob/development/_autodocs/configuration.md Configures Steam Deck with automatic startup of Steam in gaming mode. Specifies the user and desktop session for Steam. ```nix { jovian.devices.steamdeck.enable = true; jovian.steam = { enable = true; autoStart = true; user = "deck"; desktopSession = "plasmawayland"; }; jovian.steamos.useSteamOSConfig = true; } ``` -------------------------------- ### Set System-Wide Environment Variable Source: https://github.com/jovian-experiments/jovian-nixos/blob/development/_autodocs/integration.md Demonstrates how to set a system-wide environment variable using the environment.variables option. ```nix environment.variables = { STEAM_ALLOW_DRIVE_UNMOUNT = "1"; }; ``` -------------------------------- ### Enable Steam Deck with Decky Loader Source: https://github.com/jovian-experiments/jovian-nixos/blob/development/_autodocs/api-reference/module-overview.md Configure a Steam Deck with Decky Loader support, including extra Python packages for plugins. ```nix { imports = [ jovian.nixosModules.default ]; jovian.devices.steamdeck.enable = true; jovian.steam.enable = true; jovian.decky-loader = { enable = true; extraPythonPackages = pythonPackages: with pythonPackages; [ hid pyusb ]; }; } ``` -------------------------------- ### Importing Jovian NixOS Modules via Local Path Source: https://github.com/jovian-experiments/jovian-nixos/blob/development/_autodocs/api-reference/module-overview.md Demonstrates importing Jovian NixOS modules directly from a local path in your NixOS configuration. ```nix { imports = [ (import /path/to/jovian-nixos/modules) ]; jovian.devices.steamdeck.enable = true; } ``` -------------------------------- ### Enable Desktop Gaming PC Support Source: https://github.com/jovian-experiments/jovian-nixos/blob/development/_autodocs/api-reference/module-overview.md Configure a non-Deck AMD GPU system with Steam support. Ensures early modesetting for AMD GPUs and enables Steam. ```nix { imports = [ jovian.nixosModules.default ]; jovian.hardware.has.amd.gpu = true; jovian.hardware.amd.gpu.enableEarlyModesetting = true; jovian.steam.enable = true; jovian.steamos.useSteamOSConfig = true; } ``` -------------------------------- ### Minimal Server with Kernel Optimization Configuration Source: https://github.com/jovian-experiments/jovian-nixos/blob/development/_autodocs/README.md This minimal server configuration enables Jovian's SteamOS-related kernel optimizations, including default command line configuration, ZRAM, and early Out-Of-Memory (OOM) killer. ```nix { imports = [ jovian.nixosModules.default ]; jovian.steamos = { enableDefaultCmdlineConfig = true; enableZram = true; enableEarlyOOM = true; }; } ``` -------------------------------- ### Override Default Steam Deck Configuration Source: https://github.com/jovian-experiments/jovian-nixos/blob/development/_autodocs/integration.md Demonstrates how to enable Steam Deck devices and disable vendor drivers by overriding default mkDefault options. ```nix { imports = [ jovian.nixosModules.default ]; jovian.devices.steamdeck.enable = true; jovian.devices.steamdeck.enableVendorDrivers = false; # Override default } ``` -------------------------------- ### Initialize Pagefind UI Source: https://github.com/jovian-experiments/jovian-nixos/blob/development/support/docs/search.md Initializes the Pagefind UI component within a specified HTML element. Configure element, base URL, image display, and translations. ```javascript window.addEventListener('DOMContentLoaded', (event) => { pagefind = new PagefindUI({ element: "#search", baseUrl: document.baseURI.replace(/search.html/, ""), showImages: false, translations: { placeholder: "", }, }); // Workaround for the lack of an autofocus option. window.setTimeout(function () { document.querySelector(".pagefind-ui__search-input").focus(); }, 1); }); ``` -------------------------------- ### NixOS Conditional Module Loading Source: https://github.com/jovian-experiments/jovian-nixos/blob/development/_autodocs/integration.md Illustrates conditional configuration application in NixOS modules using mkIf. The configuration block is only applied when the specified condition (e.g., cfg.enableVendorDrivers) is true. ```nix config = mkIf cfg.enableVendorDrivers { # Only applied when enabled }; ``` -------------------------------- ### Enable Steam Deck UI Source: https://github.com/jovian-experiments/jovian-nixos/blob/development/docs/configuration.md Set this option to true to enable the Steam Deck UI tooling. This does not enable "desktop" Steam. ```nix jovian.steam.enable = true; ``` -------------------------------- ### Load AMDGPU Driver in Initrd Source: https://github.com/jovian-experiments/jovian-nixos/blob/development/_autodocs/api-reference/hardware.md Ensure the amdgpu kernel module is loaded in the initrd when early modesetting is enabled. This automatically includes necessary firmware files for the amdgpu driver. ```nix boot.initrd.kernelModules = [ "amdgpu" ]; ``` -------------------------------- ### Enable Decky Loader with Custom State Directory Source: https://github.com/jovian-experiments/jovian-nixos/blob/development/_autodocs/api-reference/decky-loader.md Enables Decky Loader and configures a custom directory for storing plugins and data. ```nix jovian.decky-loader = { enable = true; stateDir = "/mnt/games/decky-plugins"; }; ``` -------------------------------- ### Enable Steam Client Source: https://github.com/jovian-experiments/jovian-nixos/blob/development/docs/steam.md Enable the Steam Deck version of the Steam client by setting `jovian.steam.enable` to true. ```nix { jovian.steam.enable = true; } ``` -------------------------------- ### Enable Decky Loader with Custom User and State Directory Source: https://github.com/jovian-experiments/jovian-nixos/blob/development/_autodocs/api-reference/decky-loader.md Enables Decky Loader, specifies a custom unprivileged user ('steam'), and a corresponding state directory. Assumes the 'steam' user is configured elsewhere. ```nix jovian.decky-loader = { enable = true; user = "steam"; stateDir = "/home/steam/.decky-loader"; }; users.users.steam = { # ... user config }; ``` -------------------------------- ### Minimal Jovian NixOS Configuration Source: https://github.com/jovian-experiments/jovian-nixos/blob/development/_autodocs/api-reference/module-overview.md Enables basic Steam Deck support with the minimal required configuration. ```nix { imports = [ jovian.nixosModules.default ]; jovian.devices.steamdeck.enable = true; } ``` -------------------------------- ### Review Current Kernel Parameters Source: https://github.com/jovian-experiments/jovian-nixos/blob/development/_autodocs/integration.md Displays the active kernel command line parameters on the system. ```bash cat /proc/cmdline ``` -------------------------------- ### Set Session Environment Variables Source: https://github.com/jovian-experiments/jovian-nixos/blob/development/_autodocs/integration.md Shows how to set environment variables for the Gamescope session by exporting them in a shell script. ```bash export STEAM_ALLOW_DRIVE_UNMOUNT="1" export CUSTOM_VAR="value" ``` -------------------------------- ### Enable Steam Deck with Firmware Auto-Updates Source: https://github.com/jovian-experiments/jovian-nixos/blob/development/_autodocs/api-reference/devices-steamdeck.md Enables Steam Deck support and configures automatic updates for BIOS and controller firmware. ```nix jovian.devices.steamdeck = { enable = true; autoUpdate = true; # Auto-update BIOS and controller enableFwupdBiosUpdates = true; }; ``` -------------------------------- ### Jovian NixOS Configuration Namespace Source: https://github.com/jovian-experiments/jovian-nixos/blob/development/_autodocs/api-reference/module-overview.md Demonstrates the top-level 'jovian' key for configuring Jovian NixOS options within NixOS configuration. ```nix { jovian = { # Module options go here }; } ``` -------------------------------- ### Minimal Steam Deck Configuration Source: https://github.com/jovian-experiments/jovian-nixos/blob/development/_autodocs/README.md Enables basic Steam Deck support and Steam integration. Ensure Jovian NixOS modules are imported. ```nix { imports = [ # or via flake input ]; jovian.devices.steamdeck.enable = true; jovian.steam.enable = true; jovian.steamos.useSteamOSConfig = true; } ``` -------------------------------- ### Inspect Generated Jovian Configuration Files Source: https://github.com/jovian-experiments/jovian-nixos/blob/development/_autodocs/integration.md Displays the content of generated configuration files for Xorg and Gamescope session. ```bash cat /etc/X11/xorg.conf.d/90-jovian.conf cat /etc/xdg/gamescope-session/environment ``` -------------------------------- ### Set Per-Service Environment Variable Source: https://github.com/jovian-experiments/jovian-nixos/blob/development/_autodocs/integration.md Illustrates how to set an environment variable for a specific service, such as decky-loader, using its .serviceConfig.Environment. ```nix systemd.services.decky-loader.environment = { UNPRIVILEGED_USER = "decky"; }; ``` -------------------------------- ### Enable Redistributable AMD GPU Firmware Source: https://github.com/jovian-experiments/jovian-nixos/blob/development/_autodocs/api-reference/hardware.md Set this option to true to allow legally redistributable AMD GPU firmware to be loaded. This is often provided by pkgs.linux-firmware or pkgs.linux-firmware-jupiter. ```nix hardware.enableRedistributableFirmware = true; ``` -------------------------------- ### Importing Jovian NixOS Modules via Flake Source: https://github.com/jovian-experiments/jovian-nixos/blob/development/_autodocs/api-reference/module-overview.md Shows how to import the Jovian NixOS module system using a flake input in your NixOS configuration. ```nix # In your flake.nix: inputs.jovian.url = "github:Jovian-Experiments/Jovian-NixOS"; # In your NixOS configuration: { imports = [ inputs.jovian.nixosModules.default ]; # Configure via the jovian namespace jovian = { devices.steamdeck.enable = true; steam.enable = true; }; } ``` -------------------------------- ### Verify AMDGPU Firmware Availability Source: https://github.com/jovian-experiments/jovian-nixos/blob/development/_autodocs/api-reference/hardware.md Check if the necessary firmware files for the amdgpu driver are present in the system's firmware directory. This is crucial for early modesetting to function correctly. ```bash ls /lib/firmware/amdgpu/ ``` -------------------------------- ### Basic Option Definition with Type Source: https://github.com/jovian-experiments/jovian-nixos/blob/development/_autodocs/types.md Defines a basic option `enable` with a boolean type constraint. ```nix options.jovian.devices.steamdeck = { enable = mkOption { type = types.bool; default = false; description = "..."; }; }; ``` -------------------------------- ### Apply Optimized Kernel Parameters for Steam Deck Source: https://github.com/jovian-experiments/jovian-nixos/blob/development/_autodocs/api-reference/devices-steamdeck.md Enables Steam Deck command line flags to apply optimized kernel parameters for the hardware. ```text spi_amd.speed_dev=1 ``` -------------------------------- ### Perform NixOS Dry Run for Configuration Errors Source: https://github.com/jovian-experiments/jovian-nixos/blob/development/_autodocs/integration.md Simulates a NixOS rebuild to identify potential configuration errors, such as unknown options. Useful for troubleshooting module imports. ```bash nixos-rebuild dry-run ``` -------------------------------- ### Desktop Gaming PC with Steam Configuration Source: https://github.com/jovian-experiments/jovian-nixos/blob/development/_autodocs/README.md This configuration sets up a desktop gaming PC with Steam, enabling AMD GPU features like early modesetting and backlight control, and configuring Steam compatibility tool paths. ```nix { imports = [ jovian.nixosModules.default ]; # Configure hardware manually jovian.hardware.has.amd.gpu = true; jovian.hardware.amd.gpu.enableEarlyModesetting = true; jovian.hardware.amd.gpu.enableBacklightControl = true; jovian.steam = { enable = true; environment = { STEAM_COMPAT_TOOL_PATHS = "/home/user/.steam/compatibilitytools.d"; }; }; jovian.steamos.useSteamOSConfig = true; } ``` -------------------------------- ### Enable Decky Loader with Custom Packages Source: https://github.com/jovian-experiments/jovian-nixos/blob/development/_autodocs/configuration.md Enables the Steam Deck Plugin Loader and includes custom packages for the service PATH and Python environment. Specifies the data directory and the user for running plugins. ```nix jovian.decky-loader = { enable = true; extraPackages = [ pkgs.curl pkgs.unzip ]; extraPythonPackages = pythonPackages: with pythonPackages; [ hid ]; stateDir = "/var/lib/decky-loader"; user = "decky"; }; ``` -------------------------------- ### Configure Polkit Rule for NetworkManager Source: https://github.com/jovian-experiments/jovian-nixos/blob/development/_autodocs/integration.md Allows users to perform privileged NetworkManager actions without a password. Applied via security.polkit.extraConfig. ```javascript polkit.addRule(function(action, subject) { if (action.id.indexOf("org.freedesktop.NetworkManager") == 0) { return polkit.Result.YES; } }); ``` -------------------------------- ### Update Steam Deck Docking Station Firmware Source: https://github.com/jovian-experiments/jovian-nixos/blob/development/docs/devices/valve-steam-deck/index.md Connect the dock via USB-C and run this command to update its firmware. ```bash jupiter-dock-updater ``` -------------------------------- ### Module Dependencies Source: https://github.com/jovian-experiments/jovian-nixos/blob/development/_autodocs/README.md Illustrates the dependency relationships between Jovian NixOS modules. Enabling a parent module typically enables its sub-modules. ```text devices/steamdeck → hardware/amd steam ← devices/steamdeck steamos ← steam ``` -------------------------------- ### Jovian NixOS Main Module Import Source: https://github.com/jovian-experiments/jovian-nixos/blob/development/_autodocs/api-reference/module-overview.md The root module 'modules/default.nix' that imports all other submodules, required for enabling Jovian NixOS. ```nix { imports = [ ./decky-loader.nix ./devices ./jovian ./hardware ./steam ./steamos ]; } ``` -------------------------------- ### File Structure of Jovian NixOS Repository Source: https://github.com/jovian-experiments/jovian-nixos/blob/development/_autodocs/README.md This snippet displays the directory structure of the Jovian NixOS repository, illustrating the organization of modules and documentation. ```tree jovian-nixos/ ├── README.md ├── flake.nix ├── overlay.nix ├── modules/ │ ├── default.nix │ ├── decky-loader.nix │ ├── devices/ │ │ ├── default.nix │ │ └── steamdeck/ │ │ ├── controller.nix │ │ ├── fan-control.nix │ │ ├── firmware.nix │ │ ├── graphical.nix │ │ ├── hw-support.nix │ │ ├── kernel.nix │ │ ├── perf-control.nix │ │ ├── sdgyrodsu.nix │ │ ├── sound.nix │ │ └── workarounds.nix │ ├── hardware/ │ │ ├── default.nix │ │ └── amd/ │ │ └── default.nix │ ├── jovian/ │ │ ├── overlay.nix │ │ └── workarounds.nix │ ├── steam/ │ │ ├── autostart.nix │ │ ├── default.nix │ │ ├── environment.nix │ │ ├── steam.nix │ │ └── updater.nix │ └── steamos/ │ ├── automount.nix │ ├── bluetooth.nix │ ├── boot.nix │ ├── cec.nix │ ├── default.nix │ ├── earlyoom.nix │ ├── misc.nix │ └── sysctl.nix └── docs/ ├── getting-started.md ├── configuration.md └── ... ``` -------------------------------- ### Configuration Namespaces Source: https://github.com/jovian-experiments/jovian-nixos/blob/development/_autodocs/README.md Lists the top-level configuration namespaces within Jovian NixOS, including their sub-options and types. Refer to the Configuration Reference for full details. ```nix config.jovian.{ decky-loader.{ enable # bool package # package extraPackages # [package] extraPythonPackages # function stateDir # path user # string } devices.steamdeck.{ enable enableControllerUdevRules enableOsFanControl enableXorgRotation enableVendorDrivers enableDefaultCmdlineConfig enableDefaultStage1Modules enableKernelPatches enablePerfControlUdevRules autoUpdate enableFwupdBiosUpdates } hardware.has.amd.gpu hardware.amd.gpu.{ enableEarlyModesetting enableBacklightControl } steam.{ enable autoStart user desktopSession environment updater.splash } steamos.{ useSteamOSConfig enableBluetoothConfig enableAutoMountUdevRules enableHdmiCecIntegration enableEarlyOOM enableDefaultCmdlineConfig enableProductSerialAccess enableZram } } ```