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). Tim Barbour writes: > I understand that one advantage of nixops is being able to deploy a set of > services atomically, possibly including data that is needed by the services. > > What is the recommended way to get nixops to deploy some data for a service at > the same time it deploys the service ? > > I would like to be able to deploy some services (e.g. postfix) via nixops, > including required data (e.g. whitelist data). Obviously I could use something > else (like rsync) to deploy the data, but that would break the atomic > deployment, since the service could start before the data was available. > > Tim > _______________________________________________ > nix-dev mailing list > [email protected] > http://lists.science.uu.nl/mailman/listinfo/nix-dev -- Moritz Ulrich
pgpfE5blpq7iY.pgp
Description: PGP signature
_______________________________________________ nix-dev mailing list [email protected] http://lists.science.uu.nl/mailman/listinfo/nix-dev
