~jack/jackkelly-name

6e4090db93734c5dd5a015d204f026b6d5fbadba — Jack Kelly 3 years ago 382e80d
Freeze the site and add CASAAAAA
4 files changed, 189 insertions(+), 11 deletions(-)

M .gitignore
R content/blog/{0130-a-small-static-app-with-reflex.markdown => 0130-a-static-frontend-app-with-haskell-and-reflex.markdown}
M flake.lock
M flake.nix
M .gitignore => .gitignore +0 -1
@@ 2,7 2,6 @@
\#*#
_cache/
_out/
content
dist-newstyle/
dist/
result

R content/blog/0130-a-small-static-app-with-reflex.markdown => content/blog/0130-a-static-frontend-app-with-haskell-and-reflex.markdown +6 -5
@@ 1,15 1,16 @@
---
title: A Small Static App With Reflex
title: A Static Frontend App With Haskell and Reflex
author: Jack Kelly
date: 2021-10-31T13:00:00
date: 2021-11-09T13:00:00
tags: haskell, nix, coding
---

Over the past couple of days, I built my first static frontend
application using [`reflex`](https://reflex-frp.org). It's called
[`CASAAAAA`](https://git.sr.ht/~jack/casaaaaa), and it's an
interactive fuzzy searcher for aviation terms. The fuzzy search and
the terms were already defined in
[`CASAAAAA`](https://git.sr.ht/~jack/casaaaaa) ([live
demo](/blog/archives/2021/11/09/a_static_frontend_app_with_haskell_and_reflex/casaaaaa)),
and it's an interactive fuzzy searcher for aviation terms. The fuzzy
search and the terms were already defined in
[`casa-abbreviations-and-acronyms`](https://hackage.haskell.org/package/casa-abbreviations-and-acronyms),
so most of the work centred around the reflex-side of things. Because
I like a challenge, I used [Nix

M flake.lock => flake.lock +172 -3
@@ 1,5 1,43 @@
{
  "nodes": {
    "casa-abbreviations-and-acronyms": {
      "flake": false,
      "locked": {
        "lastModified": 1635683112,
        "narHash": "sha256-OSpHYZi4/+ltZI86KEJKercx46AhNvSJO/wpYH5JM1I=",
        "owner": "system-f",
        "repo": "casa-abbreviations-and-acronyms",
        "rev": "f6b7edacbdf24e92937cde3f9d11ee5448b86294",
        "type": "github"
      },
      "original": {
        "owner": "system-f",
        "repo": "casa-abbreviations-and-acronyms",
        "type": "github"
      }
    },
    "casaaaaa": {
      "inputs": {
        "casa-abbreviations-and-acronyms": "casa-abbreviations-and-acronyms",
        "flake-compat": "flake-compat",
        "flake-utils": "flake-utils",
        "monoid-subclasses": "monoid-subclasses",
        "reflex-platform": "reflex-platform"
      },
      "locked": {
        "lastModified": 1635717226,
        "narHash": "sha256-mehLrliqF2wRYur5Gb64MwCbiVdUXJz6tm88KJKJF0E=",
        "ref": "master",
        "rev": "882b2d8d447a182bde24b5f1b9dc4da8821ce3b7",
        "revCount": 12,
        "type": "git",
        "url": "https://git.sr.ht/~jack/casaaaaa"
      },
      "original": {
        "type": "git",
        "url": "https://git.sr.ht/~jack/casaaaaa"
      }
    },
    "flake-compat": {
      "flake": false,
      "locked": {


@@ 16,6 54,38 @@
        "type": "github"
      }
    },
    "flake-compat_2": {
      "flake": false,
      "locked": {
        "lastModified": 1627913399,
        "narHash": "sha256-hY8g6H2KFL8ownSiFeMOjwPC8P0ueXpCVEbxgda3pko=",
        "owner": "edolstra",
        "repo": "flake-compat",
        "rev": "12c64ca55c1014cdc1b16ed5a804aa8576601ff2",
        "type": "github"
      },
      "original": {
        "owner": "edolstra",
        "repo": "flake-compat",
        "type": "github"
      }
    },
    "flake-compat_3": {
      "flake": false,
      "locked": {
        "lastModified": 1627913399,
        "narHash": "sha256-hY8g6H2KFL8ownSiFeMOjwPC8P0ueXpCVEbxgda3pko=",
        "owner": "edolstra",
        "repo": "flake-compat",
        "rev": "12c64ca55c1014cdc1b16ed5a804aa8576601ff2",
        "type": "github"
      },
      "original": {
        "owner": "edolstra",
        "repo": "flake-compat",
        "type": "github"
      }
    },
    "flake-utils": {
      "locked": {
        "lastModified": 1634851050,


@@ 31,8 101,89 @@
        "type": "github"
      }
    },
    "flake-utils_2": {
      "locked": {
        "lastModified": 1634851050,
        "narHash": "sha256-N83GlSGPJJdcqhUxSCS/WwW5pksYf3VP1M13cDRTSVA=",
        "owner": "numtide",
        "repo": "flake-utils",
        "rev": "c91f3de5adaf1de973b797ef7485e441a65b8935",
        "type": "github"
      },
      "original": {
        "owner": "numtide",
        "repo": "flake-utils",
        "type": "github"
      }
    },
    "flake-utils_3": {
      "locked": {
        "lastModified": 1634851050,
        "narHash": "sha256-N83GlSGPJJdcqhUxSCS/WwW5pksYf3VP1M13cDRTSVA=",
        "owner": "numtide",
        "repo": "flake-utils",
        "rev": "c91f3de5adaf1de973b797ef7485e441a65b8935",
        "type": "github"
      },
      "original": {
        "owner": "numtide",
        "repo": "flake-utils",
        "type": "github"
      }
    },
    "monoid-subclasses": {
      "flake": false,
      "locked": {
        "lastModified": 1635627255,
        "narHash": "sha256-Rm2vRZwwoARma7Tre9yuAPEa8goaDtJFy48GcxQNZ74=",
        "owner": "endgame",
        "repo": "monoid-subclasses",
        "rev": "a98efc492778145ecbc80b51165c14644bba7a89",
        "type": "github"
      },
      "original": {
        "owner": "endgame",
        "ref": "ghcjs",
        "repo": "monoid-subclasses",
        "type": "github"
      }
    },
    "nix-freeze-tree": {
      "inputs": {
        "flake-compat": "flake-compat_3",
        "flake-utils": "flake-utils_3",
        "nixpkgs": "nixpkgs"
      },
      "locked": {
        "lastModified": 1636454663,
        "narHash": "sha256-NBaEbk8Sdx+rYSCnGjea+5Jyyg1Nag30q6Pu/quanVk=",
        "ref": "master",
        "rev": "526efaa834de294b823235f6a9bfa344e2fe4461",
        "revCount": 55,
        "type": "git",
        "url": "https://git.sr.ht/~jack/nix-freeze-tree"
      },
      "original": {
        "type": "git",
        "url": "https://git.sr.ht/~jack/nix-freeze-tree"
      }
    },
    "nixpkgs": {
      "locked": {
        "lastModified": 1635735275,
        "narHash": "sha256-C0WrxH70xFJMl+oznZrSPS3VwqWCyj1MVSTvpkb7ryQ=",
        "owner": "NixOS",
        "repo": "nixpkgs",
        "rev": "509d236edf0056d05547c776140fe7cfcf2305bd",
        "type": "github"
      },
      "original": {
        "id": "nixpkgs",
        "type": "indirect"
      }
    },
    "nixpkgs_2": {
      "locked": {
        "lastModified": 1636453756,
        "narHash": "sha256-2RLrJkmYe4puVwr0lu60A+6HWOV8GE2fP9jkj+R7L1U=",
        "owner": "nixos",


@@ 46,11 197,29 @@
        "type": "github"
      }
    },
    "reflex-platform": {
      "flake": false,
      "locked": {
        "lastModified": 1635470016,
        "narHash": "sha256-laWzpkRrMWNxlIp6A15ujuqxMizSeKl5iB5dIK+XbvY=",
        "owner": "reflex-frp",
        "repo": "reflex-platform",
        "rev": "677fa9af8451cf26859f0e6bc4433edfe11b0664",
        "type": "github"
      },
      "original": {
        "owner": "reflex-frp",
        "repo": "reflex-platform",
        "type": "github"
      }
    },
    "root": {
      "inputs": {
        "flake-compat": "flake-compat",
        "flake-utils": "flake-utils",
        "nixpkgs": "nixpkgs"
        "casaaaaa": "casaaaaa",
        "flake-compat": "flake-compat_2",
        "flake-utils": "flake-utils_2",
        "nix-freeze-tree": "nix-freeze-tree",
        "nixpkgs": "nixpkgs_2"
      }
    }
  },

M flake.nix => flake.nix +11 -2
@@ 2,11 2,13 @@
  description = "jackkelly.name";

  inputs = {
    casaaaaa.url = "git+https://git.sr.ht/~jack/casaaaaa";
    flake-compat = {
      url = "github:edolstra/flake-compat";
      flake = false;
    };
    flake-utils.url = "github:numtide/flake-utils";
    nix-freeze-tree.url = "git+https://git.sr.ht/~jack/nix-freeze-tree";
    nixpkgs.url = "github:nixos/nixpkgs";
  };



@@ 14,8 16,11 @@
    inputs.flake-utils.lib.eachDefaultSystem (system:
      let
        nixpkgs = import inputs.nixpkgs { inherit system; };

        jackkelly-name =
          nixpkgs.haskellPackages.callPackage ./jackkelly-name.nix { };
        casaaaaa = inputs.casaaaaa.defaultPackage.${system};

        site = nixpkgs.stdenv.mkDerivation {
          pname = "jackkelly-name-site";
          version = jackkelly-name.version;


@@ 27,12 32,16 @@
          installPhase = ''
            mkdir -p $out
            cp -Rv _out/* $out

            mkdir -p $out/blog/archives/2021/11/09/a_static_frontend_app_with_haskell_and_reflex/casaaaaa
            cp -Rv ${casaaaaa}/* $out/blog/archives/2021/11/09/a_static_frontend_app_with_haskell_and_reflex/casaaaaa
          '';
        };
        site-frozen = inputs.nix-freeze-tree.lib.${system}.freeze site;
      in
      {
        defaultPackage = site;
        defaultPackage = site-frozen;
        devShell = jackkelly-name.env;
        packages = { inherit jackkelly-name site; };
        packages = { inherit jackkelly-name site site-frozen; };
      });
}