Manage configuration files with Build Configs

https://www.oliverdavies.dev/build-configs
This commit is contained in:
Oliver Davies 2024-01-26 08:22:22 +00:00
parent 143009ab60
commit eb3273a53b
4 changed files with 67 additions and 5 deletions

7
.gitignore vendored
View file

@ -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

13
build.yaml Normal file
View file

@ -0,0 +1,13 @@
name: sculpin-skeleton
type: sculpin
language: php
flake:
devshell:
packages:
- php81
- php81Packages.composer
git:
ignore:
- /flake.lock

View file

@ -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"
];
};
};
};

41
run Executable file
View file

@ -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 <task> [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