/shadow-nix

Supporting Shadow under NixOS

Primary LanguageNixThe UnlicenseUnlicense

Shadow on NixOS

⚠️ Since I canceled my subscription, I am no longer able to maintain this package. You may go to the following repository to get a functionning package: https://github.com/cornerman/shadow-nix

Package build contributions welcome License

The goal of this project is to provide Shadow on NixOS with a dynamic derivation to handle frequent updates.

This project is not affiliated with Blade, the company providing Shadow, in any way.

Shadow loves Nix

Table of content

  1. Installation
  2. Configuration
  3. About VAAPI
  4. Versioning
  5. Contributing
  6. License
  7. Mentions

1. Installation

Note that the ref value (v*.*.*) should point to the lastest release. Checkout the tags to know it. The version is the derivation one, not the launcher nor the streamer version. Installing any version of this repository will always install the latest version of the launcher available.

If you want the latest package derivation, use ref = "master" instead.

As a system package

In your configuration.nix :

{
  imports = [
    (fetchGit { url = "https://github.com/NicolasGuilloux/shadow-nix"; ref = "v1.0.3"; } + "/import/system.nix")
  ];

  programs.shadow-client = {
    # Enabled by default when using import
    # enable = true;
    channel = "prod";
  };
}

As a home-manager package

In your home.nix :

{
  imports = [
    (fetchGit { url = "https://github.com/NicolasGuilloux/shadow-nix"; ref = "v1.0.3"; } + "/import/home-manager.nix")
  ];

  programs.shadow-client = {
    # Enabled by default when using import
    # enable = true;
    channel = "preprod";
  };
}

2. Configuration

Package configuration

This is the configuration of the package itself. You can set them via programs.shadow-client.<key>.

Key Type Default Possible values Description
enable bool false true, false Enable the package
channel enum prod prod, preprod, testing prod is stable, preprod is beta, testing is alpha
extraChannels [enum] [] [ "prod" "preprod" "testing" ] prod is stable, preprod is beta, testing is alpha
launchArgs string Add launch arguments to the renderer
enableDesktopLauncher bool true true, false Creates a .desktop entry
enableDiagnostics bool false true, false Provide debug tools
forceDriver enum null iHD, i965, radeon, radeonsi Force the LIBVA driver
enableGpuFix bool true true, false Create the drirc file to fix some driver related issues

XSession configuration

This package also provides a standalone session with only the necessary component to start Openbox and Shadow. You can set the configuration via programs.shadow-client.x-session.<key>.

Key Type Default Possible values Description
enable bool false true, false Enable the standalone XSession
additionalMenuEntries {} Additional menu entries for the Openbox right click menu
startScript string Additional start option to be executed when Openbox starts

Systemd session configuration

This package provides a standalone systemd daemon to start only the client wrapped into Xorg in a TTY. You can set the configuration at programs.shadow-client.systemd-session.<key>.

Key Type Default Possible values Description
enable bool false true, false Enable the standalone XSession with Systemd
user string User that will start the session
tty int 8 TTY number where the session will be started
onClosingTty int null TTY number that will be selected on closing

3. About VAAPI

It is important to have vaapi enabled to make Shadow works correctly. You can find information on this NixOS wiki page.

An example for Intel and AMD GPU

The following example should work for both AMD and Intel GPU. This is just an example, there is no guarantee that it will work.

{
  # Provides the `vainfo` command
  environment.systemPackages = with pkgs; [ libva-utils ];

  # Hardware hybrid decoding
  nixpkgs.config.packageOverrides = pkgs: {
    vaapiIntel = pkgs.vaapiIntel.override { enableHybridCodec = true; };
  };

  # Hardware drivers
  hardware.opengl = {
    enable = true;
    extraPackages = with pkgs; [
      vaapiIntel
      vaapiVdpau
      libvdpau-va-gl
      intel-media-driver
    ];
  };
}

4. Versioning

shadow-nix follows semantic versioning. In short the scheme is MAJOR.MINOR.PATCH where

  1. MAJOR is bumped when there is a breaking change,
  2. MINOR is bumped when a new feature is added in a backward-compatible way,
  3. PATCH is bumped when a bug is fixed in a backward-compatible way.

Versions bellow 1.0.0 are considered experimental and breaking changes may occur at any time.

5. Contributing

Contributions are welcomed! There are many ways to contribute, and we appreciate all of them. Here are some of the major ones:

  • Bug Reports: While we strive for quality software, bugs can happen and we can't fix issues we're not aware of. So please report even if you're not sure about it or just want to ask a question. If anything the issue might indicate that the documentation can still be improved!
  • Feature Request: You have a use case not covered by the current api? Want to suggest a change or add something? We'd be glad to read about it and start a discussion to try to find the best possible solution.
  • Pull Request: Want to contribute code or documentation? We'd love that! If you need help to get started, GitHub as documentation on pull requests. We use the "fork and pull model" were contributors push changes to their personnal fork and then create pull requests to the main repository. Please make your pull requests against the master branch.

As a reminder, all contributors are expected to follow our Code of Conduct.

6. License

shadow-nix is distributed under the terms of the Unlicense license.

7. Mentions

This repository was originally created and maintained by Elyhaka. A big thanks to him for helping me learning Nix!