git.iko.soy/typeable/nixpkgs
on master help sign in
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.

commit56e18c50ccb53250e589724ca00f4dd53805bd56 authorDan Peebles <pumpkin@me.com> dateFri 13 Oct 2017, 09:17 (9 years ago) parentea1a925
4 files changed+3−77
nixos/modules/module-list.nix−2 nixos/modules/service-managers/docker.nix−29 nixos/modules/service-managers/trivial.nix−35 nixos/modules/services/security/hologram-server.nix+3−11
nixos/modules/module-list.nix−2
@@ -131,8 +131,6 @@
131131 ./security/rtkit.nix
132132 ./security/wrappers/default.nix
133133 ./security/sudo.nix
134− ./service-managers/docker.nix
135− ./service-managers/trivial.nix
136134 ./services/admin/salt/master.nix
137135 ./services/admin/salt/minion.nix
138136 ./services/amqp/activemq/default.nix
nixos/modules/service-managers/docker.nixdeleted−29
@@ -1,29 +0,0 @@
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−}
nixos/modules/service-managers/trivial.nixdeleted−35
@@ -1,35 +0,0 @@
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−}
nixos/modules/services/security/hologram-server.nix+3−11
@@ -23,8 +23,6 @@ let
2323 stats = cfg.statsAddress;
2424 listen = cfg.listenAddress;
2525 });
26−
27− script = "${pkgs.hologram.bin}/bin/hologram-server --debug --conf ${cfgFile}";
2826in {
2927 options = {
3028 services.hologram-server = {
@@ -96,15 +94,9 @@ in {
9694 after = [ "network.target" ];
9795 wantedBy = [ "multi-user.target" ];
9896
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+ };
108100 };
109101 };
110102}