diff --git a/flake.nix b/flake.nix index 905e061..e8ecb43 100644 --- a/flake.nix +++ b/flake.nix @@ -23,60 +23,7 @@ ); in { - packages = forAllSystems ( - { pkgs, ... }: - rec { - hugo-theme-poison = pkgs.stdenv.mkDerivation { - pname = "hugo-theme-poison"; - homepage = "https://poison.lukeorth.com/"; - version = ""; - - src = pkgs.fetchFromGitHub { - owner = "lukeorth"; - repo = "poison"; - rev = "07485e85f0247518bc64ed0cc6fd6b39abe3d90d"; - hash = "sha256-NQN4u6rBjw+zC7NuDUFg9LUuuvIR7Ed22UIs2jcZtkQ="; - }; - - 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/poison - cp -r ${hugo-theme-poison}/* themes/poison/ - - hugo - ''; - - # Install phase - copy the public directory to the output - installPhase = '' - mkdir -p $out - cp -r public/* $out/ - ''; - }; - - default = zerforschen-plus-content; - } - ); + packages = forAllSystems (import ./packages.nix); devShells = forAllSystems ( { pkgs, system, ... }: diff --git a/packages.nix b/packages.nix new file mode 100644 index 0000000..22b52b0 --- /dev/null +++ b/packages.nix @@ -0,0 +1,49 @@ +{ pkgs, ... }: +rec { + hugo-theme-poison = pkgs.stdenv.mkDerivation { + pname = "hugo-theme-poison"; + homepage = "https://poison.lukeorth.com/"; + version = ""; + + src = pkgs.fetchFromGitHub { + owner = "lukeorth"; + repo = "poison"; + rev = "07485e85f0247518bc64ed0cc6fd6b39abe3d90d"; + hash = "sha256-NQN4u6rBjw+zC7NuDUFg9LUuuvIR7Ed22UIs2jcZtkQ="; + }; + + 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 + ]; + + # Build phase - run Hugo to generate the site + buildPhase = '' + # Copy in theme before building website + mkdir -p themes/poison + cp -r ${hugo-theme-poison}/* themes/poison/ + + hugo + ''; + + # Install phase - copy the public directory to the output + installPhase = '' + mkdir -p $out + cp -r public/* $out/ + ''; + }; + + default = zerforschen-plus-content; +}