Re-add and use build-configs.yaml

This commit is contained in:
Oliver Davies 2025-10-06 01:10:57 +01:00
parent 4bdfb3c8a0
commit 44ae28287f
12 changed files with 49 additions and 196 deletions

1
sculpin/.bcignore Normal file
View file

@ -0,0 +1 @@
.gitignore

View file

@ -1,5 +1,9 @@
#!/usr/bin/env bash
set -uexo pipefail
set -euo pipefail
vendor/bin/sculpin generate --watch --server "$@"
export PATH="$PATH:./vendor/bin"
: "${APP_ENV:=prod}"
sculpin generate --env "$APP_ENV" "$@"

View file

@ -0,0 +1,3 @@
---
name: oliverdavies.uk
template: php-sculpin

5
sculpin/clean Executable file
View file

@ -0,0 +1,5 @@
#!/usr/bin/env bash
set -euo pipefail
rm -rfv output_* vendor

View file

@ -1,29 +0,0 @@
{ inputs, ... }:
{
imports = [ inputs.devshell.flakeModule ];
perSystem =
{ pkgs, self', ... }:
{
devshells.default = {
packages = with pkgs; [
nodePackages.browser-sync
(php83.buildEnv {
extraConfig = ''
error_reporting = E_ALL & ~E_DEPRECATED & ~E_USER_DEPRECATED
'';
})
php83Packages.composer
self'.packages.drafts
self'.packages.new-draft
self'.packages.publish
tailwindcss
];
};
};
}

View file

@ -1,16 +0,0 @@
{
perSystem =
{ pkgs, ... }:
{
packages.drafts = pkgs.writeShellApplication {
name = "drafts";
runtimeInputs = with pkgs; [ gnugrep ];
text = ''
echo "oob"
grep -r 'draft: true' "''${1:-source}"
'';
};
};
}

View file

@ -1,33 +0,0 @@
{
perSystem =
{ pkgs, ... }:
{
packages.new-draft = pkgs.writeShellApplication {
name = "new-draft";
runtimeInputs = with pkgs; [
coreutils
git
];
text = ''
title="$1"
exclude_words="for|at|and"
filtered_title=$(echo "$title" | sed -E "s/\b($exclude_words)\b//g")
slug=$(echo "$filtered_title" | tr '[:upper:]' '[:lower:]' | sed -e 's/[^a-z0-9]/-/g' -e 's/-\+/-/g' -e 's/^-//g' -e 's/-$//g')
file="source/_posts/$slug.md"
echo -e "---\ntitle: $title\ndate: ~\ndraft: true\n---" > "$file"
echo "File created: $file"
git add "$file"
git commit -s -m "Add draft: $title"
'';
};
};
}

View file

@ -1,21 +0,0 @@
{
perSystem =
{ pkgs, ... }:
{
packages.publish = pkgs.writeShellApplication {
name = "publish";
runtimeInputs = with pkgs; [
rsync
php
];
text = ''
vendor/bin/sculpin generate --env prod
rsync -uvrP static/ output_prod "$@"
rsync -uvrP output_prod/ nixedo.oliverdavies.uk:/var/www/vhosts/website-sculpin "$@"
'';
};
};
}

View file

@ -1,3 +0,0 @@
{
systems = [ "x86_64-linux" ];
}

81
sculpin/flake.lock generated
View file

@ -1,94 +1,23 @@
{
"nodes": {
"devshell": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1741473158,
"narHash": "sha256-kWNaq6wQUbUMlPgw8Y+9/9wP0F8SHkjy24/mN3UAppg=",
"owner": "numtide",
"repo": "devshell",
"rev": "7c9e793ebe66bcba8292989a68c0419b737a22a0",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "devshell",
"type": "github"
}
},
"flake-parts": {
"inputs": {
"nixpkgs-lib": "nixpkgs-lib"
},
"locked": {
"lastModified": 1754487366,
"narHash": "sha256-pHYj8gUBapuUzKV/kN/tR3Zvqc7o6gdFB9XKXIp1SQ8=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "af66ad14b28a127c5c0f3bbb298218fc63528a18",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"import-tree": {
"locked": {
"lastModified": 1752730890,
"narHash": "sha256-GES8fapSLGz36MMPRVNkSUWXUTtqvGQNXHjRmRLfJUY=",
"owner": "vic",
"repo": "import-tree",
"rev": "6ebb8cb87987b20264c09296166543fd3761d274",
"type": "github"
},
"original": {
"owner": "vic",
"repo": "import-tree",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1755615617,
"narHash": "sha256-HMwfAJBdrr8wXAkbGhtcby1zGFvs+StOp19xNsbqdOg=",
"owner": "NixOS",
"lastModified": 1759381078,
"narHash": "sha256-gTrEEp5gEspIcCOx9PD8kMaF1iEmfBcTbO0Jag2QhQs=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "20075955deac2583bb12f07151c2df830ef346b4",
"rev": "7df7ff7d8e00218376575f0acdcc5d66741351ee",
"type": "github"
},
"original": {
"owner": "NixOS",
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-lib": {
"locked": {
"lastModified": 1753579242,
"narHash": "sha256-zvaMGVn14/Zz8hnp4VWT9xVnhc8vuL3TStRqwk22biA=",
"owner": "nix-community",
"repo": "nixpkgs.lib",
"rev": "0f36c44e01a6129be94e3ade315a5883f0228a6e",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nixpkgs.lib",
"type": "github"
}
},
"root": {
"inputs": {
"devshell": "devshell",
"flake-parts": "flake-parts",
"import-tree": "import-tree",
"nixpkgs": "nixpkgs"
}
}

View file

@ -1,20 +1,20 @@
{
inputs = {
devshell.inputs.nixpkgs.follows = "nixpkgs";
devshell.url = "github:numtide/devshell";
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
import-tree.url = "github:vic/import-tree";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
};
outputs =
inputs:
inputs.flake-parts.lib.mkFlake { inherit inputs; } {
imports = [
(inputs.import-tree ./flake-modules)
outputs = inputs:
let
system = "x86_64-linux";
pkgs = import inputs.nixpkgs { inherit system; };
in
{
devShells.${system}.default =
with pkgs;
mkShell {
buildInputs = [
nodePackages.browser-sync
php
phpPackages.composer
];
};
};
}

13
sculpin/watch Executable file
View file

@ -0,0 +1,13 @@
#!/usr/bin/env bash
set -euo pipefail
export PATH="$PATH:./vendor/bin"
: "${APP_ENV:=dev}"
sculpin generate \
--env "$APP_ENV" \
--server \
--watch \
"$@"