[Nix-dev] nixops data deployment
Rok Garbas
rok at garbas.si
Sat Nov 2 00:26:51 CET 2013
Quoting Moritz Ulrich (2013-11-01 22:24:05)
> The correct way would be adding the data to the nix-store. This way
> you'd get all the benefits of Nix(OS): Atomic upgrades, easy switching
> between configurations, rollbacks, etc.
>
> Nix (the language) supports some functions to accomplish this:
>
> - builtins.readFile reads a file and returns the contents as string
> - pkgs.writeText can be used to write a string to a file in the nix
> store and returns the path to the file.
>
> You can use these (and some others) to read from a file (your whitelist) on your
> deploying machine (where you run nixops) and create a nix-store entry
> with the contents of the file and refer to it in other expressions (e.g.
> your postfix config).
>
if my memory serves me correctly we were talking about this at the last nixos
sprint.
problem was that you're never sure where certain process writes (all the logs,
tmp files, etc...) and it would be hard to generally do this. but with help of
linux containers it might be possible to move certain container to new
location. and if only one program runs there you know that you'll be only
moving its data.
--
Rok Garbas - http://www.garbas.si
More information about the nix-dev
mailing list