From b74ff190637490df7a79fd1872fff53d8921fd25 Mon Sep 17 00:00:00 2001 From: Peter Kolloch Date: Tue, 2 Jan 2024 19:36:08 +0100 Subject: [PATCH] Adding docs --- .github/workflows/static.yml | 2 +- docs/flake-module.nix | 6 +++--- nix/pre-commit/flake-module.nix | 3 ++- run_tests.sh | 12 ++++++++++++ 4 files changed, 18 insertions(+), 5 deletions(-) diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml index 4d5eef20..295a1b06 100644 --- a/.github/workflows/static.yml +++ b/.github/workflows/static.yml @@ -4,7 +4,7 @@ name: Deploy static content to Pages on: # Runs on pushes targeting the default branch push: - branches: ["master"] + branches: [ "master", "feature/docs" ] # Allows you to run this workflow manually from the Actions tab workflow_dispatch: diff --git a/docs/flake-module.nix b/docs/flake-module.nix index dfdbb74b..fa489bce 100644 --- a/docs/flake-module.nix +++ b/docs/flake-module.nix @@ -1,10 +1,10 @@ -{self, ...}: { +{ self, ... }: { perSystem = { config, self', inputs', pkgs, system, ... }: { packages.docs = pkgs.buildNpmPackage { pname = "docs"; version = "0.1.0"; - src = + src = pkgs.nix-gitignore.gitignoreSource [ ".vscode" "README.md" @@ -12,7 +12,7 @@ "nix" "flake.*" ] - ./.; + ./.; buildInputs = [ pkgs.vips diff --git a/nix/pre-commit/flake-module.nix b/nix/pre-commit/flake-module.nix index 0974bf4f..98e41177 100644 --- a/nix/pre-commit/flake-module.nix +++ b/nix/pre-commit/flake-module.nix @@ -16,7 +16,8 @@ # lint shell scripts shellcheck.enable = true; # nix format - nixpkgs-fmt.enable = true; + # TODO: need to preformat things accordingly and potentially use another formatter + # nixpkgs-fmt.enable = true; }; }; }; diff --git a/run_tests.sh b/run_tests.sh index 46e82acf..0e23fa3c 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -115,6 +115,18 @@ nix build -L "${NIX_OPTIONS[@]}" "${NIX_TESTS_OPTIONS[@]}" -f ./tests.nix || { exit 5 } +echo -e "\e[1m=== Building .#docs (= Generating GitHub Page resources)\e[0m" >&2 +rm -rf target/nix-result* +nix build -L "${NIX_OPTIONS[@]}" "${NIX_TESTS_OPTIONS[@]}" .#docs || { + echo "==================" >&2 + echo "cd $top" >&2 + echo "nix build -L \\" >&2 + echo " ${NIX_OPTIONS[*]} ${NIX_TESTS_OPTIONS[*]} \\" >&2 + echo " .#docs" + echo "=> FAILED" >&2 + exit 5 +} + echo -e "\e[1m=== Checking for uncomitted changes\e[0m" >&2 if test -n "$(git status --porcelain)"; then echo ""