{ description = "Flake for the contents of https://zerforschen.plus"; inputs = { nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-24.11"; }; outputs = { self, nixpkgs }: let supported-systems = [ "x86_64-linux" "aarch64-linux" ]; forAllSystems = f: nixpkgs.lib.genAttrs supported-systems ( system: f rec { pkgs = nixpkgs.legacyPackages.${system}; inherit system; } ); in { packages = forAllSystems ( { pkgs, ... }: rec { hugo-theme-m10c = pkgs.stdenv.mkDerivation { pname = "hugo-theme-m10c"; homepage = "https://themes.gohugo.io/themes/hugo-theme-m10c/"; version = ""; src = pkgs.fetchFromGitHub { owner = "vaga"; repo = "hugo-theme-m10c"; rev = "862c6e941be9bc46ce8adc6a2fa9e984ba647d6f"; hash = "sha256-wcJSGjL/u43hPLblPmUhusqiMmadVBWJhihRinRXqzg="; }; installPhase = '' mkdir -p $out cp -r * $out ''; }; zerforschen-plus-content = pkgs.stdenv.mkDerivation { name = "zerforschen-plus-content"; # Source directory containing your Hugo project src = ./.; # Build dependencies nativeBuildInputs = [ pkgs.hugo ]; preBuildPhase = '' ''; # Build phase - run Hugo to generate the site buildPhase = '' # Copy in theme before building website mkdir -p themes/hugo-theme-m10c cp -r ${hugo-theme-m10c}/* themes/hugo-theme-m10c/ hugo ''; # Install phase - copy the public directory to the output installPhase = '' mkdir -p $out cp -r public/* $out/ ''; }; default = zerforschen-plus-content; } ); devShells = forAllSystems ( { pkgs, system, ... }: { default = pkgs.mkShellNoCC rec { inputsFrom = [ self.packages.${system}.default ]; shellHook = '' mkdir -p themes ln -snf "${self.packages.${system}.hugo-theme-m10c}" themes/hugo-theme-m10c ''; }; } ); formatter = forAllSystems ({ pkgs, ... }: pkgs.nixfmt-rfc-style); }; }