mirror of
https://github.com/CHN-beta/nixos.git
synced 2024-10-22 21:38:44 +08:00
Compare commits
11 Commits
eb886c0c6e
...
293fbeff8a
Author | SHA1 | Date | |
---|---|---|---|
293fbeff8a | |||
4e88fb0bb1 | |||
1163764286 | |||
d6e0300f24 | |||
2039f5ecba | |||
b7592edc26 | |||
39bdf25764 | |||
f05358a7c2 | |||
4e0a1a48fd | |||
3597f58f63 | |||
5c5acd7dee |
29
flake.lock
29
flake.lock
@ -24,17 +24,18 @@
|
||||
"blog": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1728704748,
|
||||
"narHash": "sha256-3EjbWR/0pCoSLYeury+gPxvM8/2NMfE1i0/+N1FAsAc=",
|
||||
"ref": "refs/heads/main",
|
||||
"rev": "dd49995b4e610de537a30e359797cfb8f0971fe5",
|
||||
"revCount": 24,
|
||||
"lastModified": 1729501441,
|
||||
"narHash": "sha256-LHCg3sdVoBJ8lRu13meCHYc4Stb1b7sLPZKZxsZQG6A=",
|
||||
"ref": "public",
|
||||
"rev": "b35b74ef827d5a200e19163bf3c200d4908d7a3c",
|
||||
"revCount": 27,
|
||||
"type": "git",
|
||||
"url": "https://git.chn.moe/chn/blog.git"
|
||||
"url": "file:///home/chn/repo/blog"
|
||||
},
|
||||
"original": {
|
||||
"ref": "public",
|
||||
"type": "git",
|
||||
"url": "https://git.chn.moe/chn/blog.git"
|
||||
"url": "file:///home/chn/repo/blog"
|
||||
}
|
||||
},
|
||||
"blurred-wallpaper": {
|
||||
@ -734,11 +735,11 @@
|
||||
"misskey": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1727700498,
|
||||
"narHash": "sha256-h0oJ9128xsNGLzLTssjnTT+11vW4y+jrjy6p9qq6jFE=",
|
||||
"lastModified": 1729490489,
|
||||
"narHash": "sha256-pYL5gN79GC3GZwjsWG5ufkYGVIg2SHe1ZckJqmUD3MI=",
|
||||
"ref": "refs/heads/chn-mod",
|
||||
"rev": "1eeabe04311c4aed657b184666152eeb5e837df9",
|
||||
"revCount": 26110,
|
||||
"rev": "7aa5ed4066b0f48c808defaa0772dd6d703c80fa",
|
||||
"revCount": 26236,
|
||||
"submodules": true,
|
||||
"type": "git",
|
||||
"url": "https://github.com/CHN-beta/misskey"
|
||||
@ -990,11 +991,11 @@
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1729303996,
|
||||
"narHash": "sha256-exsGKmfs2a5C/Aq/N4nhC8P4f8V4c/J3DumTW8u4O3E=",
|
||||
"lastModified": 1729472774,
|
||||
"narHash": "sha256-PtDH6Y97ydp4a3IfIXVIq3+R5+mzVAoDnO9PiLexPKs=",
|
||||
"owner": "CHN-beta",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "cae35b471936203b970111f9c3d78e0477122610",
|
||||
"rev": "44b28005c62c890f7c8feda855ba0e26223c5b59",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -72,7 +72,7 @@
|
||||
nu-scripts = { url = "github:nushell/nu_scripts"; flake = false; };
|
||||
py4vasp = { url = "github:vasp-dev/py4vasp"; flake = false; };
|
||||
pocketfft = { url = "github:mreineck/pocketfft"; flake = false; };
|
||||
blog = { url = "git+https://git.chn.moe/chn/blog.git"; flake = false; };
|
||||
blog = { url = "git+file:///home/chn/repo/blog?ref=public"; flake = false; };
|
||||
nixos-wallpaper = { url = "git+https://git.chn.moe/chn/nixos-wallpaper.git"; flake = false; };
|
||||
spectroscopy = { url = "github:skelton-group/Phonopy-Spectroscopy"; flake = false; };
|
||||
};
|
||||
|
@ -111,6 +111,8 @@ inputs:
|
||||
(inputs.localLib.attrsToList servers));
|
||||
programs.ssh =
|
||||
{
|
||||
# maybe better network performance
|
||||
package = inputs.pkgs.openssh_hpn;
|
||||
startAgent = true;
|
||||
enableAskPassword = true;
|
||||
askPassword = "${inputs.pkgs.systemd}/bin/systemd-ask-password";
|
||||
|
@ -118,6 +118,12 @@ inputs:
|
||||
xdg-desktop-portal = prev.xdg-desktop-portal.overrideAttrs (prev:
|
||||
{ doCheck = false; nativeBuildInputs = prev.nativeBuildInputs ++ prev.nativeCheckInputs; });
|
||||
gsl = prev.gsl.overrideAttrs { doCheck = false; };
|
||||
pythonPackagesExtensions = prev.pythonPackagesExtensions ++ [(final: prev:
|
||||
{
|
||||
numcodecs = prev.numcodecs.overridePythonAttrs { doCheck = false; };
|
||||
zarr = prev.zarr.overridePythonAttrs (prev:
|
||||
{ disabledTests = prev.disabledTests or [] ++ [ "test_encode_decode_array_dtype_shape_v3" ]; });
|
||||
})];
|
||||
}
|
||||
)
|
||||
// (
|
||||
|
@ -103,7 +103,7 @@ inputs: rec
|
||||
py4vasp = inputs.pkgs.callPackage ./py4vasp.nix { src = inputs.topInputs.py4vasp; };
|
||||
pocketfft = inputs.pkgs.callPackage ./pocketfft.nix { src = inputs.topInputs.pocketfft; };
|
||||
spectroscopy = inputs.pkgs.callPackage ./spectroscopy.nix { src = inputs.topInputs.spectroscopy; };
|
||||
mirism = inputs.pkgs.callPackage ./mirism.nix { inherit biu; stdenv = inputs.pkgs.clang18Stdenv; };
|
||||
mirism = inputs.pkgs.callPackage ./mirism { inherit biu; stdenv = inputs.pkgs.clang18Stdenv; };
|
||||
|
||||
fromYaml = content: builtins.fromJSON (builtins.readFile
|
||||
(inputs.pkgs.runCommand "toJSON" {}
|
||||
|
@ -10,10 +10,11 @@ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
|
||||
endif()
|
||||
|
||||
find_package(biu REQUIRED)
|
||||
find_package(httplib REQUIRED)
|
||||
|
||||
add_executable(mirism src/main.cpp)
|
||||
target_compile_features(mirism PUBLIC cxx_std_23)
|
||||
target_link_libraries(mirism PRIVATE biu::biu)
|
||||
target_link_libraries(mirism PRIVATE biu::biu httplib::httplib)
|
||||
|
||||
install(TARGETS mirism RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
{ stdenv, cmake, pkg-config, biu }: stdenv.mkDerivation
|
||||
{ stdenv, cmake, pkg-config, biu, httplib }: stdenv.mkDerivation
|
||||
{
|
||||
name = "mirism";
|
||||
src = ./.;
|
||||
buildInputs = [ biu ];
|
||||
buildInputs = [ biu httplib ];
|
||||
nativeBuildInputs = [ cmake pkg-config ];
|
||||
}
|
||||
|
21
packages/mirism/src/main.cpp
Normal file
21
packages/mirism/src/main.cpp
Normal file
@ -0,0 +1,21 @@
|
||||
# include <biu.hpp>
|
||||
# include <httplib.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
using namespace biu::literals;
|
||||
|
||||
httplib::SSLServer srv("/var/lib/acme/debug.mirism.one/fullchain.pem",
|
||||
"/var/lib/acme/debug.mirism.one/key.pem");
|
||||
srv.Get("/", [](const httplib::Request& req, httplib::Response& res) {
|
||||
std::cout << "{}"_f(req.headers) << std::endl;
|
||||
httplib::Client cli("https://github.com");
|
||||
auto upstream_res = cli.Get("/");
|
||||
res.headers = upstream_res->headers;
|
||||
res.body = upstream_res->body;
|
||||
res.status = upstream_res->status;
|
||||
std::cout << "{}"_f(upstream_res->headers) << std::endl;
|
||||
std::cout << "{}"_f(upstream_res->body) << std::endl;
|
||||
});
|
||||
srv.listen("127.0.0.1", 15641);
|
||||
}
|
Loading…
Reference in New Issue
Block a user