[Nix-dev] NixOS on systemd

Eelco Dolstra eelco.dolstra at logicblox.com
Thu Aug 30 20:51:14 CEST 2012


Hi all,

For the last few months I've been working on and off on replacing Upstart with
systemd as NixOS's init system.  This is now in a fairly usable state.  (I'm
running it on my own laptop, but it hasn't been widely tested and there are
undoubtedly many issues remaining.)

If you want to test it, do:

$ git clone -b systemd git://github.com/edolstra/nixos.git nixos-systemd
$ nixos-rebuild switch -I nixos=/path/to/nixos-systemd
$ reboot

The reboot is required to switch to systemd.

Things to note:

* You can see and manage systemd units using "systemctl".  As a convenience for
Upstart users, there are shell aliases "start", "stop" and "status" that run the
corresponding "systemctl" command.  E.g. "status httpd" shows the status of the
httpd.service unit.

* Systemd service units can be defined through the boot.systemd.services option.
 For compatibility, Upstart jobs defined in the "jobs" option are automatically
converted to systemd services.  (See modules/system/upstart/upstart.nix.)
However, this mapping is not perfect.  In particular, Upstart-specific
constructs such as startOn and extraConfig should be rewritten.

* ConsoleKit is gone.  Its role has been taken over by logind.  Use "loginctl"
to manage user sessions.  Every user session runs in a separate cgroup (see
"systemd-cgls" and "systemd-cgtop" for a nice view).

* Syslogd no longer runs by default since systemd provides its own journal
service.  This means /var/log/{messages,warn} are not used.  Instead you can run
"journalctl" or "systemctl status" to see log messages.

* KDE 4.7 can no longer suspend/hibernate.  Maybe a newer KDE fixes this.  You
can however run "systemctl suspend" or "systemctl hibernate" (as a logged-in user).

* There is no getty/login started on tty1.

-- 
Eelco Dolstra | LogicBlox, Inc. | http://nixos.org/~eelco/


More information about the nix-dev mailing list