aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xdhall/dhall-gen.sh7
-rw-r--r--dhall/repos.txt1
-rw-r--r--dhall/sr-ht-build.dhall47
-rw-r--r--nixos/configuration.nix3
l---------scripts/dhall-gen.sh1
5 files changed, 58 insertions, 1 deletions
diff --git a/dhall/dhall-gen.sh b/dhall/dhall-gen.sh
new file mode 100755
index 0000000..9bba429
--- /dev/null
+++ b/dhall/dhall-gen.sh
@@ -0,0 +1,7 @@
+#!/usr/bin/env bash
+
+REPOS_PATH="$HOME/dev/libre"
+
+for repo in $(cat repos.txt); do
+ dhall 2> /dev/null <<< "./sr-ht-build.dhall \"$repo\"" | dhall-to-json --pretty > "$REPOS_PATH/$repo/.build.yml"
+done
diff --git a/dhall/repos.txt b/dhall/repos.txt
new file mode 100644
index 0000000..0154e4c
--- /dev/null
+++ b/dhall/repos.txt
@@ -0,0 +1 @@
+website
diff --git a/dhall/sr-ht-build.dhall b/dhall/sr-ht-build.dhall
new file mode 100644
index 0000000..41b937b
--- /dev/null
+++ b/dhall/sr-ht-build.dhall
@@ -0,0 +1,47 @@
+-- let buildTemplate =
+ λ ( repoName
+ : Text
+ )
+ → { image =
+ "debian/stretch"
+ , packages =
+ [ "curl" ]
+ , triggers =
+ [ { condition =
+ "failure"
+ , action =
+ "email"
+ , to =
+ "EuAndreh <eu@euandre.org>"
+ }
+ ]
+ , sources =
+ [ "https://git.sr.ht/~euandreh/" ++ repoName ]
+ , secrets =
+ [ "7159f943-811f-402d-bb6d-37cd764dc728" ]
+ , tasks =
+ [ { mapKey =
+ "setup"
+ , mapValue =
+ ''
+ curl https://nixos.org/nix/install | sh
+ echo '. $HOME/.nix-profile/etc/profile.d/nix.sh' >> $HOME/.buildenv''
+ },
+ { mapKey =
+ "test"
+ , mapValue =
+ ''
+ cd ${repoName}/
+ nix-build -A test''
+ },
+ { mapKey =
+ "publish"
+ , mapValue =
+ ''
+ cd ${repoName}/
+ nix-build -A publishScript
+ source env.sh
+ ./result/bin/publish.sh''
+ }
+ ]
+ }
diff --git a/nixos/configuration.nix b/nixos/configuration.nix
index 657c37b..cfa4b02 100644
--- a/nixos/configuration.nix
+++ b/nixos/configuration.nix
@@ -241,7 +241,8 @@
bats
ledger
perl
-
+ dhall
+ dhall-json
nodePackages.node2nix
shellcheck
(haskell.lib.justStaticExecutables haskellPackages.github-backup)
diff --git a/scripts/dhall-gen.sh b/scripts/dhall-gen.sh
new file mode 120000
index 0000000..75b8290
--- /dev/null
+++ b/scripts/dhall-gen.sh
@@ -0,0 +1 @@
+../dhall/dhall-gen.sh \ No newline at end of file