Revert "Simple proof of concept for how to do other types of services"

This reverts commit 7c3253e519a572f90a907fc56bb6407da004b24c.

I included this in another push by accident and never intended for it to
be in mainline. See https://github.com/NixOS/nixpkgs/pull/26075 if you
want more.

+3 -77
-2
nixos/modules/module-list.nix
··· 131 131 ./security/rtkit.nix 132 132 ./security/wrappers/default.nix 133 133 ./security/sudo.nix 134 - ./service-managers/docker.nix 135 - ./service-managers/trivial.nix 136 134 ./services/admin/salt/master.nix 137 135 ./services/admin/salt/minion.nix 138 136 ./services/amqp/activemq/default.nix
-29
nixos/modules/service-managers/docker.nix
··· 1 - { config, lib, pkgs, ... }: 2 - 3 - with lib; 4 - 5 - let 6 - cfg = config.docker-containers; 7 - 8 - containerModule = { 9 - options.script = mkOption { 10 - type = types.lines; 11 - description = "Shell commands executed as the service's main process."; 12 - }; 13 - }; 14 - 15 - toContainer = name: value: pkgs.dockerTools.buildImage { 16 - inherit name; 17 - config = { 18 - Cmd = [ value.script ]; 19 - }; 20 - }; 21 - in { 22 - options.docker-containers = mkOption { 23 - default = {}; 24 - type = with types; attrsOf (types.submodule containerModule); 25 - description = "Definition of docker containers"; 26 - }; 27 - 28 - config.system.build.toplevel-docker = lib.mapAttrs toContainer cfg; 29 - }
-35
nixos/modules/service-managers/trivial.nix
··· 1 - { config, lib, pkgs, ... }: 2 - 3 - with lib; 4 - 5 - let 6 - cfg = config.trivial-services; 7 - 8 - serviceModule.options = { 9 - script = mkOption { 10 - type = types.lines; 11 - description = "Shell commands executed as the service's main process."; 12 - }; 13 - 14 - environment = mkOption { 15 - default = {}; 16 - type = types.attrs; # FIXME 17 - example = { PATH = "/foo/bar/bin"; LANG = "nl_NL.UTF-8"; }; 18 - description = "Environment variables passed to the service's processes."; 19 - }; 20 - }; 21 - 22 - launcher = name: value: pkgs.writeScript name '' 23 - #!${pkgs.stdenv.shell} -eu 24 - 25 - ${pkgs.writeScript "${name}-entry" value.script} 26 - ''; 27 - in { 28 - options.trivial-services = mkOption { 29 - default = {}; 30 - type = with types; attrsOf (types.submodule serviceModule); 31 - description = "Definition of trivial services"; 32 - }; 33 - 34 - config.system.build.toplevel-trivial = lib.mapAttrs launcher cfg; 35 - }
+3 -11
nixos/modules/services/security/hologram-server.nix
··· 23 23 stats = cfg.statsAddress; 24 24 listen = cfg.listenAddress; 25 25 }); 26 - 27 - script = "${pkgs.hologram.bin}/bin/hologram-server --debug --conf ${cfgFile}"; 28 26 in { 29 27 options = { 30 28 services.hologram-server = { ··· 96 94 after = [ "network.target" ]; 97 95 wantedBy = [ "multi-user.target" ]; 98 96 99 - inherit script; 100 - }; 101 - 102 - docker-containers.hologram-server = { 103 - inherit script; 104 - }; 105 - 106 - trivial-services.hologram-server = { 107 - inherit script; 97 + serviceConfig = { 98 + ExecStart = "${pkgs.hologram.bin}/bin/hologram-server --debug --conf ${cfgFile}"; 99 + }; 108 100 }; 109 101 }; 110 102 }