add flake and source
This commit is contained in:
27
flake.lock
generated
Normal file
27
flake.lock
generated
Normal file
@@ -0,0 +1,27 @@
|
||||
{
|
||||
"nodes": {
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1739206421,
|
||||
"narHash": "sha256-PwQASeL2cGVmrtQYlrBur0U20Xy07uSWVnFup2PHnDs=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "44534bc021b85c8d78e465021e21f33b856e2540",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nixos",
|
||||
"ref": "nixos-24.11",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
||||
36
flake.nix
Normal file
36
flake.nix
Normal file
@@ -0,0 +1,36 @@
|
||||
{
|
||||
description = "Build Project Siren";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11";
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, ... }: let
|
||||
system = "x86_64-linux";
|
||||
pkgs = import nixpkgs { inherit system; };
|
||||
in {
|
||||
|
||||
Siren = pkgs.stdenv.mkDerivation {
|
||||
|
||||
name = "Siren";
|
||||
|
||||
src = ./src;
|
||||
|
||||
buildInputs = with pkgs; [
|
||||
(python311.withPackages (ps: with ps; [
|
||||
ollama
|
||||
]))
|
||||
];
|
||||
|
||||
buildPhase = ''
|
||||
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/bin
|
||||
'';
|
||||
};
|
||||
|
||||
packages.${system}.default = self.Siren;
|
||||
};
|
||||
}
|
||||
9
src/siren.py
Normal file
9
src/siren.py
Normal file
@@ -0,0 +1,9 @@
|
||||
import ollama
|
||||
|
||||
c = ollama.Client(
|
||||
host='https://ollama.blunkall.us'
|
||||
)
|
||||
|
||||
r = c.generate(model='llama3.2', prompt='say hello')['response']
|
||||
|
||||
print(r)
|
||||
Reference in New Issue
Block a user