From 0be3937b33af3960fac8e15bfb04ae9f20e3add9 Mon Sep 17 00:00:00 2001 From: adjoly Date: Thu, 8 May 2025 11:17:31 +0200 Subject: [PATCH] =?UTF-8?q?=E3=80=8C=E2=9C=A8=E3=80=8D=20feat:=20added=20p?= =?UTF-8?q?ackage=20to=20flake?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- flake.nix | 27 ++++++++++++++++++++++++++- src/config/Route.cpp | 2 +- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/flake.nix b/flake.nix index de5f7de..53ed6f1 100644 --- a/flake.nix +++ b/flake.nix @@ -8,7 +8,7 @@ }; outputs = - inputs@{ nixpkgs, ... }: + inputs@{ self, nixpkgs, ... }: let supportedSystems = [ "x86_64-linux" @@ -26,6 +26,31 @@ ); in { + packages = forEachSupportedSystem ( + { pkgs }: + rec { + default = webserv; + webserv = pkgs.stdenv.mkDerivation { + name = "webserv"; + src = pkgs.fetchgit { + url = "https://github.com/keyzox71/webserv.git"; + rev = "8ef2803"; # Specify the revision + sha256 = "kjHPL1LInRv+8RE2Cyqt2R9M8qxpvkmvNjLhQLm3AWs="; # Specify the SHA-256 hash + fetchSubmodules = true; + }; + buildInputs = with pkgs; [ + clang + ]; + buildPhase = '' + PKGS=true make + ''; + installPhase = '' + mkdir -p $out/bin + cp webserv $out/bin + ''; + }; + } + ); devShells = forEachSupportedSystem ( { pkgs }: { diff --git a/src/config/Route.cpp b/src/config/Route.cpp index 7dc7afe..0dfa248 100644 --- a/src/config/Route.cpp +++ b/src/config/Route.cpp @@ -101,7 +101,7 @@ Route::Route(toml::ANode *table) _root = *static_cast(val); else #ifdef PKGS - _root = "/var/www/html"; + _root = "/usr/share/webserv"; #else _root = "./html"; #endif