Initial Sculpin support

* Add Sculpin as a project type
* Declare initial files to generate
* Add flake.nix.twig
* Add .gitignore.twig
* Add run.twig
This commit is contained in:
Oliver Davies 2024-01-26 07:57:07 +00:00
parent 7bab7e91f4
commit f98a69e21f
6 changed files with 91 additions and 1 deletions

View file

@ -0,0 +1,12 @@
# {{ managedText|raw }}
/output_*/
/vendor/
{% if isFlake %}
/.direnv/
{% endif %}
{% for path in git.ignore %}
{{ path }}
{% endfor %}

View file

@ -0,0 +1,25 @@
# {{ managedText|raw }}
{
inputs = {
devshell.url = "github:numtide/devshell";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
};
outputs = inputs@{ flake-parts, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
imports = [ inputs.devshell.flakeModule ];
systems = [ "x86_64-linux" ];
perSystem = { config, self', inputs', pkgs, system, ... }: {
devshells.default = {
packages = with pkgs; [
{% for package in flake.devshell.packages %}
"{{ package }}"
{% endfor %}
];
};
};
};
}

41
templates/php/sculpin/run.twig 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