Skip to content
This repository was archived by the owner on Jul 26, 2024. It is now read-only.

flake: add cache config #187

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

edrex
Copy link

@edrex edrex commented Mar 24, 2023

This enables nix tooling to offer to enable the cache:

edrex@chip ~/s/g/B/nix-script (main)> nix profile install .
do you want to allow configuration setting 'extra-substituters' to be set to 'https://nix-script.cachix.org' (y/N)? y
do you want to permanently mark this value as trusted (y/N)? y
do you want to allow configuration setting 'extra-trusted-public-keys' to be set to 'nix-script.cachix.org-1:czo3tF6XERpkDdMd6m84XjmgeHQXNeIooSt7b0560+c=' (y/N)? y
do you want to permanently mark this value as trusted (y/N)? y

(doesn't work for inputs, only the root flake)

I didn't get a cache hit when I just tried it though.

@BrianHicks
Copy link
Owner

I feel a little confused: is this working and ready for review or not? You say you didn't get a cache hit. Do you know why?

@edrex
Copy link
Author

edrex commented Mar 25, 2023

That means your build is broken.

(Edit: this can be caused by not using the flake.lock nixpkgs version in your build, various nix config options)

@BrianHicks
Copy link
Owner

Can you say more?

@edrex
Copy link
Author

edrex commented Mar 25, 2023

Sorry, edit above

@edrex
Copy link
Author

edrex commented Mar 25, 2023

I saw this happen once before when https://github.com/srid/emanote added it, i think it was wrong nixpkgs version.

@BrianHicks
Copy link
Owner

Do you mean a differing nixpkgs between your installation and the one in this repo? Or something else?

@edrex
Copy link
Author

edrex commented Mar 25, 2023

flake run uses the version from the lock, unless i used --override-input nix-script github:my/fork. It must be the derivation output of flake.nix:packages.default (with inputs as flake.lock, including nixpkgs) isn't being uploaded to the cache.

@edrex
Copy link
Author

edrex commented Mar 25, 2023

I can take a look when I'm back at my laptop

@edrex
Copy link
Author

edrex commented Mar 25, 2023

Oops that should be something like --override-input nixpkgs nixpkgs (The second argument is evaluated against the local registry, so it gives you whatever you have pinned locally). That may be what is happening on the build.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants