Initial commit
This commit is contained in:
commit
a844b21356
5
.gitignore
vendored
Normal file
5
.gitignore
vendored
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
# SSG
|
||||||
|
/dst/
|
||||||
|
|
||||||
|
# Nix
|
||||||
|
/result
|
27
flake.lock
Normal file
27
flake.lock
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
{
|
||||||
|
"nodes": {
|
||||||
|
"nixpkgs": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1739866667,
|
||||||
|
"narHash": "sha256-EO1ygNKZlsAC9avfcwHkKGMsmipUk1Uc0TbrEZpkn64=",
|
||||||
|
"owner": "nixos",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "73cf49b8ad837ade2de76f87eb53fc85ed5d4680",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nixos",
|
||||||
|
"ref": "nixos-unstable",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": "nixpkgs"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": "root",
|
||||||
|
"version": 7
|
||||||
|
}
|
39
flake.nix
Normal file
39
flake.nix
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
{
|
||||||
|
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||||
|
|
||||||
|
outputs =
|
||||||
|
{ nixpkgs, ... }:
|
||||||
|
let
|
||||||
|
system = "x86_64-linux";
|
||||||
|
pkgs = import nixpkgs { inherit system; };
|
||||||
|
in
|
||||||
|
{
|
||||||
|
devShells.${system}.default = pkgs.mkShell {
|
||||||
|
buildInputs = with pkgs; [
|
||||||
|
bashInteractive
|
||||||
|
lowdown
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
packages.${system} = with pkgs; {
|
||||||
|
ssg = mkDerivation {
|
||||||
|
name = "ssg";
|
||||||
|
|
||||||
|
src = fetchurl {
|
||||||
|
url = "https://romanzolotarev.com/bin/ssg";
|
||||||
|
sha256 = "OgqH4ZQ47EM25ubEpum6v38Tl76hQPh7aZ6VRQcbd2M=";
|
||||||
|
};
|
||||||
|
|
||||||
|
dontUnpack = true;
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
mkdir -p $out/bin
|
||||||
|
cp $src $out/bin/ssg
|
||||||
|
chmod +x $out/bin/ssg
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
formatter.${system} = pkgs.nixfmt-rfc-style;
|
||||||
|
};
|
||||||
|
}
|
6
notes.txt
Normal file
6
notes.txt
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
https://romanzolotarev.com/ssg.html
|
||||||
|
https://romanzolotarev.com/bin/ssg
|
||||||
|
|
||||||
|
nix build .#ssg
|
||||||
|
./result/bin/ssg
|
||||||
|
|
25
run
Executable file
25
run
Executable file
|
@ -0,0 +1,25 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -o errexit
|
||||||
|
set -o nounset
|
||||||
|
set -o pipefail
|
||||||
|
|
||||||
|
function clean {
|
||||||
|
rm -fr dst "${@}"
|
||||||
|
mkdir dst
|
||||||
|
}
|
||||||
|
|
||||||
|
function generate {
|
||||||
|
./result/bin/ssg "src" "dst" "test" "http://localhost"
|
||||||
|
}
|
||||||
|
|
||||||
|
function help {
|
||||||
|
printf "%s <task> [args]\n\nTasks:\n" "${0}"
|
||||||
|
|
||||||
|
compgen -A function | grep -v "^_" | cat -n
|
||||||
|
|
||||||
|
printf "\nExtended help:\n Each task has comments for general usage\n"
|
||||||
|
}
|
||||||
|
|
||||||
|
TIMEFORMAT="Task completed in %3lR"
|
||||||
|
time "${@:-help}"
|
1
src/_header.html
Normal file
1
src/_header.html
Normal file
|
@ -0,0 +1 @@
|
||||||
|
<html><title></title>
|
1
src/index.md
Normal file
1
src/index.md
Normal file
|
@ -0,0 +1 @@
|
||||||
|
# hello, world!
|
Loading…
Reference in a new issue