about summary refs log blame commit diff
path: root/advent-of-code/writePythonBin.nix
blob: 1730edb2ebe4ec364b5b5389026137620db6d8fd (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

















                                              
{ pkgs ? import <nixpkgs> {}, ... }:

{ name, deps, src }:

let
  inherit (pkgs) pythonPackages writeTextFile;
  inherit (builtins) toFile;

in writeTextFile {
  inherit name;
  executable = true;
  destination = "/bin/${name}";

  text = ''
    #!/bin/sh
    ${pkgs.python3}/bin/python3 ${src}
  '';
}