1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-27 08:01:14 +00:00
nixpkgs/nixos/modules/services
Eelco Dolstra 2b0aea1793 Allow running NixOS services outside of systemd
The attribute ‘config.systemd.services.<service-name>.runner’
generates a script that runs the service outside of systemd.  This is
useful for testing, and also allows NixOS services to be used outside
of NixOS.  For instance, given a configuration file foo.nix:

  { config, pkgs, ... }:

  { services.postgresql.enable = true;
    services.postgresql.package = pkgs.postgresql92;
    services.postgresql.dataDir = "/tmp/postgres";
  }

you can build and run PostgreSQL as follows:

  $ nix-build -A config.systemd.services.postgresql.runner -I nixos-config=./foo.nix
  $ ./result

This will run the service's ExecStartPre, ExecStart, ExecStartPost and
ExecStopPost commands in an appropriate environment.  It doesn't work
well yet for "forking" services, since it can't track the main
process.  It also doesn't work for services that assume they're always
executed by root.
2013-11-18 18:04:17 +01:00
..
amqp Move all of NixOS to nixos/ in preparation of the repository merge 2013-10-10 13:28:20 +02:00
audio Substitute "types.uniq types.string" -> "types.str" 2013-10-30 14:57:42 +01:00
backup Move all of NixOS to nixos/ in preparation of the repository merge 2013-10-10 13:28:20 +02:00
databases Allow running NixOS services outside of systemd 2013-11-18 18:04:17 +01:00
games Strictly check the arguments to mkOption 2013-10-30 15:35:09 +01:00
hardware nixos: capitalize a bunch of service descriptions 2013-11-09 20:45:50 +01:00
logging nixos/logstash: add option examples 2013-11-01 17:15:54 +01:00
mail Substitute "types.uniq types.string" -> "types.str" 2013-10-30 14:57:42 +01:00
misc Add some primops to lib 2013-11-12 13:48:30 +01:00
monitoring nixos: capitalize a bunch of service descriptions 2013-11-09 20:45:50 +01:00
network-filesystems nixos: capitalize a bunch of service descriptions 2013-11-09 20:45:50 +01:00
networking networkmanager NixOS service: Make it possible to append or insert name servers in /etc/resolv.conf 2013-11-13 01:52:57 +01:00
printing Add lots of missing option types 2013-10-30 18:47:43 +01:00
scheduling fcron: Fix error when cron.mailto is null. 2013-11-04 11:07:11 +00:00
search Removed unnecessary mkIf 2013-11-05 08:52:23 +01:00
security Use the "assertions" option instead of mkAssert 2013-10-30 18:47:44 +01:00
system Add lots of missing option types 2013-10-30 18:47:43 +01:00
torrent Add some primops to lib 2013-11-12 13:48:30 +01:00
ttys Add lots of missing option types 2013-10-30 18:47:43 +01:00
web-servers mediawiki: Update to 1.20.7 2013-11-13 17:33:58 +01:00
x11 xfce: enable tumbler the thumbnail manager (close #1206) 2013-11-16 16:58:08 +01:00