jtftp/flake.nix

51 lines
1.2 KiB
Nix
Raw Normal View History

2022-07-07 12:37:41 -05:00
{
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
2022-07-07 17:08:14 -05:00
export PS1='\[\033[1;34m\][jtftp:\w]\$\[\033[0m\] '
2022-07-07 12:37:41 -05:00
'';
};
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";
};
};
}
);
}