diff --git a/default.nix b/default.nix new file mode 100644 index 0000000..2e2c842 --- /dev/null +++ b/default.nix @@ -0,0 +1,17 @@ +{ + stdenv, + zola, + zerm, +}: +stdenv.mkDerivation { + pname = "averywinters.org"; + version = "1.0.0"; + src = ./.; + nativeBuildInputs = [zola]; + configurePhase = '' + mkdir -p themes + ln -snf "${zerm}" "themes/zerm" + ''; + buildPhase = "zola build"; + installPhase = "cp -r public $out"; +} diff --git a/flake.nix b/flake.nix index c455265..b2089bb 100644 --- a/flake.nix +++ b/flake.nix @@ -26,41 +26,34 @@ nixpkgs, zerm, ... - }: (flake-utils.lib.eachDefaultSystem (system: let - pkgs = import nixpkgs { - inherit system; - overlays = [devshell.overlays.default]; - }; - pkg = pkgs.stdenv.mkDerivation { - pname = "averywinters.org"; - version = "1.0.0"; - src = ./.; - nativeBuildInputs = [pkgs.zola]; - configurePhase = '' - mkdir -p themes - ln -snf "${zerm}" "themes/zerm" - ''; - buildPhase = "zola build"; - installPhase = "cp -r public $out"; - }; - in { - formatter = pkgs.alejandra; - devShells.default = let - commands = [ - {package = pkgs.zola;} - ]; - startupScript = '' - mkdir -p themes - ln -snf "${zerm}" "themes/zerm" - ''; - in - pkgs.devshell.mkShell { - inherit commands; - devshell.startup.themes.text = startupScript; + }: + (flake-utils.lib.eachDefaultSystem (system: let + pkgs = import nixpkgs { + inherit system; + overlays = [ + devshell.overlays.default + ]; + }; + in { + formatter = pkgs.alejandra; + devShells.default = let + commands = [ + {package = pkgs.zola;} + ]; + startupScript = '' + mkdir -p themes + ln -snf "${zerm}" "themes/zerm" + ''; + in + pkgs.devshell.mkShell { + inherit commands; + devshell.startup.themes.text = startupScript; + }; + packages.default = pkgs.callPackage ./default.nix {inherit zerm;}; + })) + // { + overlays.default = final: prev: { + www = prev.callPackage ./default.nix {inherit zerm;}; }; - packages.default = pkg; - overlays.default = final: prev: { - www = pkg; }; - })); }