[Nix-dev] Proposal: Standard installation procedure
Eelco Dolstra
eelco.dolstra at logicblox.com
Wed Oct 22 15:10:35 CEST 2014
Hi,
On 22/10/14 11:55, Ertugrul Söylemez wrote:
> How would I refer to multiple systems with different configurations from
> within a Nix expression? The change would allow this:
>
> { system1 = import <nixos/build-system.nix> module1;
> system2 = import <nixos/build-system.nix> module2;
> system3 = import <nixos/build-system.nix> module3; }
<nixpkgs/nixos> accepts a ‘configuration’ parameter, e.g.
$ nix-build '<nixpkgs/nixos>' -A system --arg configuration \
'{ fileSystems = ... ; services.httpd.enable = true; }'
You can also call <nixpkgs/nixos/lib/eval-config.nix>, which accepts an
arbitrary list of modules.
>> Programs like nixos-rebuild, nixos-install, nixos-container and even
>> NixOps are really just wrappers around this (except that they add
>> various levels of provisioning).
>
> They all make the assumption that there is exactly one current system
> configuration.
NixOps builds/deploys multiple machines at the same time, so it can deal with an
arbitrary number of configurations.
--
Eelco Dolstra | LogicBlox, Inc. | http://nixos.org/~eelco/
More information about the nix-dev
mailing list