mirror of
https://github.com/KeyZox71/webserv.git
synced 2025-05-10 20:48:46 +02:00
「✨」 feat: added package to flake
This commit is contained in:
27
flake.nix
27
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 }:
|
||||
{
|
||||
|
@ -101,7 +101,7 @@ Route::Route(toml::ANode *table)
|
||||
_root = *static_cast<std::string *>(val);
|
||||
else
|
||||
#ifdef PKGS
|
||||
_root = "/var/www/html";
|
||||
_root = "/usr/share/webserv";
|
||||
#else
|
||||
_root = "./html";
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user