nixpkgs/nixos
Jamey Sharp 8d40083690 nixos/stage-2: create empty machine-id at boot
Previously, the activation script was responsible for ensuring that
/etc/machine-id exists. However, the only time it could not already
exist is during stage-2-init, not while switching configurations,
because one of the first things systemd does when starting up as PID 1
is to create this file. So I've moved the initialization to
stage-2-init.

Furthermore, since systemd will do the equivalent of
systemd-machine-id-setup if /etc/machine-id doesn't have valid contents,
we don't need to do that ourselves.

We _do_, however, want to ensure that the file at least exists, because
systemd also uses the non-existence of this file to guess that this is a
first-boot situation. In that case, systemd tries to create some
symlinks in /etc/systemd/system according to its presets, which it can't
do because we've already populated /etc according to the current NixOS
configuration.

This is not necessary for any other activation script snippets, so it's
okay to do it after stage-2-init runs the activation script. None of
them declare a dependency on the "systemd" snippet. Also, most of them
only create files or directories in ways that obviously don't need the
machine-id set.
2018-09-30 10:45:35 -07:00
..
doc rabbitmq-server: 3.6.10 -> 3.7.8 2018-09-25 11:19:23 +02:00
lib nixos: doc: move non-service parts of `service.nixosManual` to `documentation.nixos` 2018-09-23 20:50:47 +00:00
maintainers create-amis.sh: Change directory for AMIs 2018-07-24 21:19:14 +02:00
modules nixos/stage-2: create empty machine-id at boot 2018-09-30 10:45:35 -07:00
tests nixos tests: move common configuration into separate file 2018-09-24 20:07:33 +01:00
COPYING
README
default.nix nixos: export packages of the current configuration (its `pkgs` argument) 2018-02-09 19:35:27 +00:00
release-combined.nix nixos/release-combined: remove keymap tests from tested job 2018-06-06 21:02:55 +02:00
release-small.nix Add the boot test to release-small.nix 2018-02-27 20:09:07 +01:00
release.nix nixos: doc: rename `manual` to `manualHTML`, cleanup references 2018-09-23 20:47:58 +00:00

README

*** NixOS ***

NixOS is a Linux distribution based on the purely functional package
management system Nix.  More information can be found at
http://nixos.org/nixos and in the manual in doc/manual.