Comments (5)
This note says that if the directory your
flake.nix
is in is not a Git repository, evaluating${./.}
will copy all the files under./.
into the store. If you have a large directory, this is quite wasteful. This means thatfileset
is particularly useful in that case
Just to clarify, this isn't right. Filesets (or any other way to filter sources) can't prevent files from being added to the store if you use Flakes. So they won't help with that. That's a Nix problem to fix, and I'm not sure even NixOS/nix#6530 helps with that.
But indeed as already mentioned by Valentin, file sets are still useful to make derivations depend on only the files they actually need, so that you don't need to build them again when e.g. the README.md
or default.nix
changes.
from nix.dev.
This note says that if the directory your flake.nix
is in is not a Git repository, evaluating ${./.}
will copy all the files under ./.
into the store. If you have a large directory, this is quite wasteful. This means that fileset
is particularly useful in that case. NixOS/nix#6530 is supposed to alleviate that limitation when enforcing pure evaluation, but we don't know when it will be completed.
The other note on flakes and gitTracked
is where fileset
indeed does not add much benefit: only files tracked by Git are copied to the store when the flakes
experimental feature is enabled, so there is no point filtering for them with fileset
.
from nix.dev.
Ok, but I'm still curious about how useful filesets are with Flakes, because it sounds like I will still end up copying the entire Git repository into the store before anything happens. Would #6530 help here too?
from nix.dev.
I will still end up copying the entire Git repository into the store before anything happens
With flakes indeed you'll copy the repo into the store, but then filesets will let you extract small store objects for compilation. Which means that if those don't change, you don't have to copy around large chunks during builds.
from nix.dev.
Got it, thanks!
from nix.dev.
Related Issues (20)
- Move to docs.nixos.org HOT 12
- Navigation doesn't keep track of your position in the hierarchy HOT 1
- Trying to fix reproducible paths section and it's not working out HOT 1
- Package versions do not match across tutorials HOT 1
- Git shell hook breaks if not a Git repo
- Overview of pinning techniques
- Guides and Recipes overview HOT 3
- Concepts overview
- Guide for writing guides
- Overview of common expression patterns HOT 2
- Sidebar Navigation Leads to Incorrect URL and Generic Anchor IDs in 'Working with Local Files'
- Linkcheck failing for raspberrypi domain
- Add a section to for a NixOS graphical configuration in the VM tutorial HOT 1
- CI stuck HOT 2
- Link does not go where expected HOT 2
- use an open service on /tutorials/module-system/module-system.html HOT 6
- Expand and Improve Module Article HOT 5
- Missing `rec-expression` anchor redirect and inquiry into redirect logic
- Issue on page /tutorials/first-steps/declarative-shell.html | Setting environment variables HOT 1
- Issue on page /tutorials/packaging-existing-software.html
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nix.dev.