Go to file
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
.github treewide: remove mailing list references 2018-08-23 09:24:44 -07:00
doc Merge pull request #47238 from obsidiansystems/overrideScope-order 2018-09-24 18:04:18 -04:00
lib Merge pull request #47238 from obsidiansystems/overrideScope-order 2018-09-24 18:04:18 -04:00
maintainers Merge pull request #47270 from Vskilet/roundcube-package 2018-09-27 14:59:40 +01:00
nixos nixos/stage-2: create empty machine-id at boot 2018-09-30 10:45:35 -07:00
pkgs gnustep.system_preferences: 1.1.0 -> 1.2.0 (#45832) 2018-09-27 21:01:08 +02:00
.dir-locals.el .dir-locals.el: init 2018-07-06 12:48:43 -04:00
.editorconfig Revert ".version: remove final newline" 2018-04-28 14:23:13 +02:00
.gitattributes gitattributes: disable merge=union in all-packages 2018-03-27 11:03:03 -05:00
.gitignore kde5: consolidate packages into desktops/kde-5 2016-03-01 10:36:00 -06:00
.version 18.09 -> 19.03 2018-09-02 16:45:00 -04:00
COPYING 2018 will be the year of NixOS 2018-01-04 17:59:52 -05:00
default.nix Reference a local copy of the release notes in the 'version too old' warning, plus a redirect to the support links 2018-08-30 09:05:57 -04:00
README.md treewide: remove mailing list references 2018-08-23 09:24:44 -07:00

logo

Code Triagers Badge

Nixpkgs is a collection of packages for the Nix package manager. It is periodically built and tested by the Hydra build daemon as so-called channels. To get channel information via git, add nixpkgs-channels as a remote:

% git remote add channels https://github.com/NixOS/nixpkgs-channels.git

For stability and maximum binary package support, it is recommended to maintain custom changes on top of one of the channels, e.g. nixos-18.03 for the latest release and nixos-unstable for the latest successful build of master:

% git remote update channels
% git rebase channels/nixos-18.03

For pull-requests, please rebase onto nixpkgs master.

NixOS Linux distribution source code is located inside nixos/ folder.

Communication: