Skip to content

Instantly share code, notes, and snippets.

@rgoulter
Created June 18, 2024 04:31
Show Gist options
  • Save rgoulter/b3b59ac72bcdb187182f43ba946fffb6 to your computer and use it in GitHub Desktop.
Save rgoulter/b3b59ac72bcdb187182f43ba946fffb6 to your computer and use it in GitHub Desktop.
{ pkgs ? import <nixpkgs> {} }:
pkgs.python311.pkgs.callPackage ./hello.nix {}
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1718428119,
"narHash": "sha256-WdWDpNaq6u1IPtxtYHHWpl5BmabtpmLnMAx0RdJ/vo8=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "e6cea36f83499eb4e9cd184c8a8e823296b50ad5",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
};
outputs = {self, nixpkgs, ...}: {
packages.x86_64-linux = let
pkgs = nixpkgs.legacyPackages.x86_64-linux;
in {
default = pkgs.python311.pkgs.callPackage ./hello.nix {};
};
apps.x86_64-linux.default = {
type = "app";
program = "${self.packages.x86_64-linux.default}/bin/hello-bin";
};
};
}
{ buildPythonApplication
}:
buildPythonApplication {
pname = "hello";
version = "1.0.0";
src = ./.;
pythonImportsCheck = ["hello"];
doCheck = false;
}
def hello():
print('Hello, world!')
if __name__ == '__main__':
hello()
from setuptools import setup
setup(
name="hello",
version="1.0.0",
py_modules=["hello"],
entry_points={
'console_scripts': [
'hello-bin = hello:hello',
]
}
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment