diff options
author | EuAndreh <eu@euandre.org> | 2018-12-30 22:37:39 -0200 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2018-12-30 22:37:39 -0200 |
commit | 67e642010bebd95b133592fc81637360d8fae0f0 (patch) | |
tree | 4fa01517bb209580b2030fa92066e3315ae7bd60 | |
parent | Add shellcheck, github-backup and node2nix packages. (diff) | |
download | dotfiles-67e642010bebd95b133592fc81637360d8fae0f0.tar.gz dotfiles-67e642010bebd95b133592fc81637360d8fae0f0.tar.xz |
Start playing with Dhall to generate yaml.
-rwxr-xr-x | dhall/dhall-gen.sh | 7 | ||||
-rw-r--r-- | dhall/repos.txt | 1 | ||||
-rw-r--r-- | dhall/sr-ht-build.dhall | 47 | ||||
-rw-r--r-- | nixos/configuration.nix | 3 | ||||
l--------- | scripts/dhall-gen.sh | 1 |
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 |