diff --git a/.gitignore b/.gitignore index c048b66..904a5f2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,8 @@ -/flake.lock +# Do not edit this file. It is automatically generated by https://www.oliverdavies.uk/build-configs. + /output_*/ /vendor/ + +/.direnv/ + +/flake.lock diff --git a/build.yaml b/build.yaml new file mode 100644 index 0000000..7295f2f --- /dev/null +++ b/build.yaml @@ -0,0 +1,13 @@ +name: sculpin-skeleton +type: sculpin +language: php + +flake: + devshell: + packages: + - php81 + - php81Packages.composer + +git: + ignore: + - /flake.lock diff --git a/flake.nix b/flake.nix index 5fa7e1b..a149852 100644 --- a/flake.nix +++ b/flake.nix @@ -1,9 +1,9 @@ -{ - description = "oliverdavies.uk-sculpin"; +# Do not edit this file. It is automatically generated by https://www.oliverdavies.uk/build-configs. +{ inputs = { devshell.url = "github:numtide/devshell"; - nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11"; + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; }; outputs = inputs@{ flake-parts, ... }: @@ -14,7 +14,10 @@ perSystem = { config, self', inputs', pkgs, system, ... }: { devshells.default = { - packages = with pkgs; [ "php81" "php81Packages.composer" ]; + packages = with pkgs; [ + "php81" + "php81Packages.composer" + ]; }; }; }; diff --git a/run b/run new file mode 100755 index 0000000..dfe82d3 --- /dev/null +++ b/run @@ -0,0 +1,41 @@ +#!/usr/bin/env bash + +set -o errexit +set -o nounset +set -o pipefail + +PATH="${PATH}:./vendor/bin" + +# Generate the site. +function generate { + local args=() + + if [[ "${APP_ENV:-}" == "production" ]]; then + args=(--env="prod") + else + args=(--server --watch) + fi + + sculpin generate "${args[@]}" +} + +function help { + printf "%s [args]\n\nTasks:\n" "${0}" + + compgen -A function | grep -v "^_" | cat -n + + printf "\nExtended help:\n Each task has comments for general usage\n" +} + +# Start the project. +function start { + sculpin generate --server --watch "${@}" +} + +# Include any local tasks. +[[ -e run.local ]] && source run.local + +TIMEFORMAT="Task completed in %3lR" +time "${@:-help}" + +# vim: ft=bash