From nix-dev Fri Sep 16 18:31:54 2016 From: Arnold Krille Date: Fri, 16 Sep 2016 18:31:54 +0000 To: nix-dev Subject: Re: [Nix-dev] /etc/nixos/configuration.nix not versioned? Message-Id: <20160916203154.6d067ea2 () xingu ! arnoldarts ! de> X-MARC-Message: https://marc.info/?l=nix-dev&m=147405074123979 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--===============7310460409637074251==" --===============7310460409637074251== Content-Type: multipart/signed; micalg=pgp-sha256; boundary="Sig_/yvMpj_uBjhQmEXqWTwczfaL"; protocol="application/pgp-signature" --Sig_/yvMpj_uBjhQmEXqWTwczfaL Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi, On Fri, 16 Sep 2016 09:13:27 -0700 Wink Saville wrote: > As a newbie I was playing around and last night I rolled back to an > older configuration and realized that the configuration.nix file > didn't rollback. I can now realize that configuration.nix has nothing > to do with booting or running the system and it only builds the > system. >=20 > But at the moment I have 20 variations of my system in > /boot/loader/entries/* but only the "latest" > /etc/nixos/configuration.nix. So how are people managing > configuration.nix files and keeping them 'synchronized' with /boot/**/ > in particular /boot/loader/entries/* ? >=20 > What I've just done is put /etc/nixos into a git repository, but that > puts the burden on me to keep it synchronized with the > /boot/loader/entries. Hopefully there is a better way. /etc/nixos/configuration.nix (and the files included there) is the one place that nix can not manage for you. It could save a copy somewhere within the activated profile. But it can not modify/move the file itself. Consider this: * You have a working configuration * You change configuration.nix * You build the new config and switch to it (temporarily with 'nixos-rebuilt test') * You realize something is not working as expected and roll back to the next older version for the moment. Now when nixos moves the configuration for you, you will be back to the state before you started the config changes. You have no way of going forward again and especially no way of modifying the forward configuration and fixing it. Because its not there anymore=E2=80=A6 What I am doing[1] is: * there is /etc/nixos/nixconfig/ directory which is actually a git checkout. * /etc/nixos/configuration.nix basically imports everything from within that nixconfig//default.nix * the nixconfig also has nixpkgs as submodule in git and uses that as source instead of any channels. That way I have full control over which configuration should be running. And also about which version of the nixpkgs is used. I can run tests on the system-config before pushing the config to master and rebuilding my server(s) into a non-working state. I have master, staging and story-branches and can test the next nixos-release in the tests of my systems before applying it to the actual machines. The combination of full system description, full control over the package state and full testability is what makes my daily work-life very miserable. Because I have this at home but not at work:-/ Have fun, Arnold [1] A bit outdated because my main repo is locally, but https://github.com/kampfschlaefer/nixconfig has my systems config. --Sig_/yvMpj_uBjhQmEXqWTwczfaL Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iF4EAREIAAYFAlfcOp0ACgkQtuvagsE+DE41TQD/TKfPz9jG0pQgjhTcxV71kWSg CMUOgaIHJLOeyQXPKT4BAOP5rLzxyZTeckEu5X1/62hnXkmDTiYxAH6bizHEs3IG =ndJa -----END PGP SIGNATURE----- --Sig_/yvMpj_uBjhQmEXqWTwczfaL-- --===============7310460409637074251== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev --===============7310460409637074251==--