Compare commits

..

No commits in common. "b2bd8bbaae8afb0a976c05fd6d21a0228a418b82" and "f1b25b4e448c8a12285666d24504fac2d6db88f9" have entirely different histories.

7 changed files with 38 additions and 71 deletions

1
.gitignore vendored
View file

@ -30,4 +30,3 @@ llamafile.git
/.direnv/
*/dist/
.aider*

View file

@ -1,26 +0,0 @@
{
pkgs,
lib,
config,
...
}: let
# list paths
pkgs-paths-list = lib.fileset.toList (lib.fileset.fromSource (lib.sources.sourceFilesBySuffices ./. [".nix"]));
# no default.nix
filtered-paths-list = builtins.filter (path: builtins.baseNameOf path != "default.nix") pkgs-paths-list;
# filename-extension parsed out
pkgs-paths =
builtins.map
(path: {
name = lib.strings.removeSuffix ".nix" (builtins.baseNameOf path);
path = path;
})
filtered-paths-list;
# import each path
imported-pkgs = lib.attrsets.mergeAttrsList (builtins.map
(pkg: {
"${pkg.name}" = pkgs.callPackage pkg.path {};
})
pkgs-paths);
in
imported-pkgs

View file

@ -25,12 +25,12 @@ mod html_elements {
}
}
struct TestaController {}
struct TestController {}
#[controller(
state = AppState
)]
impl TestaController {
impl TestController {
#[route(GET "/")]
async fn index(State(_): State<AppState>) -> impl IntoResponse {
maud! {
@ -85,9 +85,6 @@ impl TestaController {
maud! {
h1 { "Item" }
div {
}
p {
(format!("{id:?} {amount:?} {offset:?} {state:?}"))
}
@ -120,7 +117,7 @@ fn markup_404(uri: String) -> impl Renderable {
fn markup_405() -> impl Renderable {
maud! {
h1 { "405" }
h1 { "404" }
p { "Method not allowed!" }
@for i in 1..3 {
div .{"m-" (i)} {}
@ -205,7 +202,7 @@ async fn main() {
let listener = tokio::net::TcpListener::bind("0.0.0.0:8000").await.unwrap();
let router: axum::Router = axum::Router::new()
.merge(TestaController::into_router(app_state.clone()))
.merge(TestController::into_router(app_state.clone()))
.merge(DistController::into_router(app_state.clone()))
.fallback_service(get(handle_404))
.method_not_allowed_fallback(handle_405)

View file

View file

View file

@ -67,19 +67,18 @@
});
})
];
config = {
allowUnfree = true;
rocmSupport = true;
};
pkgs = import nixpkgs {
inherit system overlays config;
inherit system overlays;
config = {
allowUnfree = true;
rocmSupport = true;
};
};
customNodeModules = pkgs.npmlock2nix.v2.node_modules {
src = ./.;
nodejs = pkgs.nodejs_22;
};
buildInputs = with pkgs; [
aider-chat
harfbuzz
openssl
pango
@ -108,46 +107,44 @@
"gfx1102"
"gfx1103"
];
lib = pkgs.lib;
in
{
apps.devshell = self.outputs.devShells.${system}.default.flakeApp;
packages =
(import ./.nix { inherit pkgs lib config; })
// {
myllamacpp = with pkgs;
llamaPackages.llama-cpp.overrideDerivation (oldAttrs: {
# speeds up builts by only building for a needed rocmTargets...
cmakeFlags = [
(lib.cmakeBool "LLAMA_BUILD_SERVER" true)
(lib.cmakeBool "BUILD_SHARED_LIBS" true)
(lib.cmakeBool "CMAKE_SKIP_BUILD_RPATH" true)
(lib.cmakeBool "LLAMA_CURL" true)
(lib.cmakeBool "GGML_NATIVE" true)
(lib.cmakeBool "GGML_BLAS" false)
(lib.cmakeBool "GGML_CUDA" false)
(lib.cmakeBool "GGML_HIP" true) # new one ? kinda undocumented ?
(lib.cmakeBool "GGML_HIPBLAS" true) # seems to be depr
(lib.cmakeBool "GGML_METAL" false)
(lib.cmakeBool "GGML_VULKAN" false)
(lib.cmakeBool "GGML_STATIC" false)
(lib.cmakeBool "GGML_FMA" true)
(lib.cmakeBool "GGML_F16C" true)
(lib.cmakeBool "GGML_AVX2" true)
(lib.cmakeBool "GGML_AVX512" false)
(lib.cmakeFeature "CMAKE_HIP_COMPILER" "${rocmPackages.llvm.clang}/bin/clang")
(lib.cmakeFeature "CMAKE_HIP_ARCHITECTURES" (builtins.concatStringsSep ";" rocmTargets))
(lib.cmakeFeature "AMDGPU_TARGETS" (builtins.concatStringsSep ";" rocmTargets))
];
});
};
packages = {
cargo-leptos = pkgs.callPackage ./.nix/cargo-leptos.nix { };
# llama-cpp = pkgs.callPackage "${llama-cpp}/.devops/nix/scope.nix" { };
myllamacpp = with pkgs;
llamaPackages.llama-cpp.overrideDerivation (oldAttrs: {
# speeds up builts by only building for a needed rocmTargets...
cmakeFlags = [
(lib.cmakeBool "LLAMA_BUILD_SERVER" true)
(lib.cmakeBool "BUILD_SHARED_LIBS" true)
(lib.cmakeBool "CMAKE_SKIP_BUILD_RPATH" true)
(lib.cmakeBool "LLAMA_CURL" true)
(lib.cmakeBool "GGML_NATIVE" true)
(lib.cmakeBool "GGML_BLAS" false)
(lib.cmakeBool "GGML_CUDA" false)
(lib.cmakeBool "GGML_HIP" true) # new one ? kinda undocumented ?
(lib.cmakeBool "GGML_HIPBLAS" true) # seems to be depr
(lib.cmakeBool "GGML_METAL" false)
(lib.cmakeBool "GGML_VULKAN" false)
(lib.cmakeBool "GGML_STATIC" false)
(lib.cmakeBool "GGML_FMA" true)
(lib.cmakeBool "GGML_F16C" true)
(lib.cmakeBool "GGML_AVX2" true)
(lib.cmakeBool "GGML_AVX512" false)
(lib.cmakeFeature "CMAKE_HIP_COMPILER" "${rocmPackages.llvm.clang}/bin/clang")
(lib.cmakeFeature "CMAKE_HIP_ARCHITECTURES" (builtins.concatStringsSep ";" rocmTargets))
(lib.cmakeFeature "AMDGPU_TARGETS" (builtins.concatStringsSep ";" rocmTargets))
];
});
};
devShells.default = pkgs.mkShell {
packages = with pkgs;
[
customNodeModules
customRustToolchain
self.packages.${system}.myllamacpp
aider-chat
bacon
binaryen
cacert