mirror of
https://github.com/CHN-beta/nixos.git
synced 2026-01-12 00:40:43 +08:00
packages/missgram: rename
This commit is contained in:
@@ -144,7 +144,7 @@ inputs: rec
|
||||
buildProxy = inputs.pkgs.lib.mkBuildproxy ./pybinding/proxy.nix;
|
||||
};
|
||||
brokenaxes = inputs.pkgs.python3Packages.callPackage ./brokenaxes.nix { src = inputs.topInputs.brokenaxes; };
|
||||
misskey-forwarder = inputs.pkgs.callPackage ./misskey-forwarder { inherit biu; stdenv = inputs.pkgs.clang18Stdenv; };
|
||||
missgram = inputs.pkgs.callPackage ./missgram { inherit biu; stdenv = inputs.pkgs.clang18Stdenv; };
|
||||
|
||||
fromYaml = content: builtins.fromJSON (builtins.readFile
|
||||
(inputs.pkgs.runCommand "toJSON" {}
|
||||
|
||||
1
packages/missgram/.envrc
Normal file
1
packages/missgram/.envrc
Normal file
@@ -0,0 +1 @@
|
||||
use flake .#missgram
|
||||
@@ -1,5 +1,5 @@
|
||||
cmake_minimum_required(VERSION 3.14)
|
||||
project(misskey-forwarder VERSION 0.0.0 LANGUAGES CXX)
|
||||
project(missgram VERSION 0.0.0 LANGUAGES CXX)
|
||||
enable_testing()
|
||||
include(GNUInstallDirs)
|
||||
|
||||
@@ -12,13 +12,13 @@ endif()
|
||||
find_package(biu REQUIRED)
|
||||
find_package(httplib REQUIRED)
|
||||
|
||||
add_executable(misskey-forwarder src/main.cpp)
|
||||
target_link_libraries(misskey-forwarder PRIVATE biu::biu httplib::httplib)
|
||||
target_compile_features(misskey-forwarder PRIVATE cxx_std_23)
|
||||
if(DEFINED FORWARDER_CONFIG_FILE)
|
||||
target_compile_definitions(misskey-forwarder PRIVATE FORWARDER_CONFIG_FILE="${FORWARDER_CONFIG_FILE}")
|
||||
add_executable(missgram src/main.cpp)
|
||||
target_link_libraries(missgram PRIVATE biu::biu httplib::httplib)
|
||||
target_compile_features(missgram PRIVATE cxx_std_23)
|
||||
if(DEFINED MISSGRAM_CONFIG_FILE)
|
||||
target_compile_definitions(missgram PRIVATE MISSGRAM_CONFIG_FILE="${MISSGRAM_CONFIG_FILE}")
|
||||
endif()
|
||||
install(TARGETS misskey-forwarder RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||
install(TARGETS missgram RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||
|
||||
get_property(ImportedTargets DIRECTORY "${CMAKE_SOURCE_DIR}" PROPERTY IMPORTED_TARGETS)
|
||||
message("Imported targets: ${ImportedTargets}")
|
||||
@@ -1,8 +1,8 @@
|
||||
{ lib, stdenv, cmake, pkg-config, biu, configFile ? null, httplib }: stdenv.mkDerivation
|
||||
{
|
||||
name = "misskey-forwarder";
|
||||
name = "missgram";
|
||||
src = ./.;
|
||||
buildInputs = [ biu httplib ];
|
||||
nativeBuildInputs = [ cmake pkg-config ];
|
||||
cmakeFlags = lib.optional (configFile != null) [ "-DFORWARDER_CONFIG_FILE=${configFile}" ];
|
||||
cmakeFlags = lib.optional (configFile != null) [ "-DMISSGRAM_CONFIG_FILE=${configFile}" ];
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
# include <biu.hpp>
|
||||
# include <httplib.h>
|
||||
# include <tgbot/tgbot.h>
|
||||
# ifndef FORWARDER_CONFIG_FILE
|
||||
# define FORWARDER_CONFIG_FILE "./config.yaml"
|
||||
# ifndef MISSGRAM_CONFIG_FILE
|
||||
# define MISSGRAM_CONFIG_FILE "./config.yaml"
|
||||
# endif
|
||||
|
||||
int main()
|
||||
@@ -16,7 +16,7 @@ int main()
|
||||
std::string TelegramBotToken;
|
||||
std::string TelegramChatId;
|
||||
int ServerPort;
|
||||
} config = YAML::LoadFile(FORWARDER_CONFIG_FILE).as<Config>();
|
||||
} config = YAML::LoadFile(MISSGRAM_CONFIG_FILE).as<Config>();
|
||||
|
||||
biu::Logger::try_exec([&]
|
||||
{
|
||||
@@ -1 +0,0 @@
|
||||
use flake .#misskey-forwarder
|
||||
Reference in New Issue
Block a user