Created
June 1, 2016 18:00
-
-
Save jpf/f27c584c7d7f7cf4d53583f70e6c3742 to your computer and use it in GitHub Desktop.
A Python script that uses Nix to automatically bootstrap dependencies.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env nix-shell | |
#! nix-shell -i python -p python27Packages.flask python27Packages.emoji | |
# | |
# This is a demo of using Nix to manage packages for a program in a language agnostic way. | |
# If you run this example as an executable, it'll Just Work, even if you don't have Flask or emoji installed. Try it out! | |
# | |
# $ curl https://nixos.org/nix/install | sh | |
# $ chmod a+x nix_and_python.py | |
# $ ./nix_and_python.py | |
from flask import Flask | |
import emoji | |
app = Flask(__name__) | |
@app.route("/") | |
def hello(): | |
return emoji.emojize('Python and Nix is :thumbs_up_sign:') | |
if __name__ == "__main__": | |
app.run() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment