shared: move shack config to shack/
This commit is contained in:
parent
e086914ce0
commit
90822f64e0
24
makefu/2configs/deployment/hound/default.nix
Normal file
24
makefu/2configs/deployment/hound/default.nix
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
{ config, pkgs, ... }:
|
||||||
|
{
|
||||||
|
services.nginx.virtualHosts."wikisearch.krebsco.de".locations."/".proxyPass = "http://localhost:6080";
|
||||||
|
services.hound = {
|
||||||
|
enable = true;
|
||||||
|
listen = "127.0.0.1:6080";
|
||||||
|
# package = pkgs.hound.overrideDerivation(oldAttrs: {
|
||||||
|
# patches = [ ./keep-repo.patch ];
|
||||||
|
# });
|
||||||
|
config = ''{
|
||||||
|
"max-concurrent-indexers" : 2,
|
||||||
|
"dbpath" : "${config.services.hound.home}/data",
|
||||||
|
"repos" : {
|
||||||
|
"nixos-users-wiki": {
|
||||||
|
"url" : "https://github.com/nixos-users/wiki.wiki.git",
|
||||||
|
"url-pattern" : {
|
||||||
|
"base-url" : "{url}/{path}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}'';
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
@ -6,16 +6,21 @@ in
|
|||||||
imports = [
|
imports = [
|
||||||
../.
|
../.
|
||||||
<nixpkgs/nixos/modules/profiles/qemu-guest.nix>
|
<nixpkgs/nixos/modules/profiles/qemu-guest.nix>
|
||||||
../2configs/cgit-mirror.nix
|
|
||||||
../2configs/collectd-base.nix
|
../2configs/collectd-base.nix
|
||||||
../2configs/graphite.nix
|
../2configs/shack/share.nix
|
||||||
../2configs/repo-sync.nix
|
|
||||||
../2configs/shack-drivedroid.nix
|
|
||||||
../2configs/shack-nix-cacher.nix
|
|
||||||
../2configs/shared-buildbot.nix
|
|
||||||
../2configs/share-shack.nix
|
|
||||||
../2configs/central-stats-client.nix
|
../2configs/central-stats-client.nix
|
||||||
../2configs/save-diskspace.nix
|
../2configs/save-diskspace.nix
|
||||||
|
|
||||||
|
../2configs/cgit-mirror.nix
|
||||||
|
../2configs/graphite.nix
|
||||||
|
../2configs/repo-sync.nix
|
||||||
|
../2configs/shared-buildbot.nix
|
||||||
|
../2configs/shack/drivedroid.nix
|
||||||
|
../2configs/shack/nix-cacher.nix
|
||||||
|
|
||||||
|
../2configs/shack/mqtt_sub.nix
|
||||||
|
../2configs/shack/muell_caller.nix
|
||||||
|
|
||||||
];
|
];
|
||||||
# use your own binary cache, fallback use cache.nixos.org (which is used by
|
# use your own binary cache, fallback use cache.nixos.org (which is used by
|
||||||
# apt-cacher-ng in first place)
|
# apt-cacher-ng in first place)
|
||||||
|
34
shared/2configs/shack/mqtt_sub.nix
Normal file
34
shared/2configs/shack/mqtt_sub.nix
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
with import <stockholm/lib>;
|
||||||
|
let
|
||||||
|
pkg = pkgs.stdenv.mkDerivation {
|
||||||
|
name = "mqtt2graphite-2017-05-29";
|
||||||
|
src = pkgs.fetchgit {
|
||||||
|
url = "https://github.com/shackspace/mqtt2graphite/";
|
||||||
|
rev = "8c060e6";
|
||||||
|
sha256 = "06x7a1j6sfyvvdxg0366fcslhn478anqh4m5hljyf0z29knvz7pg";
|
||||||
|
};
|
||||||
|
buildInputs = [
|
||||||
|
(pkgs.python35.withPackages (pythonPackages: with pythonPackages; [
|
||||||
|
docopt
|
||||||
|
paho-mqtt
|
||||||
|
]))
|
||||||
|
];
|
||||||
|
installPhase = ''
|
||||||
|
install -m755 -D sub.py $out/bin/sub
|
||||||
|
install -m755 -D sub2.py $out/bin/sub-new
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
in {
|
||||||
|
systemd.services.mqtt_sub = {
|
||||||
|
description = "subscribe to mqtt, send to graphite";
|
||||||
|
# after = [ (lib.optional config.services.mosqitto.enable "mosquitto.service") ];
|
||||||
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
serviceConfig = {
|
||||||
|
User = "nobody";
|
||||||
|
ExecStart = "${pkg}/bin/sub-new";
|
||||||
|
PrivateTmp = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
41
shared/2configs/shack/muell_caller.nix
Normal file
41
shared/2configs/shack/muell_caller.nix
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
with import <stockholm/lib>;
|
||||||
|
let
|
||||||
|
pkg = pkgs.stdenv.mkDerivation {
|
||||||
|
name = "muell_caller-2017-06-01";
|
||||||
|
src = pkgs.fetchgit {
|
||||||
|
url = "https://github.com/shackspace/muell_caller/";
|
||||||
|
rev = "bbd4009";
|
||||||
|
sha256 = "06xaa1j6sfyvvdxg0366fcslhn478anqh4m5hljyf0z29knvz7pg";
|
||||||
|
};
|
||||||
|
buildInputs = [
|
||||||
|
(pkgs.python3.withPackages (pythonPackages: with pythonPackages; [
|
||||||
|
docopt
|
||||||
|
requests
|
||||||
|
paramiko
|
||||||
|
python
|
||||||
|
]))
|
||||||
|
];
|
||||||
|
installPhase = ''
|
||||||
|
install -m755 -D call.py $out/bin/call-muell
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
cfg = "${toString <secrets>}/tell.json";
|
||||||
|
in {
|
||||||
|
systemd.services.mqtt_sub = {
|
||||||
|
description = "call muell";
|
||||||
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
serviceConfig = {
|
||||||
|
User = "nobody"; # TODO separate user
|
||||||
|
ExecStartPre = writeDash "call-muell-pre" ''
|
||||||
|
cp ${cfg} /tmp/tell.json
|
||||||
|
chown nobody /tmp/tell.json
|
||||||
|
'';
|
||||||
|
ExecStart = "${pkg}/bin/call-muell --cfg /tmp/tell.json --mode mpd loop 60";
|
||||||
|
Restart = "always";
|
||||||
|
PrivateTmp = true;
|
||||||
|
PermissionsStartOnly = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user