Skip to content

add cache substituter#4

Merged
srid merged 1 commit intosrid:masterfrom
edrex:flake-substituter
Mar 31, 2022
Merged

add cache substituter#4
srid merged 1 commit intosrid:masterfrom
edrex:flake-substituter

Conversation

@edrex
Copy link
Copy Markdown
Contributor

@edrex edrex commented Mar 30, 2022

No description provided.

@srid
Copy link
Copy Markdown
Owner

srid commented Mar 31, 2022

When running nix develop with these lines, I saw:

image

It was only building Emanote on macOS, but that's probably because I use a custom ema as input. Haven't tested it on emanote-template yet ...

@edrex
Copy link
Copy Markdown
Contributor Author

edrex commented Mar 31, 2022

I'm not sure if nixConfig from dependency (input, non-root) flakes apply, but it seems like they should. In that case these lines could be included in emanote, or ema.

The lines don't apply when used with nix run (NixOS/nix#6170). (But maybe running nix build first would prime the store? Not sure)

Also you can only add substitutors when running in a privileged context, which means:

  • single user mode
  • you are in trusted-users
  • i guess portable nix etc

@edrex
Copy link
Copy Markdown
Contributor Author

edrex commented Mar 31, 2022

I'm not sure if nixConfig from dependency (input, non-root) flakes apply

They don't (NixOS/nix#4189 (comment))

Currently it only uses options from the top-level flake. Since dependencies are fetched lazily that's really the only option, unless we propagate options into the lock file.

, so adding the cache to emanote-template is desirable.

@edrex edrex changed the title WIP add substituter add cache substituter Mar 31, 2022
@srid
Copy link
Copy Markdown
Owner

srid commented Mar 31, 2022

I haven't tested this, but maybe in a different PR we should update README with what works for cache and what doesn't. nix run and nix build are the main workflows for this repo.

@srid srid merged commit 8fd2a17 into srid:master Mar 31, 2022
@edrex
Copy link
Copy Markdown
Contributor Author

edrex commented Mar 31, 2022

maybe running nix build first would prime the store?

It seems to - nix run loads quickly after nix build with cache.

@edrex edrex deleted the flake-substituter branch March 31, 2022 19:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants