Prep for nix-build
This commit is contained in:
parent
aa85a09169
commit
760312a130
27
.build.yml
27
.build.yml
|
@ -1,27 +0,0 @@
|
|||
image: alpine/edge
|
||||
packages:
|
||||
- ruby-dev
|
||||
- nodejs
|
||||
- build-base
|
||||
- libffi-dev
|
||||
- npm
|
||||
environment:
|
||||
repo: this-and-that
|
||||
sources:
|
||||
- https://git.sr.ht/~stfn/this-and-that
|
||||
- https://git.sr.ht/~stfn/build-scripts
|
||||
secrets:
|
||||
- 4aa75533-97a7-429e-b7b0-4f9f3e564ced # ~/.neocities/$repo
|
||||
tasks:
|
||||
- setup: |
|
||||
sudo apk add --no-cache build-base libffi-dev
|
||||
sudo gem install --no-document bundler neocities
|
||||
- build: |
|
||||
cd $repo
|
||||
sudo sh ../build-scripts/jekyll-build
|
||||
- minify: |
|
||||
cd $repo
|
||||
sudo sh ../build-scripts/minify-site
|
||||
- deploy: |
|
||||
cd $repo
|
||||
sudo sh ../build-scripts/neocities-deploy $repo _site
|
|
@ -1,2 +1,3 @@
|
|||
---
|
||||
BUNDLE_PATH: "vendor/bundle"
|
||||
BUNDLE_FORCE_RUBY_PLATFORM: "true"
|
||||
|
|
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -4,7 +4,6 @@
|
|||
.nix-gems
|
||||
.sass-cache
|
||||
_site
|
||||
Gemfile.lock
|
||||
node_modules
|
||||
package-lock.json
|
||||
package.json
|
||||
|
|
16
Gemfile.lock
16
Gemfile.lock
|
@ -10,9 +10,9 @@ GEM
|
|||
eventmachine (>= 0.12.9)
|
||||
http_parser.rb (~> 0)
|
||||
eventmachine (1.2.7)
|
||||
ffi (1.17.0-x86_64-linux-gnu)
|
||||
ffi (1.17.0)
|
||||
forwardable-extended (2.6.0)
|
||||
google-protobuf (4.28.3-x86_64-linux)
|
||||
google-protobuf (4.29.0)
|
||||
bigdecimal
|
||||
rake (>= 13)
|
||||
http_parser.rb (0.8.0)
|
||||
|
@ -40,8 +40,8 @@ GEM
|
|||
jekyll (>= 3.7, < 5.0)
|
||||
jekyll-watch (2.2.1)
|
||||
listen (~> 3.0)
|
||||
kramdown (2.4.0)
|
||||
rexml
|
||||
kramdown (2.5.1)
|
||||
rexml (>= 3.3.9)
|
||||
kramdown-parser-gfm (1.1.0)
|
||||
kramdown (~> 2.0)
|
||||
liquid (4.0.4)
|
||||
|
@ -57,7 +57,7 @@ GEM
|
|||
rb-inotify (0.11.1)
|
||||
ffi (~> 1.0)
|
||||
rexml (3.3.9)
|
||||
rouge (4.4.0)
|
||||
rouge (4.5.1)
|
||||
safe_yaml (1.0.5)
|
||||
sass-embedded (1.80.3)
|
||||
google-protobuf (~> 4.28)
|
||||
|
@ -65,10 +65,10 @@ GEM
|
|||
terminal-table (3.0.2)
|
||||
unicode-display_width (>= 1.1.1, < 3)
|
||||
unicode-display_width (2.6.0)
|
||||
webrick (1.8.2)
|
||||
webrick (1.9.1)
|
||||
|
||||
PLATFORMS
|
||||
x86_64-linux
|
||||
ruby
|
||||
|
||||
DEPENDENCIES
|
||||
jekyll
|
||||
|
@ -77,4 +77,4 @@ DEPENDENCIES
|
|||
webrick (~> 1.7)
|
||||
|
||||
BUNDLED WITH
|
||||
2.5.9
|
||||
2.5.22
|
||||
|
|
|
@ -28,8 +28,10 @@ defaults:
|
|||
sitemap: false
|
||||
|
||||
exclude:
|
||||
- Gemfile
|
||||
- LICENSE
|
||||
- README.md
|
||||
- default.nix
|
||||
- gemset.nix
|
||||
- package-lock.json
|
||||
- shell.nix
|
||||
- Gemfile
|
||||
|
|
52
default.nix
Normal file
52
default.nix
Normal file
|
@ -0,0 +1,52 @@
|
|||
{ pkgs ? import <nixpkgs> {} }:
|
||||
|
||||
let
|
||||
src = ./.;
|
||||
env = pkgs.bundlerEnv {
|
||||
name = "thisandthatcafe-co-uk";
|
||||
inherit (pkgs) ruby;
|
||||
gemfile = ./Gemfile;
|
||||
lockfile = ./Gemfile.lock;
|
||||
gemset = ./gemset.nix;
|
||||
};
|
||||
in
|
||||
pkgs.stdenv.mkDerivation {
|
||||
name = "thisandthatcafe-co-uk";
|
||||
|
||||
src = builtins.filterSource
|
||||
(path: type: !(builtins.elem (baseNameOf path) [
|
||||
"_site"
|
||||
".jekyll-cache"
|
||||
".git"
|
||||
"node_modules"
|
||||
"result"
|
||||
"vendor"
|
||||
]))
|
||||
src;
|
||||
|
||||
nativeBuildInputs = with pkgs; [
|
||||
ruby_3_3
|
||||
minify
|
||||
];
|
||||
|
||||
configurePhase = ''
|
||||
export HOME=$TMPDIR
|
||||
mkdir -p _site
|
||||
'';
|
||||
|
||||
buildPhase = ''
|
||||
echo "Building site with Jekyll..."
|
||||
JEKYLL_ENV=production ${env}/bin/jekyll build --source . --destination _site --trace
|
||||
|
||||
echo 'Minifying HTML'
|
||||
minify --all --recursive --output . _site
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
echo "Creating output directory..."
|
||||
mkdir -p $out
|
||||
|
||||
echo "Copying site files..."
|
||||
cp -r _site/* $out/
|
||||
'';
|
||||
}
|
337
gemset.nix
Normal file
337
gemset.nix
Normal file
|
@ -0,0 +1,337 @@
|
|||
{
|
||||
addressable = {
|
||||
dependencies = ["public_suffix"];
|
||||
groups = ["default" "jekyll_plugins"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "0cl2qpvwiffym62z991ynks7imsm87qmgxf0yfsmlwzkgi9qcaa6";
|
||||
type = "gem";
|
||||
};
|
||||
version = "2.8.7";
|
||||
};
|
||||
bigdecimal = {
|
||||
groups = ["default" "jekyll_plugins"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "1gi7zqgmqwi5lizggs1jhc3zlwaqayy9rx2ah80sxy24bbnng558";
|
||||
type = "gem";
|
||||
};
|
||||
version = "3.1.8";
|
||||
};
|
||||
colorator = {
|
||||
groups = ["default" "jekyll_plugins"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "0f7wvpam948cglrciyqd798gdc6z3cfijciavd0dfixgaypmvy72";
|
||||
type = "gem";
|
||||
};
|
||||
version = "1.1.0";
|
||||
};
|
||||
concurrent-ruby = {
|
||||
groups = ["default" "jekyll_plugins"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "0chwfdq2a6kbj6xz9l6zrdfnyghnh32si82la1dnpa5h75ir5anl";
|
||||
type = "gem";
|
||||
};
|
||||
version = "1.3.4";
|
||||
};
|
||||
em-websocket = {
|
||||
dependencies = ["eventmachine" "http_parser.rb"];
|
||||
groups = ["default" "jekyll_plugins"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "1a66b0kjk6jx7pai9gc7i27zd0a128gy73nmas98gjz6wjyr4spm";
|
||||
type = "gem";
|
||||
};
|
||||
version = "0.5.3";
|
||||
};
|
||||
eventmachine = {
|
||||
groups = ["default" "jekyll_plugins"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "0wh9aqb0skz80fhfn66lbpr4f86ya2z5rx6gm5xlfhd05bj1ch4r";
|
||||
type = "gem";
|
||||
};
|
||||
version = "1.2.7";
|
||||
};
|
||||
ffi = {
|
||||
groups = ["default" "jekyll_plugins"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "07139870npj59jnl8vmk39ja3gdk3fb5z9vc0lf32y2h891hwqsi";
|
||||
type = "gem";
|
||||
};
|
||||
version = "1.17.0";
|
||||
};
|
||||
forwardable-extended = {
|
||||
groups = ["default" "jekyll_plugins"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "15zcqfxfvsnprwm8agia85x64vjzr2w0xn9vxfnxzgcv8s699v0v";
|
||||
type = "gem";
|
||||
};
|
||||
version = "2.6.0";
|
||||
};
|
||||
google-protobuf = {
|
||||
dependencies = ["bigdecimal" "rake"];
|
||||
groups = ["default" "jekyll_plugins"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "1m3gm8l1rlmcf7gqmdli1pmc788zhg3m7ng3wbv8barxh3cdmxrg";
|
||||
type = "gem";
|
||||
};
|
||||
version = "4.29.0";
|
||||
};
|
||||
"http_parser.rb" = {
|
||||
groups = ["default" "jekyll_plugins"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "1gj4fmls0mf52dlr928gaq0c0cb0m3aqa9kaa6l0ikl2zbqk42as";
|
||||
type = "gem";
|
||||
};
|
||||
version = "0.8.0";
|
||||
};
|
||||
i18n = {
|
||||
dependencies = ["concurrent-ruby"];
|
||||
groups = ["default" "jekyll_plugins"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "0k31wcgnvcvd14snz0pfqj976zv6drfsnq6x8acz10fiyms9l8nw";
|
||||
type = "gem";
|
||||
};
|
||||
version = "1.14.6";
|
||||
};
|
||||
jekyll = {
|
||||
dependencies = ["addressable" "colorator" "em-websocket" "i18n" "jekyll-sass-converter" "jekyll-watch" "kramdown" "kramdown-parser-gfm" "liquid" "mercenary" "pathutil" "rouge" "safe_yaml" "terminal-table" "webrick"];
|
||||
groups = ["default" "jekyll_plugins"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "0124fnqizh7njn99qg4f3jvf9kg2rpm88drs9p9r5hqr50n2i264";
|
||||
type = "gem";
|
||||
};
|
||||
version = "4.3.4";
|
||||
};
|
||||
jekyll-sass-converter = {
|
||||
dependencies = ["sass-embedded"];
|
||||
groups = ["default" "jekyll_plugins"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "00n9v19h0qgjijygfdkdh2gwpmdlz49nw1mqk6fnp43f317ngrz2";
|
||||
type = "gem";
|
||||
};
|
||||
version = "3.0.0";
|
||||
};
|
||||
jekyll-sitemap = {
|
||||
dependencies = ["jekyll"];
|
||||
groups = ["jekyll_plugins"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "0622rwsn5i0m5xcyzdn86l68wgydqwji03lqixdfm1f1xdfqrq0d";
|
||||
type = "gem";
|
||||
};
|
||||
version = "1.4.0";
|
||||
};
|
||||
jekyll-watch = {
|
||||
dependencies = ["listen"];
|
||||
groups = ["default" "jekyll_plugins"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "1qd7hy1kl87fl7l0frw5qbn22x7ayfzlv9a5ca1m59g0ym1ysi5w";
|
||||
type = "gem";
|
||||
};
|
||||
version = "2.2.1";
|
||||
};
|
||||
kramdown = {
|
||||
dependencies = ["rexml"];
|
||||
groups = ["default" "jekyll_plugins"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "131nwypz8b4pq1hxs6gsz3k00i9b75y3cgpkq57vxknkv6mvdfw7";
|
||||
type = "gem";
|
||||
};
|
||||
version = "2.5.1";
|
||||
};
|
||||
kramdown-parser-gfm = {
|
||||
dependencies = ["kramdown"];
|
||||
groups = ["default" "jekyll_plugins"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "0a8pb3v951f4x7h968rqfsa19c8arz21zw1vaj42jza22rap8fgv";
|
||||
type = "gem";
|
||||
};
|
||||
version = "1.1.0";
|
||||
};
|
||||
liquid = {
|
||||
groups = ["default" "jekyll_plugins"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "1czxv2i1gv3k7hxnrgfjb0z8khz74l4pmfwd70c7kr25l2qypksg";
|
||||
type = "gem";
|
||||
};
|
||||
version = "4.0.4";
|
||||
};
|
||||
listen = {
|
||||
dependencies = ["rb-fsevent" "rb-inotify"];
|
||||
groups = ["default" "jekyll_plugins"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "0rwwsmvq79qwzl6324yc53py02kbrcww35si720490z5w0j497nv";
|
||||
type = "gem";
|
||||
};
|
||||
version = "3.9.0";
|
||||
};
|
||||
mercenary = {
|
||||
groups = ["default" "jekyll_plugins"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "0f2i827w4lmsizrxixsrv2ssa3gk1b7lmqh8brk8ijmdb551wnmj";
|
||||
type = "gem";
|
||||
};
|
||||
version = "0.4.0";
|
||||
};
|
||||
pathutil = {
|
||||
dependencies = ["forwardable-extended"];
|
||||
groups = ["default" "jekyll_plugins"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "12fm93ljw9fbxmv2krki5k5wkvr7560qy8p4spvb9jiiaqv78fz4";
|
||||
type = "gem";
|
||||
};
|
||||
version = "0.16.2";
|
||||
};
|
||||
public_suffix = {
|
||||
groups = ["default" "jekyll_plugins"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "0vqcw3iwby3yc6avs1vb3gfd0vcp2v7q310665dvxfswmcf4xm31";
|
||||
type = "gem";
|
||||
};
|
||||
version = "6.0.1";
|
||||
};
|
||||
rake = {
|
||||
groups = ["default" "jekyll_plugins"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "17850wcwkgi30p7yqh60960ypn7yibacjjha0av78zaxwvd3ijs6";
|
||||
type = "gem";
|
||||
};
|
||||
version = "13.2.1";
|
||||
};
|
||||
rb-fsevent = {
|
||||
groups = ["default" "jekyll_plugins"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "1zmf31rnpm8553lqwibvv3kkx0v7majm1f341xbxc0bk5sbhp423";
|
||||
type = "gem";
|
||||
};
|
||||
version = "0.11.2";
|
||||
};
|
||||
rb-inotify = {
|
||||
dependencies = ["ffi"];
|
||||
groups = ["default" "jekyll_plugins"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "0vmy8xgahixcz6hzwy4zdcyn2y6d6ri8dqv5xccgzc1r292019x0";
|
||||
type = "gem";
|
||||
};
|
||||
version = "0.11.1";
|
||||
};
|
||||
rexml = {
|
||||
groups = ["default" "jekyll_plugins"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "1j9p66pmfgxnzp76ksssyfyqqrg7281dyi3xyknl3wwraaw7a66p";
|
||||
type = "gem";
|
||||
};
|
||||
version = "3.3.9";
|
||||
};
|
||||
rouge = {
|
||||
groups = ["default" "jekyll_plugins"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "1pchwrkr0994v7mh054lcp0na3bk3mj2sk0dc33bn6bhxrnirj1a";
|
||||
type = "gem";
|
||||
};
|
||||
version = "4.5.1";
|
||||
};
|
||||
safe_yaml = {
|
||||
groups = ["default" "jekyll_plugins"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "0j7qv63p0vqcd838i2iy2f76c3dgwzkiz1d1xkg7n0pbnxj2vb56";
|
||||
type = "gem";
|
||||
};
|
||||
version = "1.0.5";
|
||||
};
|
||||
sass-embedded = {
|
||||
dependencies = ["google-protobuf" "rake"];
|
||||
groups = ["default" "jekyll_plugins"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "17szxs6kmqmn1g6qp8rnnnrcwvsw3a6z10r50f6splrk4l2pgi30";
|
||||
type = "gem";
|
||||
};
|
||||
version = "1.80.3";
|
||||
};
|
||||
terminal-table = {
|
||||
dependencies = ["unicode-display_width"];
|
||||
groups = ["default" "jekyll_plugins"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "14dfmfjppmng5hwj7c5ka6qdapawm3h6k9lhn8zj001ybypvclgr";
|
||||
type = "gem";
|
||||
};
|
||||
version = "3.0.2";
|
||||
};
|
||||
unicode-display_width = {
|
||||
groups = ["default" "jekyll_plugins"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "0nkz7fadlrdbkf37m0x7sw8bnz8r355q3vwcfb9f9md6pds9h9qj";
|
||||
type = "gem";
|
||||
};
|
||||
version = "2.6.0";
|
||||
};
|
||||
webrick = {
|
||||
groups = ["default" "jekyll_plugins"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "12d9n8hll67j737ym2zw4v23cn4vxyfkb6vyv1rzpwv6y6a3qbdl";
|
||||
type = "gem";
|
||||
};
|
||||
version = "1.9.1";
|
||||
};
|
||||
}
|
1
result
Symbolic link
1
result
Symbolic link
|
@ -0,0 +1 @@
|
|||
/nix/store/0izygj8m60knpy6v452hiafpkmpyx3wy-thisandthatcafe-co-uk
|
67
shell.nix
67
shell.nix
|
@ -1,20 +1,51 @@
|
|||
with (import <nixpkgs> {});
|
||||
mkShell {
|
||||
buildInputs = [
|
||||
bundler
|
||||
ruby
|
||||
nodejs
|
||||
nodePackages_latest.npm
|
||||
nodePackages_latest.html-minifier
|
||||
];
|
||||
shellHook = ''
|
||||
mkdir -p .nix-gems
|
||||
with (import <nixpkgs> {}); let
|
||||
env = bundlerEnv {
|
||||
name = "BluePitsHousingAction";
|
||||
inherit ruby;
|
||||
gemfile = ./Gemfile;
|
||||
lockfile = ./Gemfile.lock;
|
||||
gemset = ./gemset.nix;
|
||||
};
|
||||
in
|
||||
stdenv.mkDerivation {
|
||||
name = "bluepitshousingaction-co-uk";
|
||||
buildInputs = [
|
||||
env
|
||||
ruby_3_3
|
||||
rubyPackages_3_3.ffi
|
||||
libffi
|
||||
];
|
||||
|
||||
export GEM_HOME=$PWD/.nix-gems
|
||||
export GEM_PATH=$GEM_HOME
|
||||
export PATH=$GEM_HOME/bin:$PATH
|
||||
export PATH=$PWD/bin:$PATH
|
||||
shellHook = ''
|
||||
serve() {
|
||||
${env}/bin/jekyll serve --watch &
|
||||
JEKYLL_PID=$!
|
||||
|
||||
gem list -i ^neocities$ || gem install neocities --no-document
|
||||
'';
|
||||
}
|
||||
cleanup_serve() {
|
||||
echo "Cleaning up serve process..."
|
||||
kill $JEKYLL_PID 2>/dev/null
|
||||
wait $JEKYLL_PID 2>/dev/null
|
||||
}
|
||||
|
||||
trap cleanup_serve EXIT INT TERM
|
||||
|
||||
wait $JEKYLL_PID
|
||||
|
||||
cleanup_serve
|
||||
|
||||
trap - EXIT INT TERM
|
||||
}
|
||||
|
||||
export -f serve
|
||||
|
||||
cleanup() {
|
||||
echo "Cleaning up..."
|
||||
rm -rf _site .jekyll-cache .jekyll-metadata
|
||||
}
|
||||
|
||||
trap cleanup EXIT
|
||||
|
||||
echo "Development environment ready!"
|
||||
echo "Run 'serve' to start development server"
|
||||
'';
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue