From 04e595ce4c3890ace4f0d8c566ccb5780f90cd6f Mon Sep 17 00:00:00 2001 From: Troy Benson Date: Fri, 19 Dec 2025 08:42:49 -0700 Subject: [PATCH 1/2] docs: add installation steps for nix --- README.md | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/README.md b/README.md index ed0a56b80..6831f7c98 100644 --- a/README.md +++ b/README.md @@ -86,6 +86,45 @@ If you have a Rust toolchain installed you can install sccache using cargo. **No cargo install sccache --locked ``` +### With Nix + +Sccache is available in nixpkgs, so if you don't need the latest version you can use that: + +```nix +buildInputs = [ pkgs.sccache ]; +``` + +We also provide a flake with an overlay for getting the latest version: + +```nix +{ + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11"; + sccache.url = "github:mozilla/sccache"; + }; + + outputs = { self, nixpkgs, sccache, ... }: + let + system = "x86_64-linux"; + pkgs = import nixpkgs { + inherit system; + overlays = [ sccache.overlays.default ]; + }; + in { + devShells.${system}.default = pkgs.mkShell { + buildInputs = [ pkgs.sccache ]; + }; + }; +} +``` + +Or use it directly from the flake without the overlay: + +```bash +nix run github:mozilla/sccache -- --help +nix shell github:mozilla/sccache +``` + --- Usage From 28e234842211ce1e952ba5ab9651096410773124 Mon Sep 17 00:00:00 2001 From: Troy Benson Date: Mon, 22 Dec 2025 15:21:00 -0700 Subject: [PATCH 2/2] nits --- README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6831f7c98..0674a0c91 100644 --- a/README.md +++ b/README.md @@ -99,8 +99,11 @@ We also provide a flake with an overlay for getting the latest version: ```nix { inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11"; - sccache.url = "github:mozilla/sccache"; + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + sccache = { + url = "github:mozilla/sccache"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; outputs = { self, nixpkgs, sccache, ... }: