-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Export & Compare NixOS configurations. #7092
Comments
+1 That would be usefull :)
|
👍 |
👍 👍 👍 👍 👍 |
Perhaps we could just get away with a primop for "evaluation-time closure"? Then you'd have a configuration.nix include a field for its own evaluation-time closure and call it a day. I'm probably skimming over all sorts of hard problems in there though. |
Thinking about this some more, is there any reason this is any different from any other derivation? It would generally be nice to retain (in a secure way) source that generates a given derivation (including the system one) for auditing and reproducibility purposes. If we structure it properly, the channel or git working directory you're using could just become another derivation so that we don't need to copy everything every time. A quick sketch:
Now if I want to reproduce the full config for a given system derivation, I can look at its reference to the configuration and the channels it used (even if they were local dirty git working directories!) and get all the nix source that was used. If we then get deterministic system tarballs, you should be able to go back and ensure that rebuilding the configuration with the same channels produces the same output. There's nothing particularly special about the configuration derivation though, and it seems like e.g., my openssl derivation should be able to get the same treatment, with the same auditing/verification benefits. |
I agree, but I was wondering if we really want to keep all the files involved in building a package / system, knowing that most of them are already store in a vcs somewhere. Also, independently of keeping all the source files, I do think that there is some interest to keep (or be able to generate) a configuration file which summarize all (even internal) definitions used to build a system. |
I realize that the files are probably in source control somewhere, but the key thing we gain with what I describe is linkage: we know for sure which revision (or even a dirty uncommitted revision) went into a given derivation. Someone could then take an arbitrary derivation in the store, look at e.g., Perhaps just a flag somewhere could specify if we want to keep them around? Not everyone cares about rigorous auditability, but a security-conscious person or organization will be willing to take the (small!) space hit to store a few megabytes of .nix files. |
I realize multiple |
It looks like the feature reported as broken in #7974 actually gets us one step closer to the goal of this ticket. |
+1 for this. |
See also NixOS/nix#553 (comment). |
(triage) any new leads? |
There's a nix-diff tool which can do comparisons between derivations. This blog post shows it being used to compare 2 systems: http://www.haskellforall.com/2017/11/compare-nix-derivations-using-nix-diff.html |
Thank you for your contributions. This has been automatically marked as stale because it has had no activity for 180 days. If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity. Here are suggestions that might help resolve this more quickly:
|
still important to me |
Are there any ways we can take this forward? Simple first steps? |
I guess the export part would be a first step. system.extraSystemBuilderCmds = ''
ln -s ${./.} $out/full-config
''; because the last time I checked, system.copySystemConfiguration = true; only copies one file, not any imports it uses. It would be nice if all the files that are imported, but not other ones, would be copied by this option. |
I marked this as stale due to inactivity. → More info |
@Profpatsch Flakes solved this for me. NixOS records the git revision of the configuration repo [0]. [0] https://www.tweag.io/blog/2020-07-31-nixos-flakes/#hermetic-evaluation |
One problem raised by multiple users, almost since the beginning of the module system, is that there is no way to reproduce a configuration once it has been compiled, and it is hard to distinguish the differences between 2 NixOS generations.
To address these problems have to handle the following issues:
The text was updated successfully, but these errors were encountered: