{ description = "The Website for Trinitrix, deployed at trinitrix.vhack.eu"; inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; treefmt-nix = { url = "github:numtide/treefmt-nix"; inputs = { nixpkgs.follows = "nixpkgs"; }; }; # inputs for following systems = { url = "github:nix-systems/x86_64-linux"; # only evaluate for this system }; flake-utils = { url = "github:numtide/flake-utils"; inputs = { systems.follows = "systems"; }; }; }; outputs = { self, nixpkgs, flake-utils, treefmt-nix, ... }: flake-utils.lib.eachDefaultSystem (system: let pkgs = nixpkgs.legacyPackages."${system}"; nativeBuildInputs = with pkgs; [hugo]; treefmtEval = import ./treefmt.nix {inherit treefmt-nix pkgs;}; name = "trinitrix_website"; risotto = pkgs.fetchFromGitHub { hash = "sha256-uYTrWkoxSnKfl3wgNRI9Bbqr8eK27vLYyYmlmcaG160="; owner = "joeroe"; repo = "risotto"; rev = "v0.4.0"; }; build = pkgs.stdenv.mkDerivation { inherit name; src = ./.; inherit nativeBuildInputs; configurePhase = '' mkdir --parents themes/risotto; cp --recursive ${risotto}/. ./themes/risotto; ''; buildPhase = '' hugo ''; installPhase = '' cp --recursive ./public "$out"; ''; }; in { packages.default = build; checks = { inherit build; formatting = treefmtEval.config.build.check self; }; formatter = treefmtEval.config.build.wrapper; devShells.default = pkgs.mkShell { packages = with pkgs; [ cocogitto licensure ]; inherit nativeBuildInputs; }; }); } # vim: ts=2