parent
0197d9cd49
commit
6feffc568a
@ -1,4 +1,25 @@ |
||||
|
||||
install: |
||||
nix-build -A install
|
||||
all: |
||||
nix-build -A entrypoint --arg baseConfig '(import ./config.nix) // { staticProxyURL = ""; }'
|
||||
|
||||
all.prod: |
||||
nix-build -A entrypoint --arg baseConfig '(import ./prod.config.nix)'
|
||||
|
||||
install.prod: |
||||
nix-build -A install --arg baseConfig '(import ./prod.config.nix)'
|
||||
./result
|
||||
|
||||
srv.shell: |
||||
nix-shell -A srv.shell --command 'cd srv; return'
|
||||
|
||||
static.shell: |
||||
nix-shell -A static.shell --command 'cd static; return'
|
||||
|
||||
static.serve: |
||||
nix-shell -A static.shell --run 'cd static; static-serve'
|
||||
|
||||
static.depShell: |
||||
nix-shell -A static.depShell --command 'cd static; return'
|
||||
|
||||
static.lock: |
||||
nix-shell -A static.depShell --run 'bundler lock; bundix; rm -rf .bundle vendor'
|
||||
|
@ -1,10 +1,14 @@ |
||||
{ |
||||
runDir = "/tmp/mediocre-blog/run"; |
||||
dataDir = "/tmp/mediocre-blog/data"; |
||||
|
||||
powSecret = "ssshhh"; |
||||
mlSMTPAddr = ""; |
||||
mlSMTPAuth = ""; |
||||
dataDir = "/tmp/mediocre-blog-data"; |
||||
publicURL = "http://localhost:4000"; |
||||
listenProto = "tcp"; |
||||
listenAddr = ":4000"; |
||||
redisListenPath = "/tmp/mediocre-blog-redis"; |
||||
|
||||
# If empty then a derived static directory is used |
||||
staticProxyURL = "http://127.0.0.1:4001"; |
||||
} |
||||
|
@ -1,13 +0,0 @@ |
||||
{ |
||||
pkgs ? import (fetchTarball { |
||||
name = "nixpkgs-21-05"; |
||||
url = "https://github.com/NixOS/nixpkgs/archive/7e9b0dff974c89e070da1ad85713ff3c20b0ca97.tar.gz"; |
||||
sha256 = "1ckzhh24mgz6jd1xhfgx0i9mijk6xjqxwsshnvq789xsavrmsc36"; |
||||
}) {}, |
||||
system ? builtins.currentSystem, |
||||
}: |
||||
{ |
||||
pkgs = pkgs; |
||||
system = system; |
||||
} |
||||
|
@ -1,7 +0,0 @@ |
||||
build: |
||||
nix-build -A build
|
||||
|
||||
shell: |
||||
nix-shell -A shell
|
||||
|
||||
|
@ -1,18 +0,0 @@ |
||||
build: |
||||
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'
|
@ -1,53 +1,39 @@ |
||||
let |
||||
utils = (import ../nix) {}; |
||||
pkgs = utils.pkgs; |
||||
system = utils.system; |
||||
{pkgs}: rec { |
||||
|
||||
jekyll_env = pkgs.bundlerEnv { |
||||
name = "jekyll_env"; |
||||
depInputs = [ pkgs.imagemagick pkgs.exiftool pkgs.bundler pkgs.bundix ]; |
||||
|
||||
depShell = pkgs.stdenv.mkDerivation { |
||||
name = "mediocre-blog-static-dep-shell"; |
||||
buildInputs = depInputs; |
||||
}; |
||||
|
||||
jekyllEnv = pkgs.bundlerEnv { |
||||
name = "jekyllEnv"; |
||||
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; |
||||
|
||||
build = pkgs.stdenv.mkDerivation { |
||||
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; |
||||
}) |
||||
]; |
||||
src = ./src; |
||||
buildPhase = "${jekyllEnv}/bin/jekyll build"; |
||||
installPhase = "mv _site $out"; |
||||
}; |
||||
|
||||
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 -P 4001 |
||||
serve = pkgs.writeScriptBin "static-serve" '' |
||||
#!/bin/sh |
||||
exec ${jekyllEnv}/bin/jekyll serve \ |
||||
-s ./src \ |
||||
-d ./_site \ |
||||
-w -I -D \ |
||||
-P 4001 |
||||
''; |
||||
}; |
||||
|
||||
depShell = pkgs.stdenv.mkDerivation { |
||||
name = "mediocre-blog-static-dep-shell"; |
||||
buildInputs = dep_inputs; |
||||
}; |
||||
allInputs = depInputs ++ [ jekyllEnv serve ]; |
||||
|
||||
shell = pkgs.stdenv.mkDerivation { |
||||
name = "mediocre-blog-static-shell"; |
||||
buildInputs = all_inputs; |
||||
buildInputs = allInputs; |
||||
}; |
||||
} |
||||
} |
||||
|
Loading…
Reference in new issue