Skip to content

Commit

Permalink
switch the caches to nix-community.cachix.org
Browse files Browse the repository at this point in the history
Share the caching infrastructure with the nix-community project.

The cache is automatically done in a post-build hook so the bot doesn't
need to this.
  • Loading branch information
zimbatm committed Aug 7, 2020
1 parent a2a9bca commit 10c090e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 16 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ why your pet package is not receiving updates.
## Cachix

By uploading the build outputs to
[Cachix](https://r-ryantm.cachix.org/), nixpkgs-update allows you to
[Cachix](https://nix-community.cachix.org/), nixpkgs-update allows you to
test a package with one command.


Expand Down
11 changes: 0 additions & 11 deletions src/Nix.hs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ module Nix
assertOldVersionOn,
binPath,
build,
cachix,
getAttr,
getChangelog,
getDerivationFile,
Expand Down Expand Up @@ -276,16 +275,6 @@ build attrPath =
& fmap (T.lines >>> reverse >>> take 30 >>> reverse >>> T.unlines)
throwE ("nix build failed.\n" <> buildLog <> " ")

cachix :: MonadIO m => Text -> ExceptT Text m ()
cachix resultPath =
( setStdin
(byteStringInput (TL.encodeUtf8 (TL.fromStrict resultPath)))
(shell "cachix push r-ryantm")
& runProcess_
& tryIOTextET
)
<|> throwE "pushing to cachix failed"

numberOfFetchers :: Text -> Int
numberOfFetchers derivationContents =
countUp "fetchurl {" + countUp "fetchgit {" + countUp "fetchFromGitHub {"
Expand Down
6 changes: 2 additions & 4 deletions src/Update.hs
Original file line number Diff line number Diff line change
Expand Up @@ -636,16 +636,14 @@ doCachix :: MonadIO m => (Text -> m ()) -> UpdateEnv -> Text -> ExceptT Text m T
doCachix log updateEnv resultPath =
if pushToCachix (options updateEnv)
then do
lift $ log ("cachix " <> (T.pack . show) resultPath)
Nix.cachix resultPath
return
[interpolate|
Either **download from Cachix**:
```
nix-store -r $resultPath \
--option binary-caches 'https://cache.nixos.org/ https://r-ryantm.cachix.org/' \
--option binary-caches 'https://cache.nixos.org/ https://nix-community.cachix.org/' \
--option trusted-public-keys '
r-ryantm.cachix.org-1:gkUbLkouDAyvBdpBX0JOdIiD2/DP1ldF3Z3Y6Gqcc4c=
nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=
cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
'
```
Expand Down

0 comments on commit 10c090e

Please sign in to comment.