cachix / feedback

Feedback about https://cachix.org service
2 stars 2 forks source link

Missing explanation about cachix usage on nixos ? #2

Closed PierreR closed 6 years ago

PierreR commented 6 years ago

Given:

λ ~/tmp/test → cat release.nix 
let
  pkgs = import (fetchTarball {
    url = "https://github.com/NixOS/nixpkgs/archive/8d58b1a0a019bb00ac6fb1792fe36e81847b7c92.tar.gz";
    sha256 = "1d2bwlk16lr2j7fx2ilib9ssxjprpws24a03dix62sld7hnwh7r9";
  }) {};
in
{
  project = pkgs.haskellPackages.callCabal2nix "language-puppet" (pkgs.fetchFromGitHub {
    owner  = "bartavelle";    repo   = "language-puppet";
    rev = "b71a97d26970a3f6a5a00933a94ffcf2a4d009f0";
    sha256 = "1qmcl1xhh22sf5a338kifs3fvmw2bvdv4qg0b8ycg3nasybdw230";
  }) {};
}

I have built https://language-puppet.cachix.org/ with

λ ~/tmp/test → nix-build release.nix -A project | cachix push language-puppet
All done.
λ ~/tmp/test → cachix use language-puppet
Configured https://language-puppet.cachix.org binary cache in /home/vagrant/.config/nix/nix.conf

Then I clear my local nix store with:

λ ~/tmp/test → rm result; sudo nix-collect-garbage -d

If I do:

λ ~/tmp/test → nix-build release.nix -A project
unpacking 'https://github.com/NixOS/nixpkgs/archive/8d58b1a0a019bb00ac6fb1792fe36e81847b7c92.tar.gz'...
building '/nix/store/zn8kl7hq3yp2vgfsdqk88lrb4gjpjiw3-source.drv'...

trying https://github.com/bartavelle/language-puppet/archive/b71a97d26970a3f6a5a00933a94ffcf2a4d009f0.tar.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   168    0   168    0     0    277      0 --:--:-- --:--:-- --:--:--   277
100  146k    0  146k    0     0  92039      0 --:--:--  0:00:01 --:--:--  224k
unpacking source archive /tmp/nix-build-source.drv-0/b71a97d26970a3f6a5a00933a94ffcf2a4d009f0.tar.gz
building '/nix/store/v122680xywb0wgn1qsb7j4b0wpj035h5-cabal2nix-language-puppet.drv'...
installing
these derivations will be built:
  /nix/store/vx086gfrvagr2a89nlcbn6rj5ilnnfmi-language-puppet-1.3.17.drv
...

I was expecting to get language-puppet from cachix (no rebuild) ?

PierreR commented 6 years ago

Ouch I had to

  nix = {
    binaryCaches = ["https://language-puppet.cachix.org"];
    binaryCachePublicKeys = ["language-puppet.cachix.org-1:nyTkkiphUF+s5HO4aDqGXBHD7rGiqz6ygvGYnJQ2feA="];
  };

Is this explain somewhere ?