summary refs log tree commit diff
path: root/flake.nix
diff options
context:
space:
mode:
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix33
1 files changed, 14 insertions, 19 deletions
diff --git a/flake.nix b/flake.nix
index d88cbe6..f52f5c4 100644
--- a/flake.nix
+++ b/flake.nix
@@ -14,36 +14,31 @@
       sha256 = "1pafahvq8xhpba2hgpipkbnhjr3j9zchnxfq4pnxqvidwz5rqr51";
     };
 
-    md2saait = pkgs.stdenv.mkDerivation {
-      name = "md2saait";
-      src = ./md2saait;
-      installPhase = ''
-        mkdir -p $out/bin
-        cp ./* $out/bin
-        sed -i 's:yq:${pkgs.yq}/bin/yq:g' $out/bin/frontmatter2cfg
-      '';
-    };
-
   in {
     defaultPackage.${system} = self.packages.${system}.low-puszcza;
 
     packages.${system}.low-puszcza = pkgs.stdenv.mkDerivation {
       name = "low-puszcza";
       src = self;
-      nativeBuildInputs = with pkgs; [
-        md2saait
-        zip
-        pandoc
-        nur.repos.pn.saait
+      nativeBuildInputs = [
+        pkgs.zip
+        pkgs.pandoc
+        pkgs.nur.repos.pn.saait
       ];
 
       buildPhase = ''
+        sed -i 's:yq:${pkgs.yq}/bin/yq:g' ./md2saait/frontmatter2cfg
+        sed -i 's:rev:${pkgs.busybox}/bin/rev:g' ./md2saait/getdate
+
         cp ${kronika}/wpisy wpisy -r
-        for f in `find wpisy -name *.md`; do
+        for f in `find wpisy -name '*.md'`; do
           name=$(basename $f .md)
-          date=$(getdate $f)
-          frontmatter2cfg $f > pages/$date_$name.cfg
-          pandoc $f > pages/$date_$name.html
+          d=$(./md2saait/getdate $f)
+
+          ./md2saait/frontmatter2cfg $f > pages/$d-$name.cfg
+          pandoc $f > pages/$d-$name.html
+        done
+        ls pages
         make
       '';