Move all files to sculpin/

This commit is contained in:
Oliver Davies 2025-10-01 00:01:33 +01:00
parent c5d71803a5
commit 0f61b4e9ee
1514 changed files with 0 additions and 0 deletions

View file

@ -0,0 +1,29 @@
{ 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

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

View file

@ -0,0 +1,33 @@
{
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

@ -0,0 +1,21 @@
{
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

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