Compare commits

...

5 Commits

Author SHA1 Message Date
Greg Shuflin (aider)
151824233b docs: Use em dash in project description 2025-04-07 19:41:44 -07:00
Greg Shuflin
fa77f6364c make nix run work 2025-04-07 19:34:09 -07:00
Greg Shuflin (aider)
b8265ae360 feat: Add Nix app to serve frontend with Python HTTP server 2025-04-07 19:27:41 -07:00
Greg Shuflin (aider)
fc1b37333b feat: Uncomment and update outputs section in flake.nix for improved Nix build configuration 2025-04-07 19:26:17 -07:00
Greg Shuflin
c59e0a0324 refactor: Comment out entire flake outputs configuration 2025-04-07 19:26:15 -07:00
4 changed files with 50 additions and 25 deletions

1
.gitignore vendored
View File

@ -9,3 +9,4 @@ node_modules/
!.yarn/versions
.parcel-cache
.aider*

12
flake.lock generated
View File

@ -5,11 +5,11 @@
"systems": "systems"
},
"locked": {
"lastModified": 1692799911,
"narHash": "sha256-3eihraek4qL744EvQXsK1Ha6C3CR7nnT8X2qWap4RNk=",
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "f9e7cf818399d17d347f847525c5a5a8032e4e44",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
@ -20,11 +20,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1693250523,
"narHash": "sha256-y3up5gXMTbnCsXrNEB5j+7TVantDLUYyQLu/ueiXuyg=",
"lastModified": 1743964447,
"narHash": "sha256-nEo1t3Q0F+0jQ36HJfbJtiRU4OI+/0jX/iITURKe3EE=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "3efb0f6f404ec8dae31bdb1a9b17705ce0d6986e",
"rev": "063dece00c5a77e4a0ea24e5e5a5bd75232806f8",
"type": "github"
},
"original": {

View File

@ -1,40 +1,64 @@
{
description = "Kucinako - Wordbook of Arzhanai languages";
description = "Kucinako Wordbook of Arzhanai languages";
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
outputs = {
self,
nixpkgs,
flake-utils,
}:
flake-utils.lib.eachDefaultSystem (
system: let
pkgs = nixpkgs.legacyPackages.${system};
node-modules = pkgs.mkYarnPackage {
name = "node-modules";
src = ./.;
packageJSON = ./package.json;
yarnLock = ./yarn.lock;
};
frontend = pkgs.stdenv.mkDerivation {
name = "frontend";
src = ./.;
buildInputs = [pkgs.yarn node-modules pkgs.lmdb];
buildInputs = [pkgs.yarn node-modules pkgs.nodejs];
buildPhase = ''
ln -s ${node-modules}/libexec/kucinako/node_modules node_modules
ln -sf ${node-modules}/libexec/kucinako/node_modules node_modules
${pkgs.yarn}/bin/yarn build
'';
installPhase = ''
mkdir $out
mv dist $out/dist
'';
installPhase = ''
mkdir -p $out
cp -r dist/* $out/
# Create a bin directory with a wrapper script
mkdir -p $out/bin
cat > $out/bin/frontend <<EOF
#!/bin/sh
${pkgs.python3}/bin/python -m http.server --directory $out 8000
EOF
chmod +x $out/bin/frontend
'';
};
in
{
packages = {
node-modules = node-modules;
default = frontend;
};
}
in {
packages = {
node-modules = node-modules;
default = frontend;
};
apps.default = {
type = "app";
program = "${frontend}/bin/frontend";
};
devShells.default = pkgs.mkShell {
buildInputs = [
pkgs.nodejs
pkgs.yarn
pkgs.nodePackages.typescript
];
};
}
);
}

View File

@ -201,7 +201,7 @@ const App = (_props) => {
<PasswordDialog />
<div className="container">
<div className="search">
<h1>Kucinako - Wordbook of Arzhanai languages</h1>
<h1>Kucinako Wordbook of Arzhanai languages</h1>
<p><b>Kucinako</b> (<i>Saimiar</i> "word-book") is a dictionary of words in various languages of the world Arzhanø, and their English
equivalents.</p>
<div className="textInput">