Skip to content

Commit

Permalink
Use shell as package
Browse files Browse the repository at this point in the history
  • Loading branch information
artfuldev committed Sep 6, 2024
1 parent 503e23b commit c4e93a1
Showing 1 changed file with 7 additions and 17 deletions.
24 changes: 7 additions & 17 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,32 +11,22 @@
outputs = { self, nixpkgs, flake-utils, poetry2nix }:
flake-utils.lib.eachDefaultSystem (system:
let
nativeBuildInputs = with pkgs; [ stdenv python3 poetry tesseract nodejs_22 ];
buildInputs = with pkgs; [ ollama bun ];
nativeBuildInputs = with pkgs; [ stdenv python3 python312Packages.setuptools poetry tesseract nodejs_22 ];
buildInputs = with pkgs; [ ollama bun hello ];

# see https://github.com/nix-community/poetry2nix/tree/master#api for more functions and examples.
pkgs = nixpkgs.legacyPackages.${system};
inherit (poetry2nix.lib.mkPoetry2Nix { inherit pkgs; })
mkPoetryApplication;
in {
inherit nativeBuildInputs buildInputs;

packages = {
myapp = mkPoetryApplication {
projectDir = self;
python = pkgs.python3;
};
default = self.packages.${system}.myapp;
};

devShells = {
default = pkgs.mkShell {
mkPoetryApplication defaultPoetryOverrides;
default = pkgs.mkShell {
packages = nativeBuildInputs ++ buildInputs;
LD_LIBRARY_PATH = if pkgs.stdenv.isLinux then
"${pkgs.stdenv.cc.cc.lib}/lib:/run/opengl-driver/lib:/run/opengl-driver-32/lib"
else
"$LD_LIBRARY_PATH";
};
};
in {
devShells.default = default;
packages.default = default;
});
}

0 comments on commit c4e93a1

Please sign in to comment.