Matrix AI's public Nix Packages collection.
This repository is configured to support Flakes. Ensure flakes are enabled (e.g. via nix.settings.experimental-features = [ "nix-command" "flakes" ];).
Prefer the Matrix registry so internal consumers resolve via flake:nixpkgs-matrix (stable IDs with Nix ≥ 2.26):
{
nixConfig = {
flake-registry = "https://nix.matrix.ai/registry/flake-registry.json";
experimental-features = [ "nix-command" "flakes" ];
};
inputs = {
nixpkgs-matrix.url = "flake:nixpkgs-matrix";
};
outputs = inputs@{ nixpkgs-matrix, ... }:
let
system = builtins.currentSystem or "x86_64-linux";
pkgs = nixpkgs-matrix.legacyPackages.${system};
in {
nixosConfigurations.example = nixpkgs-matrix.lib.nixosSystem {
specialArgs = { inherit inputs system; };
modules = [ ./configuration.nix ];
};
devShells.${system}.default = pkgs.mkShell {
packages = [ pkgs.hello ];
};
};
}Registry can also be set globally: nix.settings.flake-registry = "https://nix.matrix.ai/registry/flake-registry.json";.
External consumers should pin directly to the GitHub URL (optionally set the registry above to keep the indirect ID stable):
{
inputs = {
nixpkgs-matrix.url = "github:MatrixAI/nixpkgs-matrix";
};
outputs = inputs@{ nixpkgs-matrix, ... }:
let
system = "x86_64-linux";
pkgs = nixpkgs-matrix.legacyPackages.${system};
in {
nixosConfigurations.example = nixpkgs-matrix.lib.nixosSystem {
specialArgs = { inherit inputs system; };
modules = [ ./configuration.nix ];
};
devShells.${system}.default = pkgs.mkShell {
packages = [ pkgs.hello ];
};
};
}type = "indirect" inputs are rewritten during lockfile writes (notably with Nix 2.26), which can produce unstable IDs across environments. Matrix's approach is to use the global registry entry (flake:nixpkgs-matrix) for internal stability, while external users continue to consume the explicit GitHub URL.
This repository contains a few important files to look at when contributing to the project.
flake.nix- Contains the base definition for the flake package. Re-exports our modified package set as an output.packages.nix- Custom packages are placed here. These entries usebuiltins.getFlakewith explicit revisions for reproducibility; prefer wiring new dependencies through flake inputs unless a fixed-rev fetch is required.
/nixpkgs-matrix
├── flake.nix - The primary flake file.
└── packages.nix - This is where in-tree packages exist.
The source code for this project is licensed under the Apache 2.0 License. You may find the conditions of the license here.