summaryrefslogtreecommitdiffstats
path: root/makefu/2configs/shack
diff options
context:
space:
mode:
authorlassulus <lass@blue.r>2018-11-10 19:42:46 +0100
committerlassulus <lass@blue.r>2018-11-10 19:42:46 +0100
commiteff97662c02f385b1740929639817fc5b8318f07 (patch)
treef11710101eed0dcc8d75304939f06e819339d9f0 /makefu/2configs/shack
parent0028e3dde3dcb8e5e9394f7d230c7224b6177b79 (diff)
parent254e9e62b95951cecadd2b4800c03ef96f95b3c0 (diff)
Merge remote-tracking branch 'nextgum/master'
Diffstat (limited to 'makefu/2configs/shack')
-rw-r--r--makefu/2configs/shack/events-publisher/default.nix49
-rw-r--r--makefu/2configs/shack/gitlab-runner/default.nix31
2 files changed, 80 insertions, 0 deletions
diff --git a/makefu/2configs/shack/events-publisher/default.nix b/makefu/2configs/shack/events-publisher/default.nix
new file mode 100644
index 000000000..531d2525e
--- /dev/null
+++ b/makefu/2configs/shack/events-publisher/default.nix
@@ -0,0 +1,49 @@
+{ pkgs, ... }:
+with import <stockholm/lib>;
+let
+ shack-announce = pkgs.callPackage (builtins.fetchTarball {
+ url = "https://github.com/makefu/events-publisher/archive/670f4d7182a41b6763296e301612499d2986f213.tar.gz";
+ sha256 = "1yf9cb08v4rc6x992yx5lcyn62sm3p8i2b48rsmr4m66xdi4bpnd";
+ }) {} ;
+ home = "/var/lib/shackannounce";
+ user = "shackannounce";
+ creds = (toString <secrets>) + "/shack-announce.json";
+ LOL = "DEBUG";
+in
+{
+ users.users.${user}= {
+ uid = genid user;
+ inherit home;
+ createHome = true;
+ };
+ systemd.services.shack-announce = {
+ description = "Announce shack events";
+ startAt = "*:0/30";
+ path = [ shack-announce ];
+ serviceConfig = {
+ WorkingDirectory = home;
+ User = user;
+ PermissionsStartOnly = true;
+ ExecStartPre = pkgs.writeDash "shack-announce-pre" ''
+ set -eu
+ cp ${creds} creds.json
+ chown ${user} creds.json
+ '';
+ ExecStart = pkgs.writeDash "shack-announce" ''
+ if test ! -e announce.state; then
+ echo "initializing state"
+ announce-daemon \
+ --lol ${LOL} \
+ --creds creds.json \
+ --state announce.state \
+ --clean --init
+ fi
+ echo "Running announce"
+ announce-daemon \
+ --lol ${LOL} \
+ --creds creds.json \
+ --state announce.state
+ '';
+ };
+ };
+}
diff --git a/makefu/2configs/shack/gitlab-runner/default.nix b/makefu/2configs/shack/gitlab-runner/default.nix
new file mode 100644
index 000000000..55dc50fa8
--- /dev/null
+++ b/makefu/2configs/shack/gitlab-runner/default.nix
@@ -0,0 +1,31 @@
+
+{
+ systemd.services.gitlab-runner.path = [
+ "/run/wrappers" # /run/wrappers/bin/su
+ "/" # /bin/sh
+ ];
+ services.gitlab-runner = {
+ enable = true;
+ configOptions =
+ { concurrent = 1;
+ runners = [
+ { builds_dir = "";
+ #docker =
+ #{ cache_dir = "";
+ # disable_cache = true;
+ # host = ""; image = "nixos/nix:2.1.3";
+ # privileged = true;
+ #};
+ #executor = "docker";
+ # name = "docker-nix";
+ name = "gum-shell";
+ executor = "shell";
+ environment = [ "PATH=/bin:/run/wrappers/bin:/etc/per-user/gitlab-runner/bin:/etc/per-user-pkgs/gitlab-runner/bin:/nix/var/nix/profiles/default/bin:/run/current-system/sw/bin" ];
+ # generate via `gitlab-runner register`
+ token = import <secrets/shackspace-gitlab-ci-token.nix>;
+ url = "https://git.shackspace.de/";
+ }
+ ];
+ };
+ };
+}