50 lines
1.2 KiB
Nix
50 lines
1.2 KiB
Nix
{
|
|
inputs = {
|
|
nixpkgs = {
|
|
url = "github:NixOS/nixpkgs/nixos-22.05";
|
|
};
|
|
flake-utils = {
|
|
url = "github:numtide/flake-utils";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
};
|
|
|
|
outputs = { self, nixpkgs, flake-utils, ... }@inputs:
|
|
flake-utils.lib.eachDefaultSystem (system:
|
|
let
|
|
pkgs = import nixpkgs {
|
|
inherit system;
|
|
};
|
|
in
|
|
{
|
|
devShells.default =
|
|
let
|
|
python = pkgs.python310.withPackages (ps: with ps; [
|
|
poetry
|
|
]);
|
|
in
|
|
pkgs.mkShell {
|
|
buildInputs = [
|
|
python
|
|
];
|
|
shellHook = ''
|
|
export POETRY_VIRTUALENVS_IN_PROJECT=true
|
|
export PS1='\[\033[1;34m\][jtftp:\w]\$\[\033[0m\] '
|
|
'';
|
|
};
|
|
packages = {
|
|
jtftp = pkgs.poetry2nix.mkPoetryApplication {
|
|
python = pkgs.python310;
|
|
projectDir = ./.;
|
|
};
|
|
default = self.packages.${system}.jtftp;
|
|
};
|
|
apps = {
|
|
default = {
|
|
type = "app";
|
|
program = "${self.packages.${system}.jtftp}/bin/serve";
|
|
};
|
|
};
|
|
}
|
|
);
|
|
}
|