Move all files to sculpin/
This commit is contained in:
parent
c5d71803a5
commit
0f61b4e9ee
1514 changed files with 0 additions and 0 deletions
29
sculpin/flake-modules/dev-shell.nix
Normal file
29
sculpin/flake-modules/dev-shell.nix
Normal 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
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
16
sculpin/flake-modules/drafts.nix
Normal file
16
sculpin/flake-modules/drafts.nix
Normal 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}"
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
33
sculpin/flake-modules/new-draft.nix
Normal file
33
sculpin/flake-modules/new-draft.nix
Normal 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"
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
21
sculpin/flake-modules/publish.nix
Normal file
21
sculpin/flake-modules/publish.nix
Normal 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 "$@"
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
3
sculpin/flake-modules/systems.nix
Normal file
3
sculpin/flake-modules/systems.nix
Normal file
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
systems = [ "x86_64-linux" ];
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue