tvl-depot/advent-of-code/writePythonBin.nix
William Carroll 456d358cd7 Upload my 2019 Advent of Code attempts
Well, unexpectedly (perhaps naively so), I only made it to Day 7. I created
these before I stumbled upon the idea of the mono-repository; otherwise, I like
to think I would have more granular commits introducing this work.
2020-01-15 14:21:45 +00:00

18 lines
303 B
Nix

{ 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}
'';
}