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.
This commit is contained in:
parent
ea1a925a95
commit
56e18c50cc
@ -131,8 +131,6 @@
|
|||||||
./security/rtkit.nix
|
./security/rtkit.nix
|
||||||
./security/wrappers/default.nix
|
./security/wrappers/default.nix
|
||||||
./security/sudo.nix
|
./security/sudo.nix
|
||||||
./service-managers/docker.nix
|
|
||||||
./service-managers/trivial.nix
|
|
||||||
./services/admin/salt/master.nix
|
./services/admin/salt/master.nix
|
||||||
./services/admin/salt/minion.nix
|
./services/admin/salt/minion.nix
|
||||||
./services/amqp/activemq/default.nix
|
./services/amqp/activemq/default.nix
|
||||||
|
@ -1,29 +0,0 @@
|
|||||||
{ config, lib, pkgs, ... }:
|
|
||||||
|
|
||||||
with lib;
|
|
||||||
|
|
||||||
let
|
|
||||||
cfg = config.docker-containers;
|
|
||||||
|
|
||||||
containerModule = {
|
|
||||||
options.script = mkOption {
|
|
||||||
type = types.lines;
|
|
||||||
description = "Shell commands executed as the service's main process.";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
toContainer = name: value: pkgs.dockerTools.buildImage {
|
|
||||||
inherit name;
|
|
||||||
config = {
|
|
||||||
Cmd = [ value.script ];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
in {
|
|
||||||
options.docker-containers = mkOption {
|
|
||||||
default = {};
|
|
||||||
type = with types; attrsOf (types.submodule containerModule);
|
|
||||||
description = "Definition of docker containers";
|
|
||||||
};
|
|
||||||
|
|
||||||
config.system.build.toplevel-docker = lib.mapAttrs toContainer cfg;
|
|
||||||
}
|
|
@ -1,35 +0,0 @@
|
|||||||
{ config, lib, pkgs, ... }:
|
|
||||||
|
|
||||||
with lib;
|
|
||||||
|
|
||||||
let
|
|
||||||
cfg = config.trivial-services;
|
|
||||||
|
|
||||||
serviceModule.options = {
|
|
||||||
script = mkOption {
|
|
||||||
type = types.lines;
|
|
||||||
description = "Shell commands executed as the service's main process.";
|
|
||||||
};
|
|
||||||
|
|
||||||
environment = mkOption {
|
|
||||||
default = {};
|
|
||||||
type = types.attrs; # FIXME
|
|
||||||
example = { PATH = "/foo/bar/bin"; LANG = "nl_NL.UTF-8"; };
|
|
||||||
description = "Environment variables passed to the service's processes.";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
launcher = name: value: pkgs.writeScript name ''
|
|
||||||
#!${pkgs.stdenv.shell} -eu
|
|
||||||
|
|
||||||
${pkgs.writeScript "${name}-entry" value.script}
|
|
||||||
'';
|
|
||||||
in {
|
|
||||||
options.trivial-services = mkOption {
|
|
||||||
default = {};
|
|
||||||
type = with types; attrsOf (types.submodule serviceModule);
|
|
||||||
description = "Definition of trivial services";
|
|
||||||
};
|
|
||||||
|
|
||||||
config.system.build.toplevel-trivial = lib.mapAttrs launcher cfg;
|
|
||||||
}
|
|
@ -23,8 +23,6 @@ let
|
|||||||
stats = cfg.statsAddress;
|
stats = cfg.statsAddress;
|
||||||
listen = cfg.listenAddress;
|
listen = cfg.listenAddress;
|
||||||
});
|
});
|
||||||
|
|
||||||
script = "${pkgs.hologram.bin}/bin/hologram-server --debug --conf ${cfgFile}";
|
|
||||||
in {
|
in {
|
||||||
options = {
|
options = {
|
||||||
services.hologram-server = {
|
services.hologram-server = {
|
||||||
@ -96,15 +94,9 @@ in {
|
|||||||
after = [ "network.target" ];
|
after = [ "network.target" ];
|
||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
|
||||||
inherit script;
|
serviceConfig = {
|
||||||
};
|
ExecStart = "${pkgs.hologram.bin}/bin/hologram-server --debug --conf ${cfgFile}";
|
||||||
|
};
|
||||||
docker-containers.hologram-server = {
|
|
||||||
inherit script;
|
|
||||||
};
|
|
||||||
|
|
||||||
trivial-services.hologram-server = {
|
|
||||||
inherit script;
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user