-
Notifications
You must be signed in to change notification settings - Fork 60
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
A Question on morph and nix.autoUpgrade #176
Comments
Hi @evrim , Since Morph doesn't copy your configuration to the remote host automatically or anything, hence - by default - Hope this answered your question. :) |
Hey there, Thanks for the quick answer. Are there any unit/timer definitions somewhere for morph that I can employ for a nix.autoUpgrade replacement on my local machine? evrim. |
What I usually do is, I get rid of channels and Something like this:
The idea is to have pinned channels (via url) in NIX_PATH and always the latest channel (via url) during update. Please note:
|
Thnx for your clever solution. It led me thinking.
This solution actually works if you always update the system via morph. However, there are drawbacks:
Other than these above, everything seem to work. The solution I believe is making a pkg of nixos-config git, push it and refer to it. This way, the config paths will be the same contrary to what nix.gitignore does and nixos-rebuild switch will work as expected on the local machine. |
Hm, I thought I could find a fixpoint for the configs yet no luck. Any ideas? |
Thanks for finding the issue with the growing store path. I had that one before and fixed it in an earlier version. But now I created that bug again. Fixing this should work if we create a pkg for nixos-config. I like that idea. I stopped trying to create a fixpoint. The issue at the moment is, that a new config is always built form the old one, so it's basically a chain. But for me the config repo is really tiny and it gets cleaned up after some weeks anyway. Things that might work:
|
Finally I got it working. Basically the derivation outputs its path to config for the next time. 2 let
5 repo = if (config ? deployment)
6 then pkgs.callPackage ../pkg.nix {hostname = config.networking.hostName;}
7 else config.nixos-config-in-store;
31 in {
33 environment.etc."nixos".source = repo;
34 system.autoUpgrade.enable = true;
35 }
|
Just add the following that will prevent GC collecting the nixos-config.
Hope we'll never have to deal with this again. |
Hello,
I would like to know how morph and nix.autoUpgrade work together. Say I have a box A which I have an old /etc/nixos/configuration.nix in place and I have updated it with nix.autoUpgrade.enable = true; with morph from a remote box.
What should I expect the autoUpgrade function to do? Will it go and upgrade the machine via the old in-place /etc/nixos/configuration.nix or the current config derivation is stored in remote nix store and it will be re-eval'd to apply the autoUpgrade?
thnx,
evrim.
The text was updated successfully, but these errors were encountered: