summaryrefslogtreecommitdiffstats
path: root/lass
diff options
context:
space:
mode:
Diffstat (limited to 'lass')
-rw-r--r--lass/2configs/fysiirc.nix9
-rw-r--r--lass/krops.nix14
2 files changed, 13 insertions, 10 deletions
diff --git a/lass/2configs/fysiirc.nix b/lass/2configs/fysiirc.nix
index e12eda42e..809298df4 100644
--- a/lass/2configs/fysiirc.nix
+++ b/lass/2configs/fysiirc.nix
@@ -10,8 +10,7 @@
${write_to_irc} "$(echo "$INPUT" | jq -r '
"\(.action): " +
"[\(.issue.title // .pull_request.title)] " +
- "\(.comment.html_url // .issue.html_url // .pull_request.html_url) " +
- "by \(.comment.user.login // .issue.user.login // .pull_request.user.login)"
+ "\(.comment.html_url // .issue.html_url // .pull_request.html_url) "
')"
fi
'';
@@ -58,16 +57,16 @@ in {
case "$Method $Request_URI" in
"POST /")
payload=$(head -c "$req_content_length")
- echo "$payload" >&2
+ raw=$(printf '%s' "$payload" | ${pkgs.curl}/bin/curl --data-binary @- http://p.krebsco.de | tail -1)
payload2=$payload
- payload2=$(echo "$payload" | tr '\n' ' ' | tr -d '\r')
+ payload2=$(printf '%s' "$payload" | tr '\n' ' ' | tr -d '\r')
if [ "$payload" != "$payload2" ]; then
echo "payload has been mangled" >&2
else
echo "payload not mangled" >&2
fi
- echo "$payload2" > /tmp/last_fysi_payload
echo "$payload2" | ${format-github-message}/bin/format-github-message
+ ${write_to_irc} "$raw"
printf 'HTTP/1.1 200 OK\r\n'
printf 'Connection: close\r\n'
printf '\r\n'
diff --git a/lass/krops.nix b/lass/krops.nix
index ace37888f..c8a5b94b7 100644
--- a/lass/krops.nix
+++ b/lass/krops.nix
@@ -37,18 +37,22 @@
in {
- deploy = { target ? "root@${name}/var/src" }: pkgs.krops.writeCommand "deploy" {
+ deploy = { target ? "root@${name}/var/src", offline ? false }: pkgs.krops.writeCommand "deploy" {
command = targetPath: ''
- set -fu
+ set -xfu
outDir=$(mktemp -d)
trap "rm -rf $outDir;" INT TERM EXIT
- nix build \
+ build=$(command -v nom-build || echo "nix-build")
+
+ $build \
-I "${targetPath}" \
- -f '<nixpkgs/nixos>' config.system.build.toplevel \
- -o "$outDir/out"
+ '<nixpkgs/nixos>' -A config.system.build.toplevel \
+ -o "$outDir/out" \
+ ${lib.optionalString offline "--option substitute false"} \
+ # -vvvvv --show-trace
nix-env -p /nix/var/nix/profiles/system --set "$outDir/out"