move static files into static sub-dir, refactor nix a bit

This commit is contained in:
Brian Picciano 2021-07-31 11:35:39 -06:00
parent 03a35dcc38
commit f1998c321a
503 changed files with 86 additions and 71 deletions

5
.gitignore vendored
View File

@ -1,6 +1 @@
.bundle
.sass-cache
*.gem
.jekyll-metadata
result result
_site

View File

@ -1,21 +0,0 @@
result:
nix-build -A build
install: result
nix-env -i "$$(readlink result)"
clean:
rm -f result
rm -rf _site
serve:
nix-shell -A serve
shell:
nix-shell -A shell
lock:
nix-shell -p bundler -p bundix --run 'bundler lock; bundix; rm -rf .bundle vendor'
update:
nix-shell -p bundler -p bundix --run 'bundler update; bundler lock; bundix; rm -rf .bundle vendor'

View File

@ -1,6 +0,0 @@
source $stdenv/setup
set -e
d="$out/var/www/blog.mediocregopher.com"
mkdir -p "$d"
$jekyll_env/bin/jekyll build -s "$src" -d "$d"

View File

@ -1,39 +0,0 @@
{
pkgs ? import (fetchTarball "https://github.com/NixOS/nixpkgs/archive/cd63096d6d887d689543a0b97743d28995bc9bc3.tar.gz") {},
system ? builtins.currentSystem,
}:
let
jekyll_env = pkgs.bundlerEnv {
name = "jekyll_env";
ruby = pkgs.ruby;
gemdir = ./.;
};
shell_inputs = [ jekyll_env pkgs.imagemagick pkgs.exiftool ];
in
{
build = derivation {
inherit jekyll_env system;
name = "mediocre-blog";
builder = "${pkgs.bash}/bin/bash";
args = [ ./build.sh ];
src = ./src;
stdenv = pkgs.stdenv;
};
serve = pkgs.stdenv.mkDerivation {
name = "mediocre-blog-shell-serve";
buildInputs = shell_inputs;
shellHook = ''
exec ${jekyll_env}/bin/jekyll serve -s ./src -d ./_site -w -I -D -H 0.0.0.0
'';
};
shell = pkgs.stdenv.mkDerivation {
name = "mediocre-blog-shell";
buildInputs = shell_inputs;
};
}

9
nix/default.nix Normal file
View File

@ -0,0 +1,9 @@
{
pkgs ? import (fetchTarball "https://github.com/NixOS/nixpkgs/archive/d50923ab2d308a1ddb21594ba6ae064cab65d8ae.tar.gz") {},
system ? builtins.currentSystem,
}:
{
pkgs = pkgs;
system = system;
}

6
static/.gitignore vendored Normal file
View File

@ -0,0 +1,6 @@
.bundle
.sass-cache
*.gem
.jekyll-metadata
_site
result

18
static/Makefile Normal file
View File

@ -0,0 +1,18 @@
result:
nix-build -A build
clean:
rm -f result
rm -rf _site
dev:
nix-shell -A dev
shell:
nix-shell -A shell
lock:
nix-shell -A depShell --run 'bundler lock; bundix; rm -rf .bundle vendor'
update:
nix-shell -A depShell --run 'bundler update; bundler lock; bundix; rm -rf .bundle vendor'

53
static/default.nix Normal file
View File

@ -0,0 +1,53 @@
let
utils = (import ../nix) {};
pkgs = utils.pkgs;
system = utils.system;
jekyll_env = pkgs.bundlerEnv {
name = "jekyll_env";
ruby = pkgs.ruby;
gemdir = ./.;
};
dep_inputs = [ pkgs.imagemagick pkgs.exiftool pkgs.bundler pkgs.bundix ];
all_inputs = [ jekyll_env ] ++ dep_inputs;
in
{
build = derivation {
inherit jekyll_env system;
name = "mediocre-blog-static";
builder = "${pkgs.bash}/bin/bash";
args = [
(pkgs.writeTextFile {
name = "mediocre-blog-static-buildsh";
text = ''
source ${pkgs.stdenv}/setup
set -e
mkdir -p "$out"
$jekyll_env/bin/jekyll build -s "${./src}" -d "$out"
'';
executable = true;
})
];
};
dev = pkgs.stdenv.mkDerivation {
name = "mediocre-blog-static-dev";
buildInputs = all_inputs;
shellHook = ''
exec ${jekyll_env}/bin/jekyll serve -s ./src -d ./_site -w -I -D -H 0.0.0.0
'';
};
depShell = pkgs.stdenv.mkDerivation {
name = "mediocre-blog-static-dep-shell";
buildInputs = dep_inputs;
};
shell = pkgs.stdenv.mkDerivation {
name = "mediocre-blog-static-shell";
buildInputs = all_inputs;
};
}

View File

Before

Width:  |  Height:  |  Size: 9.1 KiB

After

Width:  |  Height:  |  Size: 9.1 KiB

Some files were not shown because too many files have changed in this diff Show More