Skip to content

Automated packages for XR/AR/VR tools and apps for NixOS [maintainer=@Scrumplex]

Notifications You must be signed in to change notification settings

nix-community/nixpkgs-xr

Repository files navigation

nixpkgs-xr

This repository provides Nix packages as well as a Nixpkgs overlay for unstable versions of XR/AR/VR packages for NixOS. The packages are automatically updated, built and cached regularly. A list of packages in provided down in the Packages section.

See Usage for information on how to set this up on your machine.

A community chat is available on Matrix: #nixpkgs-xr:matrix.org

Usage

This repository provides a Nixpkgs overlay as well as the individual packages from that overlay. While a Flake-based setup is the preferred way of using this repository, you can also use itw without Flakes.

Flake-based Setup

All you have to do, to apply this overlay to your NixOS configuration, is to add the input github:nix-community/nixpkgs-xr to your flake and import the convenient NixOS module nixpkgs-xr.nixosModules.nixpkgs-xr. See the example below.

Important

This module adds the Nixpkgs overlay as well as the binary cache for this repository. If you don't want the binary cache see manual setup below.

{
  inputs = {
    # ...
    nixpkgs-xr.url = "github:nix-community/nixpkgs-xr";
  };

  outputs = { nixpkgs, nixpkgs-xr, ... }: {
    nixosConfigurations.foo = nixpkgs.lib.nixosSystem {
      # ...
      modules = [
        # ...
        nixpkgs-xr.nixosModules.nixpkgs-xr
      ];
    };
  };
}

Manually setup Flake overlay

In case you want to have more control over the configuration, you can also choose to configure this manually. Assuming your NixOS configuration is right in your flake.nix, you can write the following module:

{
  inputs = {
    # ...
    nixpkgs-xr.url = "github:nix-community/nixpkgs-xr";
  };

  outputs = { nixpkgs, nixpkgs-xr, ... }: {
    nixosConfigurations.foo = nixpkgs.lib.nixosSystem {
      # ...
      modules = [
        # ...
        {
          nixpkgs.overlays = [ nixpkgs-xr.overlays.default ];

          #nix.settings = {
          #  substituters = [ "https://nix-community.cachix.org" ];
          #  trusted-public-keys = [ "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" ];
          #};
        }
      ];
    };
  };
}

Traditional setup

Compatibility for traditional NixOS setups is provided using flake-compat. You can just add the following snippet to your configuration:

{ ... }:
let
  nixpkgs-xr = import (builtins.fetchTarball "https://github.com/nix-community/nixpkgs-xr/archive/main.tar.gz");
in
  {
    nixpkgs.overlays = [ nixpkgs-xr.overlays.default ];

    #nix.settings = {
    #  substituters = [ "https://nix-community.cachix.org" ];
    #  trusted-public-keys = [ "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" ];
    #};
  }

You can also pin the tarball url using tools like niv.

Packages

This overlay provides the following packages:

  • index_camera_passthrough
  • monado
  • opencomposite
  • opencomposite-hand-fixes
  • opencomposite-vendored
  • wlx-overlay-s