mirror of
https://github.com/KeyZox71/webserv.git
synced 2025-05-10 23: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 =
|
outputs =
|
||||||
inputs@{ nixpkgs, ... }:
|
inputs@{ self, nixpkgs, ... }:
|
||||||
let
|
let
|
||||||
supportedSystems = [
|
supportedSystems = [
|
||||||
"x86_64-linux"
|
"x86_64-linux"
|
||||||
@ -26,6 +26,31 @@
|
|||||||
);
|
);
|
||||||
in
|
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 (
|
devShells = forEachSupportedSystem (
|
||||||
{ pkgs }:
|
{ pkgs }:
|
||||||
{
|
{
|
||||||
|
@ -101,7 +101,7 @@ Route::Route(toml::ANode *table)
|
|||||||
_root = *static_cast<std::string *>(val);
|
_root = *static_cast<std::string *>(val);
|
||||||
else
|
else
|
||||||
#ifdef PKGS
|
#ifdef PKGS
|
||||||
_root = "/var/www/html";
|
_root = "/usr/share/webserv";
|
||||||
#else
|
#else
|
||||||
_root = "./html";
|
_root = "./html";
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user