diff options
author | Linnnus <[email protected]> | 2024-02-01 22:59:38 +0100 |
---|---|---|
committer | Linnnus <[email protected]> | 2024-02-04 09:58:06 +0100 |
commit | d38f82f6462af4e5aad6a2c776f5c00ce5b13c87 (patch) | |
tree | 01a222792dfb10473ae4370b4fc90f3a48e1a499 /flake.nix |
feat: initial commit
Here is a small overview of the state of the project at this first
commit.
I have basic Git Repo -> HTML working, and a plan for how setting up an
actual server would work (mainly, NGINX + a git hook to rebuild).
The main thing I'm working on right now is parsing WikiCreole, though I
am starting to wonder if this is the right langauge. WikiCreole is
pretty irregular and has a lot of edge cases (e.g. around emphasis).
Diffstat (limited to 'flake.nix')
-rw-r--r-- | flake.nix | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..75ab105 --- /dev/null +++ b/flake.nix @@ -0,0 +1,66 @@ +{ + description = "Flake utils demo"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/23.05"; + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = { self, nixpkgs, flake-utils }: + flake-utils.lib.eachDefaultSystem (system: + let + pkgs = nixpkgs.legacyPackages.${system}; + + simple-wiki = pkgs.stdenv.mkDerivation { + pname = "simple-wiki"; + version = "0.0.0"; + + src = ./.; + + nativeBuildInputs = with pkgs; [ pkg-config ]; + buildInputs = with pkgs; [ libgit2 ]; + + installPhase = '' + mkdir -p $out + make PREFIX=$out install + ''; + }; + + creole-test = pkgs.stdenv.mkDerivation rec { + pname = "creole-test"; + version = simple-wiki.version; + + src = ./.; + + nativeBuildInputs = with pkgs; [ pkg-config ]; + buildInputs = with pkgs; [ libgit2 ]; + + installPhase = '' + mkdir -p $out/bin + make build/creole-test + mv build/creole-test $out/bin/.creole-test-wrapped + + cat >$out/bin/creole-test <<EOF + #!${pkgs.bash}/bin/bash + cd ${src} + exec $out/bin/.creole-test-wrapped + EOF + chmod +x $out/bin/creole-test + ''; + }; + + devShell = pkgs.mkShell { + nativeBuildInputs = with pkgs; [ pkg-config ]; + buildInputs = with pkgs; [ libgit2 ]; + }; + in + { + packages = { + inherit simple-wiki creole-test; + default = simple-wiki; + }; + + devShells.default = devShell; + } + ); +} |