lol
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

+77 -3
+2
nixos/modules/module-list.nix
··· 129 129 ./security/rtkit.nix 130 130 ./security/wrappers/default.nix 131 131 ./security/sudo.nix 132 + ./service-managers/docker.nix 133 + ./service-managers/trivial.nix 132 134 ./services/admin/salt/master.nix 133 135 ./services/admin/salt/minion.nix 134 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 + 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 + }
+11 -3
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}"; 26 28 in { 27 29 options = { 28 30 services.hologram-server = { ··· 94 96 after = [ "network.target" ]; 95 97 wantedBy = [ "multi-user.target" ]; 96 98 97 - serviceConfig = { 98 - ExecStart = "${pkgs.hologram.bin}/bin/hologram-server --debug --conf ${cfgFile}"; 99 - }; 99 + inherit script; 100 + }; 101 + 102 + docker-containers.hologram-server = { 103 + inherit script; 104 + }; 105 + 106 + trivial-services.hologram-server = { 107 + inherit script; 100 108 }; 101 109 }; 102 110 }