Files
Graphite/website/content/volunteer/guide/project-setup/nix.md
2026-03-12 10:19:20 +00:00

2.1 KiB

+++ title = "Nix setup"

[extra] order = 2 # Page number after chapter intro +++

Using Graphite on NixOS/Nix

Run Graphite without installing:

nix run github:GraphiteEditor/Graphite

Binary Cache

A Binary Cache is available to avoid building from source.

You can use it directly on the command line:

nix run github:GraphiteEditor/Graphite --extra-substituters "https://graphite.cachix.org" --extra-trusted-public-keys "graphite.cachix.org-1:B7Il1yMpkquN/dXM+5GRmz+4Xmu2aaCS1GcWNfFhsOo="

Using the Flake from the official repository

To add Graphite to a NixOS configuration, include the flake as an input:

{
  inputs = {
    nixpkgs.url = "...";
    graphite.url = "github:GraphiteEditor/Graphite";
  };

  outputs = { nixpkgs, graphite, ... }: {
    nixosConfigurations.your-host = nixpkgs.lib.nixosSystem {
      modules = [
        {
          environment.systemPackages = [
            graphite.packages.x86_64-linux.default
          ];

          nix.settings = {
            substituters = [ "https://graphite.cachix.org" ];
            trusted-public-keys = [
              "graphite.cachix.org-1:B7Il1yMpkquN/dXM+5GRmz+4Xmu2aaCS1GcWNfFhsOo="
            ];
          };
        }
      ];
    };
  };
}

Nixpkgs

Graphite is also available in nixpkgs as graphite.

All Graphite code is licensed under the Apache License 2.0, but the derivation also bundles the official branding assets which are licensed under the separate Graphite Branding License. Graphite is therefore not considered free by nixpkgs and not cached in the main NixOS cache.

Pre-built binaries are instead available through the nix-community cache:

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