Initial commit

This commit is contained in:
Oliver Davies 2025-02-19 12:30:11 +00:00
commit a844b21356
8 changed files with 105 additions and 0 deletions

1
.envrc Normal file
View file

@ -0,0 +1 @@
use flake

5
.gitignore vendored Normal file
View file

@ -0,0 +1,5 @@
# SSG
/dst/
# Nix
/result

27
flake.lock Normal file
View 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
View 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
View 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
View 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
View file

@ -0,0 +1 @@
<html><title></title>

1
src/index.md Normal file
View file

@ -0,0 +1 @@
# hello, world!