From 4f28358d29d6fb2a0419dd54469a4245185579e9 Mon Sep 17 00:00:00 2001 From: witcher Date: Tue, 25 Apr 2023 20:34:41 +0200 Subject: [PATCH] nix: add run for developing --- flake.nix | 37 +++++++++++++++++++++---------------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/flake.nix b/flake.nix index d55e765..155938f 100644 --- a/flake.nix +++ b/flake.nix @@ -13,27 +13,32 @@ buildDeps = [ pkgs.hugo ]; in rec { - packages = { - wiredspace = pkgs.stdenvNoCC.mkDerivation { - name = "wiredspace.de"; - src = self; - buildInputs = buildDeps; - phases = [ "unpackPhase" "buildPhase" "installPhase" ]; - buildPhase = '' - hugo - ''; - installPhase = '' - mkdir -p $out - cp -r public/* $out - ''; - }; + packages.wiredspace = pkgs.stdenvNoCC.mkDerivation { + name = "wiredspace.de"; + src = self; + buildInputs = buildDeps; + phases = [ "unpackPhase" "buildPhase" "installPhase" ]; + buildPhase = '' + hugo + ''; + installPhase = '' + mkdir -p $out + cp -r public/* $out + ''; }; - defaultPackage = packages.wiredspace; + packages.default = packages.wiredspace; devShells.default = pkgs.mkShell { buildInputs = buildDeps; }; - devShell = self.devShells.${system}.default; + devShell = devShells.default; formatter = pkgs.nixfmt; + apps.serve = flake-utils.lib.mkApp { + drv = pkgs.writeShellScriptBin "run" '' + ${pkgs.hugo}/bin/hugo serve + ''; + }; + apps.default = apps.serve; } ); } + -- 2.45.2