{ description = "c8h4.io website"; inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; flake-utils.url = "github:numtide/flake-utils"; treefmt-nix = { url = "github:numtide/treefmt-nix"; inputs.nixpkgs.follows = "nixpkgs"; }; }; outputs = { self, nixpkgs, flake-utils, treefmt-nix, ... }: flake-utils.lib.eachDefaultSystem (system: let pkgs = import nixpkgs { inherit system; }; inherit (flake-utils.lib) mkApp; treefmt = treefmt-nix.lib.evalModule pkgs { projectRootFile = "flake.nix"; programs = { nixfmt = { enable = true; package = pkgs.nixfmt-classic; }; statix.enable = true; deadnix.enable = true; prettier.enable = true; }; }; c8h4-io = pkgs.stdenv.mkDerivation { name = "c8h4-io-hugo"; src = ./.; buildInputs = with pkgs; [ hugo ]; buildPhase = '' hugo --minify ''; installPhase = '' mkdir -p $out cp -vr public/* $out/ ''; }; update-gpg-key = pkgs.writeShellApplication { name = "c8h4-io-update-gpg-key"; runtimeInputs = with pkgs; [ gnupg ]; text = '' gpg --export --armor 9C561D6430B28D6BDCBC9CEB73D5E7FDEE3DE49A >static/gpg.asc ''; }; devserver = pkgs.writeShellApplication { name = "c8h4-io-devserver"; runtimeInputs = with pkgs; [ hugo ]; text = '' hugo server --renderToMemory ''; }; in { apps = { default = mkApp { drv = devserver; }; devserver = mkApp { drv = devserver; }; update-gpg-key = mkApp { drv = update-gpg-key; }; }; checks = rec { inherit c8h4-io; formatting = treefmt.config.build.check self; }; formatter = treefmt.config.build.wrapper; packages = rec { inherit c8h4-io; default = c8h4-io; }; devShells.default = pkgs.mkShell { inputsFrom = [ treefmt.config.build.devShell ]; nativeBuildInputs = with pkgs; [ hugo ]; }; }); }