~jshholland/inv.alid.pw

12f65ca52c9239cdd2c444648ddd16d65eafa0ac — Josh Holland 7 months ago 2639c02
flake: build website as package
1 files changed, 13 insertions(+), 3 deletions(-)

M flake.nix
M flake.nix => flake.nix +13 -3
@@ 8,14 8,24 @@
      forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f nixpkgs.legacyPackages.${system});
    in
    {
      devShells = forAllSystems (pkgs: {
        default = pkgs.mkShellNoCC {
          packages = [
      packages = forAllSystems (pkgs: {
        inv-alid-pw = pkgs.stdenvNoCC.mkDerivation {
          name = "inv.alid.pw";
          src = ./.;
          nativeBuildInputs = [
            pkgs.pandoc
            pkgs.djot-js
            pkgs.yq-go
          ];
          installPhase = ''
            runHook preInstall
            mkdir $out
            cp -a site/* $out
            runHook postInstall
          '';
        };

        default = self.packages.${pkgs.system}.inv-alid-pw;
      });

      formatter = forAllSystems (pkgs: pkgs.nixfmt-rfc-style);