summary refs log tree commit diff
path: root/snippets/nix-mode/pythonpackage
blob: 5ba74b0f9c39b1fb712be2bf60ac7a0cb9e74221 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# -*- mode: snippet -*-
# name: pythonpackage
# key: pythonpackage
# --
{ lib, python3 }:

python3.pkgs.buildPythonApplication rec {
  pname = "$1";
  src = ./$1.py;
  version = "0.1.0";
  format = "other";

  buildInputs = [ python3 ];
  propagatedBuildInputs = with python3.pkgs; [
    $2
  ];

  dontUnpack = true;
  dontBuild = true;

  installPhase = ''
    mkdir -p $out/bin
    cp $src $out/bin/\${pname}
  '';

  meta = with lib; {
    description = "$3.";
    license = with licenses; [ mit ];
    platforms = platforms.unix;
    maintainers = with maintainers; [ fcuny ];
  };
}