~aasg/haunted-blog

06419c17297c3e7ce89ece9841f93b79e3a089f4 — Aluísio Augusto Silva Gonçalves 3 months ago 8304e77
flake: Add a 'production' package

The production package will be what actually goes live on
https://aasg.name.  At the moment, the two differences from the default
package are the inclusion of Matrix-related well-known links (which only
make sense on the live domain) and the Brotli compression of HTML/CSS/JS
files.  No more changes should happen aside from more well-known links.
2 files changed, 25 insertions(+), 13 deletions(-)

M flake.lock
M flake.nix
M flake.lock => flake.lock +13 -13
@@ 8,11 8,11 @@
        ]
      },
      "locked": {
        "lastModified": 1606314273,
        "narHash": "sha256-qUOnigZyKS8B9fvhaHsnOQM8cT/hDGbtSz6Kmu8SB2g=",
        "lastModified": 1618961359,
        "narHash": "sha256-5SDGcek4iRPtB83DzEJX0waCztffUALU6v/PHA7Bv60=",
        "ref": "master",
        "rev": "1e26dfbd9768b4600262d909a2ab2504823404b0",
        "revCount": 103,
        "rev": "30ebec15183581a33bd0af48cbbcc082a8b35966",
        "revCount": 133,
        "type": "git",
        "url": "https://git.sr.ht/~aasg/nixexprs"
      },


@@ 23,11 23,11 @@
    },
    "flake-utils": {
      "locked": {
        "lastModified": 1601282935,
        "narHash": "sha256-WQAFV6sGGQxrRs3a+/Yj9xUYvhTpukQJIcMbIi7LCJ4=",
        "lastModified": 1614513358,
        "narHash": "sha256-LakhOx3S1dRjnh0b5Dg3mbZyH0ToC9I8Y2wKSkBaTzU=",
        "owner": "numtide",
        "repo": "flake-utils",
        "rev": "588973065fce51f4763287f0fda87a174d78bf48",
        "rev": "5466c5bbece17adaab2d82fae80b46e807611bf3",
        "type": "github"
      },
      "original": {


@@ 38,11 38,11 @@
    },
    "flake-utils_2": {
      "locked": {
        "lastModified": 1604964167,
        "narHash": "sha256-+mTmiCD29wecyDaGlbeWpvnysBygagl9FdMVfdU0RTM=",
        "lastModified": 1618868421,
        "narHash": "sha256-vyoJhLV6cJ8/tWz+l9HZLIkb9Rd9esE7p+0RL6zDR6Y=",
        "owner": "numtide",
        "repo": "flake-utils",
        "rev": "af81e8d00b2cd021d8806104f14d66ae429dc2f7",
        "rev": "eed214942bcfb3a8cc09eb3b28ca7d7221e44a94",
        "type": "github"
      },
      "original": {


@@ 53,11 53,11 @@
    },
    "nixpkgs": {
      "locked": {
        "lastModified": 1604987532,
        "narHash": "sha256-O3afggEbKLxnHbNmZq6Mno8dbtNrPk5D2RN3x5HoH5U=",
        "lastModified": 1618925627,
        "narHash": "sha256-SWR9p0+zFytkcQEmv94gcwJBE9F1FatQqkFom5q8Qi8=",
        "owner": "NixOS",
        "repo": "nixpkgs",
        "rev": "dd1b7e377f6d77ddee4ab84be11173d3566d6a18",
        "rev": "d9448c95c5d557d0b2e8bfe13e8865e4b1e3943f",
        "type": "github"
      },
      "original": {

M flake.nix => flake.nix +12 -0
@@ 45,6 45,18 @@
              runHook postInstall
            '';
          };

          # The production build is what actually goes live on
          # https://aasg.name; it includes a few well-known URLs
          # and its HTML/CSS/JS is pre-compressed with Brotli.
          aasg-blog.production = final.aasg-blog.defaultPackage.overrideAttrs (drv: {
            nativeBuildInputs = drv.nativeBuildInputs ++ [ final.aasgBrotlifyHook ];
            postBuild = ''
              mkdir -p $out/.well-known/matrix
              >$out/.well-known/matrix/client printf '{"m.homeserver":{"base_url":"https://matrix.aasg.name"}}\n'
              >$out/.well-known/matrix/server printf '{"m.server":"matrix.aasg.name:443"}\n'
            '';
          });
        };
      };