+1
doc/builders/images.xml
+1
doc/builders/images.xml
+49
doc/builders/images/binarycache.section.md
+49
doc/builders/images/binarycache.section.md
···+`pkgs.mkBinaryCache` is a function for creating Nix flat-file binary caches. Such a cache exists as a directory on disk, and can be used as a Nix substituter by passing `--substituter file:///path/to/cache` to Nix commands.+Nix packages are most commonly shared between machines using [HTTP, SSH, or S3](https://nixos.org/manual/nix/stable/package-management/sharing-packages.html), but a flat-file binary cache can still be useful in some situations. For example, you can copy it directly to another machine, or make it available on a network file system. It can also be a convenient way to make some Nix packages available inside a container via bind-mounting.+Note that this function is meant for advanced use-cases. The more idiomatic way to work with flat-file binary caches is via the [nix-copy-closure](https://nixos.org/manual/nix/stable/command-ref/nix-copy-closure.html) command. You may also want to consider [dockerTools](#sec-pkgs-dockerTools) for your containerization needs.+The following derivation will construct a flat-file binary cache containing the closure of `hello`.+- `rootPaths` specifies a list of root derivations. The transitive closure of these derivations' outputs will be copied into the cache.
+6
maintainers/maintainer-list.nix
+6
maintainers/maintainer-list.nix
···
+1
nixos/tests/all-tests.nix
+1
nixos/tests/all-tests.nix
···
+62
nixos/tests/binary-cache.nix
+62
nixos/tests/binary-cache.nix
···+cachePath = machine.succeed("nix-build --no-out-link -E 'with import <nixpkgs> {}; mkBinaryCache { rootPaths = [hello]; }'").strip()+grepLogs = machine.succeed("grep -l 'StorePath: /nix/store/[[:alnum:]]*-hello-.*' /tmp/cache/*.narinfo")+match = re.match(r"^StorePath: (/nix/store/[a-z0-9]*-hello-.*)$", narInfoContents, re.MULTILINE)+logs = machine.succeed("nix-build -A hello '<nixpkgs>' --option require-sigs false --option trusted-substituters file:///tmp/cache --option substituters file:///tmp/cache 2>&1")+if not "this path will be fetched" in logLines[0]: raise Exception("Unexpected first log line")
+2
-2
pkgs/applications/audio/praat/default.nix
+2
-2
pkgs/applications/audio/praat/default.nix
···
+3
-3
pkgs/applications/audio/reaper/default.nix
+3
-3
pkgs/applications/audio/reaper/default.nix
···
+14
-16
pkgs/applications/networking/browsers/ladybird/default.nix
+14
-16
pkgs/applications/networking/browsers/ladybird/default.nix
······-NIX_CFLAGS_COMPILE = toString (lib.optionals (stdenv.isDarwin && lib.versionOlder stdenv.targetPlatform.darwinSdkVersion "11.0") [+] ++ lib.optionals (stdenv.isDarwin && lib.versionOlder stdenv.targetPlatform.darwinSdkVersion "11.0") [
+2
-2
pkgs/applications/networking/cluster/glooctl/default.nix
+2
-2
pkgs/applications/networking/cluster/glooctl/default.nix
···
-41
pkgs/applications/networking/cluster/k3s/1_23/0001-script-download-strip-downloading-just-package-CRD.patch
-41
pkgs/applications/networking/cluster/k3s/1_23/0001-script-download-strip-downloading-just-package-CRD.patch
···--curl --compressed -sfL https://github.com/k3s-io/k3s-root/releases/download/${VERSION_ROOT}/k3s-root-${ARCH}.tar | tar xf - --exclude=bin/socat--git clone --single-branch --branch=${VERSION_RUNC} --depth=1 https://github.com/opencontainers/runc ${RUNC_DIR}--git clone --single-branch --branch=${VERSION_CONTAINERD} --depth=1 https://github.com/k3s-io/containerd ${CONTAINERD_DIR}
+10
pkgs/applications/networking/cluster/k3s/1_23/chart-versions.nix
+10
pkgs/applications/networking/cluster/k3s/1_23/chart-versions.nix
···
+26
-30
pkgs/applications/networking/cluster/k3s/1_23/default.nix
+26
-30
pkgs/applications/networking/cluster/k3s/1_23/default.nix
···-# taken from ./manifests/traefik.yaml, extracted from '.spec.chart' https://github.com/k3s-io/k3s/blob/v1.23.3%2Bk3s1/scripts/download#L9-# The 'patch' and 'minor' versions are currently hardcoded as single digits only, so ignore the trailing two digits. Weird, I know.+# Based on the traefik charts here: https://github.com/k3s-io/k3s/blob/v1.23.16%2Bk3s1/scripts/download#L29-L32-# taken from ./scripts/version.sh VERSION_ROOT https://github.com/k3s-io/k3s/blob/v1.23.3%2Bk3s1/scripts/version.sh#L47+# taken from ./scripts/version.sh VERSION_ROOT https://github.com/k3s-io/k3s/blob/v1.23.16%2Bk3s1/scripts/version.sh#L54-# taken from ./scripts/version.sh VERSION_CNIPLUGINS https://github.com/k3s-io/k3s/blob/v1.23.3%2Bk3s1/scripts/version.sh#L45+# taken from ./scripts/version.sh VERSION_CNIPLUGINS https://github.com/k3s-io/k3s/blob/v1.23.16%2Bk3s1/scripts/version.sh#L47# run `grep github.com/kubernetes-sigs/cri-tools go.mod | head -n1 | awk '{print $4}'` in the k3s repo at the tag······-# taken verbatim from https://github.com/k3s-io/k3s/blob/v1.23.3%2Bk3s1/scripts/build#L105-L113+# taken verbatim from https://github.com/k3s-io/k3s/blob/v1.23.16%2Bk3s1/scripts/build#L123-L131······-# Note, upstream's chart has a 00 suffix. This seems to not matter though, so we're ignoring that naming detail.
+1
-1
pkgs/applications/networking/cluster/k3s/1_26/default.nix
+1
-1
pkgs/applications/networking/cluster/k3s/1_26/default.nix
···
+40
pkgs/build-support/binary-cache/default.nix
+40
pkgs/build-support/binary-cache/default.nix
···+PATH = "${buildPackages.coreutils}/bin:${buildPackages.jq}/bin:${buildPackages.python3}/bin:${buildPackages.nix}/bin:${buildPackages.xz}/bin";+# These directories must exist, or Nix might try to create them in LocalBinaryCacheStore::init(),
+43
pkgs/build-support/binary-cache/make-binary-cache.py
+43
pkgs/build-support/binary-cache/make-binary-cache.py
···+fileHash = subprocess.run(["nix-hash", "--base32", "--type", "sha256", item["path"]], capture_output=True).stdout.decode().strip()
+2
-2
pkgs/development/interpreters/python/default.nix
+2
-2
pkgs/development/interpreters/python/default.nix
···
+9
-2
pkgs/development/libraries/ldb/default.nix
+9
-2
pkgs/development/libraries/ldb/default.nix
······
+9
-2
pkgs/development/libraries/talloc/default.nix
+9
-2
pkgs/development/libraries/talloc/default.nix
······
+9
-2
pkgs/development/libraries/tdb/default.nix
+9
-2
pkgs/development/libraries/tdb/default.nix
······
+11
-2
pkgs/development/libraries/tevent/default.nix
+11
-2
pkgs/development/libraries/tevent/default.nix
·········
+1
-1
pkgs/development/mobile/androidenv/ndk-bundle/default.nix
+1
-1
pkgs/development/mobile/androidenv/ndk-bundle/default.nix
+3
-3
pkgs/development/python-modules/gbulb/default.nix
+3
-3
pkgs/development/python-modules/gbulb/default.nix
···
+2
-2
pkgs/development/python-modules/google-cloud-error-reporting/default.nix
+2
-2
pkgs/development/python-modules/google-cloud-error-reporting/default.nix
···
+13
-4
pkgs/development/python-modules/karton-asciimagic/default.nix
+13
-4
pkgs/development/python-modules/karton-asciimagic/default.nix
···
+3
-2
pkgs/development/python-modules/karton-autoit-ripper/default.nix
+3
-2
pkgs/development/python-modules/karton-autoit-ripper/default.nix
······
+2
-1
pkgs/development/python-modules/karton-classifier/default.nix
+2
-1
pkgs/development/python-modules/karton-classifier/default.nix
······
+3
-2
pkgs/development/python-modules/karton-config-extractor/default.nix
+3
-2
pkgs/development/python-modules/karton-config-extractor/default.nix
······
+8
-1
pkgs/development/python-modules/karton-core/default.nix
+8
-1
pkgs/development/python-modules/karton-core/default.nix
·········
+1
pkgs/development/python-modules/karton-dashboard/default.nix
+1
pkgs/development/python-modules/karton-dashboard/default.nix
···
+2
-1
pkgs/development/python-modules/karton-mwdb-reporter/default.nix
+2
-1
pkgs/development/python-modules/karton-mwdb-reporter/default.nix
······
+13
-4
pkgs/development/python-modules/karton-yaramatcher/default.nix
+13
-4
pkgs/development/python-modules/karton-yaramatcher/default.nix
······
+2
-2
pkgs/development/python-modules/nomadnet/default.nix
+2
-2
pkgs/development/python-modules/nomadnet/default.nix
······
+3
-3
pkgs/development/tools/continuous-integration/dagger/default.nix
+3
-3
pkgs/development/tools/continuous-integration/dagger/default.nix
···
+3
-3
pkgs/development/tools/gosec/default.nix
+3
-3
pkgs/development/tools/gosec/default.nix
···
+2
-2
pkgs/development/tools/micronaut/default.nix
+2
-2
pkgs/development/tools/micronaut/default.nix
···url = "https://github.com/micronaut-projects/micronaut-starter/releases/download/v${version}/micronaut-cli-${version}.zip";
+2
-2
pkgs/development/web/grails/default.nix
+2
-2
pkgs/development/web/grails/default.nix
···url = "https://github.com/grails/grails-core/releases/download/v${version}/grails-${version}.zip";
+2
-2
pkgs/games/chessx/default.nix
+2
-2
pkgs/games/chessx/default.nix
···
+5
-5
pkgs/os-specific/linux/nvidia-x11/default.nix
+5
-5
pkgs/os-specific/linux/nvidia-x11/default.nix
···
+3
-3
pkgs/servers/matrix-synapse/matrix-appservice-irc/default.nix
+3
-3
pkgs/servers/matrix-synapse/matrix-appservice-irc/default.nix
···
+7
pkgs/servers/samba/4.x.nix
+7
pkgs/servers/samba/4.x.nix
·········
+3
-3
pkgs/tools/misc/broot/default.nix
+3
-3
pkgs/tools/misc/broot/default.nix
···
+2
-2
pkgs/tools/misc/nb/default.nix
+2
-2
pkgs/tools/misc/nb/default.nix
···
+3
-3
pkgs/tools/networking/drill/default.nix
+3
-3
pkgs/tools/networking/drill/default.nix
···
+2
-2
pkgs/tools/networking/tinyfecvpn/default.nix
+2
-2
pkgs/tools/networking/tinyfecvpn/default.nix
···
+2
-2
pkgs/tools/networking/xrootd/default.nix
+2
-2
pkgs/tools/networking/xrootd/default.nix
···
+73
pkgs/tools/package-management/repro-get/default.nix
+73
pkgs/tools/package-management/repro-get/default.nix
···+name = "${repro-get.pname}-${builtins.unsafeDiscardStringContext (lib.substring 0 12 (baseNameOf repro-get.drvPath))}";
+3
-3
pkgs/tools/package-management/reuse/default.nix
+3
-3
pkgs/tools/package-management/reuse/default.nix
···
+3
-2
pkgs/tools/security/ffuf/default.nix
+3
-2
pkgs/tools/security/ffuf/default.nix
······
+2
-2
pkgs/tools/system/htop/default.nix
+2
-2
pkgs/tools/system/htop/default.nix
···
+3
-3
pkgs/tools/text/mdbook-katex/default.nix
+3
-3
pkgs/tools/text/mdbook-katex/default.nix
···
+4
pkgs/top-level/all-packages.nix
+4
pkgs/top-level/all-packages.nix
······