From 32611aaa3342964b38f4bea32b250d816a26b220 Mon Sep 17 00:00:00 2001 From: Timon Date: Thu, 12 Mar 2026 10:19:20 +0000 Subject: [PATCH] nix docs --- .../volunteer/guide/project-setup/nix.md | 72 +++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 website/content/volunteer/guide/project-setup/nix.md diff --git a/website/content/volunteer/guide/project-setup/nix.md b/website/content/volunteer/guide/project-setup/nix.md new file mode 100644 index 0000000000..e26eede9fa --- /dev/null +++ b/website/content/volunteer/guide/project-setup/nix.md @@ -0,0 +1,72 @@ ++++ +title = "Nix setup" + +[extra] +order = 2 # Page number after chapter intro ++++ +## Using Graphite on NixOS/Nix + +Run Graphite without installing: + +```sh +nix run github:GraphiteEditor/Graphite +``` + +### Binary Cache + +A [Binary Cache](https://graphite.cachix.org/) is available to avoid building from source. + +You can use it directly on the command line: + +```sh +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: + +```nix +{ + 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](https://github.com/NixOS/nixpkgs) as [`graphite`](https://search.nixos.org/packages?channel=unstable&query=graphite&show=graphite). + +All Graphite code is licensed under the [Apache License 2.0](https://graphite.art/license#source-code), but the derivation also bundles the official branding assets which are licensed under the separate [Graphite Branding License](https://graphite.art/license#branding). 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](https://nix-community.org/cache/): + +```nix +nix.settings = { + substituters = [ "https://nix-community.cachix.org" ]; + trusted-public-keys = [ + "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" + ]; +}; +```