From 5d9be275d282b1cc9f25dc8b9efda6f01d04d294 Mon Sep 17 00:00:00 2001 From: Adithya Nair Date: Mon, 6 Nov 2023 01:26:46 +0530 Subject: [PATCH] redo the whole thing with zs --- .envrc | 1 + .gitignore | 3 + .zs/layout.html | 50 ++++ .zsignore | 11 + custom.css | 8 + default.nix | 17 ++ favicon.ico | Bin 0 -> 15406 bytes flake.lock | 61 ++++ flake.nix | 35 +++ ghost512.png | Bin 0 -> 11410 bytes index.md | 4 + simple.css | 692 ++++++++++++++++++++++++++++++++++++++++++++++ update-version.sh | 7 + zs.nix | 47 ++++ 14 files changed, 936 insertions(+) create mode 100644 .envrc create mode 100644 .gitignore create mode 100644 .zs/layout.html create mode 100644 .zsignore create mode 100644 custom.css create mode 100644 default.nix create mode 100644 favicon.ico create mode 100644 flake.lock create mode 100644 flake.nix create mode 100644 ghost512.png create mode 100644 index.md create mode 100644 simple.css create mode 100755 update-version.sh create mode 100644 zs.nix diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..c4b17d7 --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +use_flake diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..aeafedd --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +.direnv/ +.pub/ +result diff --git a/.zs/layout.html b/.zs/layout.html new file mode 100644 index 0000000..5363f43 --- /dev/null +++ b/.zs/layout.html @@ -0,0 +1,50 @@ + + + + + + + + + {{ title }} | A D T Y A + + +
+
+ +

A D T Y A

+
+

+ + + + +

+
+
+
+
+ {{ content }} +
+ + + diff --git a/.zsignore b/.zsignore new file mode 100644 index 0000000..f1ebef8 --- /dev/null +++ b/.zsignore @@ -0,0 +1,11 @@ +.direnv/ +.git/ +.pub/ + +.envrc +.gitignore +*.nix +flake.lock +result + +update-version.sh diff --git a/custom.css b/custom.css new file mode 100644 index 0000000..7af7c47 --- /dev/null +++ b/custom.css @@ -0,0 +1,8 @@ +.ghost { + height: 4rem; +} + +.social { + margin: 0 .8em 0 .8em; + text-decoration: none; +} diff --git a/default.nix b/default.nix new file mode 100644 index 0000000..e869ae7 --- /dev/null +++ b/default.nix @@ -0,0 +1,17 @@ +{ stdenvNoCC, zs }: +stdenvNoCC.mkDerivation rec { + name = "adtya_xyz"; + version = "2023-11-06"; + src = ./.; + + nativeBuildInputs = [ zs ]; + + buildPhase = '' + zs build + ''; + + installPhase = '' + mkdir -p $out/share + cp -r .pub $out/share/web + ''; +} diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..d7e9ce64b7323616a1a9e8621eddbb1e341b2570 GIT binary patch literal 15406 zcmeHNOKcTY7#_s9Fh)>g)CjRF!x9&Es|%t=6I~eMLJ~D@aA7oY;iBS&&U9w_Ak>N= z6eZA>QVP}wAQTE#S{{Z+rH^~t0#cx~@@#u&ZVd~L|99Gdm^;058SVoLnVbCi&-~~6 zALpO{%$$49D9Q|FrZRiBLcBm({IH@FDvDB2FmXNa2}SvlWb@}w_P?ko2cK4yd4wSq z(wLAFo7O+WRzKA&?KuQ#j%%+QwpOnu)E7W#>z4Wk`hWozZTAltBcb(}cBIfuXv3w6 z5~1H%_A&@<$V^)+1O`~QF4~X*7lfv}e(mKA;>hX4V&&*J&Um&BZIQAv+YqVZr`#B( zT{6D*`f3r2#YEZiL9ytgt5Sc{rCKSwQr98|YnsM^_2v)PB#*LweZyI41NmhA3%d@9 z;h+ADrqX5o%6Nrn8Q3fR{W|!I^#9#xm1z6tfRr^3HKfsx6v7{DAdU*lbjDvbwnECx z5e?JF_b2Oz#zA8l;aWf&Vo%&}+G6AxgtoiyL2BbUQ$X}85uQ)sFU&xY43t@s zXK8M{1MbBeadiRuKotpfF88C&a${Uwz;fp4Y%+#9>|lO_vy3^-^L}UUC)5udIkg?R zt({^y^K>>D!<@17UOG(eTF6W7;>qgfd=us@ z(<&}vzsyZr{lr8ch}tY?ZdmG96MeUymmCxOO2ys&*;cN2=znTWd+$M*|B3mZtD1A$ z$+rG}qjgX7`CXE#uYK>VVcb4e#LFEFu;s3`PPYD!o;oVmT382S?dJB&?Qcgb9Sm^G ztuhCfssF9RTO6Can@`L2C)S|64rSlG7KGo6+uKEa^-f8DZ{H+i2;|=?eu>t*>j^u+ zcC+>0*Vr&1ZIW&8eDk};Gdx%RS#@5)?|lB?=3&OrE~@$@e~8b;D_^*W6cG9tO<>{R_=!@O{nkF_(t7p zM>;Q?a^9ueYPB0fIte3DvdGUa^)CY+G2lM<;r!%D@!M(}?KLi;a}no0=y8ghWOP2) zNWT7a#}+XD8>Xdhg$>hM`Z330*u|eonXT>5Rs0;AVQGW6{HV<=_wpd|yLG6J{&MVE z+WDlu9OR$v(b|4Uv$f|zl=D`Wd%2lVe`XwW+JCR};`kah;^1ucBFn*ZQ9o{bce@?N zAMA`gU-u=RdfB&(Q;!6F#WU6bqtMNypF@Z5)9=j<>{IO_M^mcY9QD0Y2UgO_4&?2Av-LY;F zjYXYj37#o9&&4|dUH&XBcMT<#!V8XWEkVpu1&wv(&A*v>~tYb6oj)|6&j2PUdJjEbTkIOM4>C z=D7L?$ITq~0kwqZDbu#0tyA*Oc;@)7dD~EeXixE!H#YAzFf{h1tOu^gm*#w~1|0|ECckOj?~T`cP4Vw9xmofI>rEF(FFPfu!fs`Ht9J`SPGpfNm-bAxmQj6&FZ9&Z>xn1L_@VFtnsgc-Pp8TcPTVGrT} literal 0 HcmV?d00001 diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..6186600 --- /dev/null +++ b/flake.lock @@ -0,0 +1,61 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1694529238, + "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "ff7b65b44d01cf9ba6a71320833626af21126384", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1698611440, + "narHash": "sha256-jPjHjrerhYDy3q9+s5EAsuhyhuknNfowY6yt6pjn9pc=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "0cbe9f69c234a7700596e943bfae7ef27a31b735", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..8673640 --- /dev/null +++ b/flake.nix @@ -0,0 +1,35 @@ +{ + description = "adtya.xyz"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = + { self + , nixpkgs + , flake-utils + , + }: + flake-utils.lib.eachDefaultSystem ( + system: + let + pkgs = import nixpkgs { + inherit system; + }; + in + with pkgs; let + zs = callPackage ./zs.nix { }; + in + { + formatter = nixpkgs-fmt; + devShells.default = mkShell { + buildInputs = [ + zs + ]; + }; + packages.default = callPackage ./default.nix { inherit zs; }; + } + ); +} diff --git a/ghost512.png b/ghost512.png new file mode 100644 index 0000000000000000000000000000000000000000..1de9b529806bf3df3301bdfcc5416de3f1a7cb8e GIT binary patch literal 11410 zcmeHNcT|(xvJbs0h;)%&g^-ZY0uhkjdliL{1PC1xiXcc85tJ%O?;s+G^bU#wO0UwJ zNRf_;Ac8M=%01^^*In(`R(NI@5 z1ON!}LqY&KDgNV=@5omG;M|&@u{q8V;lt_f>1KyiSGUGF~P zAqv=0?UD~rm@SH&(|dCK+3(YC1VaXM{P&Zhz$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f&W)tG*khJTUWkBy_#4=o*y*_%UNHQ6Z8s7MQ7^2)9;n{@2MKgxAU z7Wg6FG1>;4;N6gl>g>5)d^FPPHU02@O6Bqs_PxCeX)*Txx{vW*8}qFfL{^eU?cMr6 zb%Wf9#nv&&fY`cea*Qj?a8%N1CBRN_)dS!Dk+XB zTDjJzbmQp&{A;>_m_XKlHcjrtP*s30qsY@ZI_kc;1UaMm!fBDJtmOD6OPh=={==4c zN(8NkOHH3QO>>UF3BGQIKON*dREn4AR0Hfxc;k!T+G(QarreZz#o!khzSu5BOixJ;vX^w O05nu|mCLT!g!~WcUzZaA literal 0 HcmV?d00001 diff --git a/index.md b/index.md new file mode 100644 index 0000000..0494812 --- /dev/null +++ b/index.md @@ -0,0 +1,4 @@ +--- +title: index.html +--- + diff --git a/simple.css b/simple.css new file mode 100644 index 0000000..a488582 --- /dev/null +++ b/simple.css @@ -0,0 +1,692 @@ +/* Global variables. */ +:root, +::backdrop { + /* Set sans-serif & mono fonts */ + --sans-font: -apple-system, BlinkMacSystemFont, "Avenir Next", Avenir, + "Nimbus Sans L", Roboto, "Noto Sans", "Segoe UI", Arial, Helvetica, + "Helvetica Neue", sans-serif; + --mono-font: Consolas, Menlo, Monaco, "Andale Mono", "Ubuntu Mono", monospace; + --standard-border-radius: 5px; + + /* Default (light) theme */ + --bg: #fff; + --accent-bg: #f5f7ff; + --text: #212121; + --text-light: #585858; + --border: #898EA4; + --accent: #0d47a1; + --code: #d81b60; + --preformatted: #444; + --marked: #ffdd33; + --disabled: #efefef; +} + +/* Dark theme */ +@media (prefers-color-scheme: dark) { + :root, + ::backdrop { + color-scheme: dark; + --bg: #282a36; + --accent-bg: #393b47; + --text: #f8f8f2; + --text-light: #e7e7e1; + --border: #50fa7b; + --accent: #8be9fd; + --code: #ff79c6; + --preformatted: #f1fa8c; + --marked: #ff5555; + --disabled: #6272a4; + } + /* Add a bit of transparency so light media isn't so glaring in dark mode */ + img, + video { + opacity: 0.8; + } +} + +/* Reset box-sizing */ +*, *::before, *::after { + box-sizing: border-box; +} + +/* Reset default appearance */ +textarea, +select, +input, +progress { + appearance: none; + -webkit-appearance: none; + -moz-appearance: none; +} + +html { + /* Set the font globally */ + font-family: var(--sans-font); + scroll-behavior: smooth; +} + +/* Make the body a nice central block */ +body { + color: var(--text); + background-color: var(--bg); + font-size: 1.15rem; + line-height: 1.5; + display: grid; + grid-template-columns: 1fr min(45rem, 90%) 1fr; + margin: 0; +} +body > * { + grid-column: 2; +} + +/* Make the header bg full width, but the content inline with body */ +body > header { + background-color: var(--accent-bg); + border-bottom: 1px solid var(--border); + text-align: center; + padding: 0 0.5rem 2rem 0.5rem; + grid-column: 1 / -1; +} + +body > header > *:only-child { + margin-block-start: 2rem; +} + +body > header h1 { + max-width: 1200px; + margin: 1rem auto; +} + +body > header p { + max-width: 40rem; + margin: 1rem auto; +} + +/* Add a little padding to ensure spacing is correct between content and header > nav */ +main { + padding-top: 1.5rem; +} + +body > footer { + margin-top: 4rem; + padding: 2rem 1rem 1.5rem 1rem; + color: var(--text-light); + font-size: 0.9rem; + text-align: center; + border-top: 1px solid var(--border); +} + +/* Format headers */ +h1 { + font-size: 3rem; +} + +h2 { + font-size: 2.6rem; + margin-top: 3rem; +} + +h3 { + font-size: 2rem; + margin-top: 3rem; +} + +h4 { + font-size: 1.44rem; +} + +h5 { + font-size: 1.15rem; +} + +h6 { + font-size: 0.96rem; +} + +p { + margin: 1.5rem 0; +} + +/* Prevent long strings from overflowing container */ +p, h1, h2, h3, h4, h5, h6 { + overflow-wrap: break-word; +} + +/* Fix line height when title wraps */ +h1, +h2, +h3 { + line-height: 1.1; +} + +/* Reduce header size on mobile */ +@media only screen and (max-width: 720px) { + h1 { + font-size: 2.5rem; + } + + h2 { + font-size: 2.1rem; + } + + h3 { + font-size: 1.75rem; + } + + h4 { + font-size: 1.25rem; + } +} + +/* Format links & buttons */ +a, +a:visited { + color: var(--accent); +} + +a:hover { + text-decoration: none; +} + +button, +.button, +a.button, /* extra specificity to override a */ +input[type="submit"], +input[type="reset"], +input[type="button"], +label[type="button"] { + border: 1px solid var(--accent); + background-color: var(--accent); + color: var(--bg); + padding: 0.5rem 0.9rem; + text-decoration: none; + line-height: normal; +} + +.button[aria-disabled="true"], +input:disabled, +textarea:disabled, +select:disabled, +button[disabled] { + cursor: not-allowed; + background-color: var(--disabled); + border-color: var(--disabled); + color: var(--text-light); +} + +input[type="range"] { + padding: 0; +} + +/* Set the cursor to '?' on an abbreviation and style the abbreviation to show that there is more information underneath */ +abbr[title] { + cursor: help; + text-decoration-line: underline; + text-decoration-style: dotted; +} + +button:enabled:hover, +.button:not([aria-disabled="true"]):hover, +input[type="submit"]:enabled:hover, +input[type="reset"]:enabled:hover, +input[type="button"]:enabled:hover, +label[type="button"]:hover { + filter: brightness(1.4); + cursor: pointer; +} + +.button:focus-visible, +button:focus-visible:where(:enabled), +input:enabled:focus-visible:where( + [type="submit"], + [type="reset"], + [type="button"] +) { + outline: 2px solid var(--accent); + outline-offset: 1px; +} + +/* Format navigation */ +header > nav { + font-size: 1rem; + line-height: 2; + padding: 1rem 0 0 0; +} + +/* Use flexbox to allow items to wrap, as needed */ +header > nav ul, +header > nav ol { + align-content: space-around; + align-items: center; + display: flex; + flex-direction: row; + flex-wrap: wrap; + justify-content: center; + list-style-type: none; + margin: 0; + padding: 0; +} + +/* List items are inline elements, make them behave more like blocks */ +header > nav ul li, +header > nav ol li { + display: inline-block; +} + +header > nav a, +header > nav a:visited { + margin: 0 0.5rem 1rem 0.5rem; + border: 1px solid var(--border); + border-radius: var(--standard-border-radius); + color: var(--text); + display: inline-block; + padding: 0.1rem 1rem; + text-decoration: none; +} + +header > nav a:hover, +header > nav a.current, +header > nav a[aria-current="page"] { + border-color: var(--accent); + color: var(--accent); + cursor: pointer; +} + +/* Reduce nav side on mobile */ +@media only screen and (max-width: 720px) { + header > nav a { + border: none; + padding: 0; + text-decoration: underline; + line-height: 1; + } +} + +/* Consolidate box styling */ +aside, details, pre, progress { + background-color: var(--accent-bg); + border: 1px solid var(--border); + border-radius: var(--standard-border-radius); + margin-bottom: 1rem; +} + +aside { + font-size: 1rem; + width: 30%; + padding: 0 15px; + margin-inline-start: 15px; + float: right; +} +*[dir="rtl"] aside { + float: left; +} + +/* Make aside full-width on mobile */ +@media only screen and (max-width: 720px) { + aside { + width: 100%; + float: none; + margin-inline-start: 0; + } +} + +article, fieldset, dialog { + border: 1px solid var(--border); + padding: 1rem; + border-radius: var(--standard-border-radius); + margin-bottom: 1rem; +} + +article h2:first-child, +section h2:first-child { + margin-top: 1rem; +} + +section { + border-top: 1px solid var(--border); + border-bottom: 1px solid var(--border); + padding: 2rem 1rem; + margin: 3rem 0; +} + +/* Don't double separators when chaining sections */ +section + section, +section:first-child { + border-top: 0; + padding-top: 0; +} + +section:last-child { + border-bottom: 0; + padding-bottom: 0; +} + +details { + padding: 0.7rem 1rem; +} + +summary { + cursor: pointer; + font-weight: bold; + padding: 0.7rem 1rem; + margin: -0.7rem -1rem; + word-break: break-all; +} + +details[open] > summary + * { + margin-top: 0; +} + +details[open] > summary { + margin-bottom: 0.5rem; +} + +details[open] > :last-child { + margin-bottom: 0; +} + +/* Format tables */ +table { + border-collapse: collapse; + margin: 1.5rem 0; +} + +td, +th { + border: 1px solid var(--border); + text-align: start; + padding: 0.5rem; +} + +th { + background-color: var(--accent-bg); + font-weight: bold; +} + +tr:nth-child(even) { + /* Set every other cell slightly darker. Improves readability. */ + background-color: var(--accent-bg); +} + +table caption { + font-weight: bold; + margin-bottom: 0.5rem; +} + +/* Format forms */ +textarea, +select, +input, +button, +.button { + font-size: inherit; + font-family: inherit; + padding: 0.5rem; + margin-bottom: 0.5rem; + border-radius: var(--standard-border-radius); + box-shadow: none; + max-width: 100%; + display: inline-block; +} +textarea, +select, +input { + color: var(--text); + background-color: var(--bg); + border: 1px solid var(--border); +} +label { + display: block; +} +textarea:not([cols]) { + width: 100%; +} + +/* Add arrow to drop-down */ +select:not([multiple]) { + background-image: linear-gradient(45deg, transparent 49%, var(--text) 51%), + linear-gradient(135deg, var(--text) 51%, transparent 49%); + background-position: calc(100% - 15px), calc(100% - 10px); + background-size: 5px 5px, 5px 5px; + background-repeat: no-repeat; + padding-inline-end: 25px; +} +*[dir="rtl"] select:not([multiple]) { + background-position: 10px, 15px; +} + +/* checkbox and radio button style */ +input[type="checkbox"], +input[type="radio"] { + vertical-align: middle; + position: relative; + width: min-content; +} + +input[type="checkbox"] + label, +input[type="radio"] + label { + display: inline-block; +} + +input[type="radio"] { + border-radius: 100%; +} + +input[type="checkbox"]:checked, +input[type="radio"]:checked { + background-color: var(--accent); +} + +input[type="checkbox"]:checked::after { + /* Creates a rectangle with colored right and bottom borders which is rotated to look like a check mark */ + content: " "; + width: 0.18em; + height: 0.32em; + border-radius: 0; + position: absolute; + top: 0.05em; + left: 0.17em; + background-color: transparent; + border-right: solid var(--bg) 0.08em; + border-bottom: solid var(--bg) 0.08em; + font-size: 1.8em; + transform: rotate(45deg); +} +input[type="radio"]:checked::after { + /* creates a colored circle for the checked radio button */ + content: " "; + width: 0.25em; + height: 0.25em; + border-radius: 100%; + position: absolute; + top: 0.125em; + background-color: var(--bg); + left: 0.125em; + font-size: 32px; +} + +/* Makes input fields wider on smaller screens */ +@media only screen and (max-width: 720px) { + textarea, + select, + input { + width: 100%; + } +} + +/* Set a height for color input */ +input[type="color"] { + height: 2.5rem; + padding: 0.2rem; +} + +/* do not show border around file selector button */ +input[type="file"] { + border: 0; +} + +/* Misc body elements */ +hr { + border: none; + height: 1px; + background: var(--border); + margin: 1rem auto; +} + +mark { + padding: 2px 5px; + border-radius: var(--standard-border-radius); + background-color: var(--marked); + color: black; +} + +mark a { + color: #0d47a1; +} + +img, +video { + max-width: 100%; + height: auto; + border-radius: var(--standard-border-radius); +} + +figure { + margin: 0; + display: block; + overflow-x: auto; +} + +figcaption { + text-align: center; + font-size: 0.9rem; + color: var(--text-light); + margin-bottom: 1rem; +} + +blockquote { + margin-inline-start: 2rem; + margin-inline-end: 0; + margin-block: 2rem; + padding: 0.4rem 0.8rem; + border-inline-start: 0.35rem solid var(--accent); + color: var(--text-light); + font-style: italic; +} + +cite { + font-size: 0.9rem; + color: var(--text-light); + font-style: normal; +} + +dt { + color: var(--text-light); +} + +/* Use mono font for code elements */ +code, +pre, +pre span, +kbd, +samp { + font-family: var(--mono-font); + color: var(--code); +} + +kbd { + color: var(--preformatted); + border: 1px solid var(--preformatted); + border-bottom: 3px solid var(--preformatted); + border-radius: var(--standard-border-radius); + padding: 0.1rem 0.4rem; +} + +pre { + padding: 1rem 1.4rem; + max-width: 100%; + overflow: auto; + color: var(--preformatted); +} + +/* Fix embedded code within pre */ +pre code { + color: var(--preformatted); + background: none; + margin: 0; + padding: 0; +} + +/* Progress bars */ +/* Declarations are repeated because you */ +/* cannot combine vendor-specific selectors */ +progress { + width: 100%; +} + +progress:indeterminate { + background-color: var(--accent-bg); +} + +progress::-webkit-progress-bar { + border-radius: var(--standard-border-radius); + background-color: var(--accent-bg); +} + +progress::-webkit-progress-value { + border-radius: var(--standard-border-radius); + background-color: var(--accent); +} + +progress::-moz-progress-bar { + border-radius: var(--standard-border-radius); + background-color: var(--accent); + transition-property: width; + transition-duration: 0.3s; +} + +progress:indeterminate::-moz-progress-bar { + background-color: var(--accent-bg); +} + +dialog { + max-width: 40rem; + margin: auto; +} + +dialog::backdrop { + background-color: var(--bg); + opacity: 0.8; +} + +@media only screen and (max-width: 720px) { + dialog { + max-width: 100%; + margin: auto 1em; + } +} + +/* Superscript & Subscript */ +/* Prevent scripts from affecting line-height. */ +sup, sub { + vertical-align: baseline; + position: relative; +} + +sup { + top: -0.4em; +} + +sub { + top: 0.3em; +} + +/* Classes for notices */ +.notice { + background: var(--accent-bg); + border: 2px solid var(--border); + border-radius: 5px; + padding: 1.5rem; + margin: 2rem 0; +} + diff --git a/update-version.sh b/update-version.sh new file mode 100755 index 0000000..ac979c4 --- /dev/null +++ b/update-version.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +set -eu + +VERSION="$(date +%Y-%m-%d)" +sed -r "s/version = \".+\";/version = \"$VERSION\";/g" -i default.nix + diff --git a/zs.nix b/zs.nix new file mode 100644 index 0000000..dabc948 --- /dev/null +++ b/zs.nix @@ -0,0 +1,47 @@ +{ lib, fetchFromGitea, buildGoModule, installShellFiles }: + +buildGoModule rec { + pname = "zs"; + version = "0.4.1"; + + src = fetchFromGitea { + domain = "git.mills.io"; + owner = "prologic"; + repo = "zs"; + rev = version; + hash = "sha256-V8+p19kvVh64yCreNVp4RVdkJkjrq8Q5VbjaJWekZHY="; + }; + + vendorHash = "sha256-KXcYTYO4wnWOup5uJ6T+XwthX5l2FL02JyOt1Nv51Sg="; + + ldflags = [ + "-w" + "-X=main.Version=${version}" + "-X=main.Commit=${src.rev}" + "-X=main.Build=1970-01-01T00:00:00+00:00" + ]; + + nativeBuildInputs = [ installShellFiles ]; + + doCheck = true; + + checkPhase = '' + go test ./... + ''; + + postInstall = '' + installShellCompletion --cmd zs \ + --bash <($out/bin/zs completion bash) \ + --fish <($out/bin/zs completion fish) \ + --zsh <($out/bin/zs completion zsh) + ''; + + meta = with lib; { + description = "An extremely minimal static site generator written in Go"; + homepage = "https://git.mills.io/prologic/zs"; + changelog = "https://git.mills.io/prologic/zs/releases/tag/${version}"; + license = licenses.mit; + maintainers = with maintainers; [ adtya ]; + mainProgram = "zs"; + }; +}