Created
June 18, 2024 04:31
-
-
Save rgoulter/b3b59ac72bcdb187182f43ba946fffb6 to your computer and use it in GitHub Desktop.
This file contains 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
{ pkgs ? import <nixpkgs> {} }: | |
pkgs.python311.pkgs.callPackage ./hello.nix {} |
This file contains 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
{ | |
"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 | |
} |
This file contains 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
{ | |
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"; | |
}; | |
}; | |
} |
This file contains 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
{ buildPythonApplication | |
}: | |
buildPythonApplication { | |
pname = "hello"; | |
version = "1.0.0"; | |
src = ./.; | |
pythonImportsCheck = ["hello"]; | |
doCheck = false; | |
} |
This file contains 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
def hello(): | |
print('Hello, world!') | |
if __name__ == '__main__': | |
hello() |
This file contains 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
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