Last active
July 1, 2022 07:09
-
-
Save rgoulter/35daa2c1152ac0b4381fd38c4ddb4069 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
{ | |
"nodes": { | |
"nixpkgs": { | |
"locked": { | |
"lastModified": 1655624069, | |
"narHash": "sha256-7g1zwTdp35GMTERnSzZMWJ7PG3QdDE8VOX3WsnOkAtM=", | |
"owner": "nixos", | |
"repo": "nixpkgs", | |
"rev": "0d68d7c857fe301d49cdcd56130e0beea4ecd5aa", | |
"type": "github" | |
}, | |
"original": { | |
"owner": "nixos", | |
"ref": "nixos-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/nixos-unstable"; | |
}; | |
outputs = { self, nixpkgs }: | |
let | |
system = "x86_64-linux"; | |
pkgs = nixpkgs.legacyPackages.${system}; | |
python = pkgs.python3.withPackages (ps: with ps; [ selenium ]); | |
simplenet = ps: ps.callPackage ./simplenet.nix { }; | |
pythonWithSimplenet = pkgs.python3.withPackages (ps: [ (simplenet ps) ]); | |
in | |
{ | |
packages.${system} = { | |
output1 = pkgs.writeScriptBin "myscript" '' | |
echo foo | |
''; | |
output2 = pkgs.writeScriptBin "myscript" ./myscript.sh; | |
output3 = pkgs.writeScriptBin "myscript" '' | |
export PATH=${pkgs.lib.makeBinPath [ pkgs.hello ]}:$PATH | |
${./run-hello.sh} | |
''; | |
output4 = | |
let | |
tmpPyScript = pkgs.writeTextFile { | |
name = "tmp-py-script"; | |
text = '' | |
print("foo from python") | |
''; | |
}; | |
in | |
pkgs.writeScriptBin "run-python" '' | |
${python}/bin/python ${tmpPyScript} | |
''; | |
runner = pkgs.writeShellApplication | |
{ | |
name = "runme"; | |
checkPhase = ":"; | |
runtimeInputs = [pythonWithSimplenet]; | |
text = '' | |
"${pythonWithSimplenet}/bin/python" ${./foo.py} | |
''; | |
}; | |
}; | |
}; | |
} |
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
# foo.py | |
import sys | |
import simplenet | |
print(sys.executable) | |
print(simplenet.__version__) |
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
#!/usr/bin/env bash | |
echo foo2 |
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
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
{ lib | |
, buildPythonPackage | |
, fetchPypi | |
, numpy | |
, build | |
}: | |
buildPythonPackage rec { | |
pname = "simplenet"; | |
version = "0.1.4"; | |
src = fetchPypi { | |
inherit pname version; | |
sha256 = "sha256-lW5LXjDO6CxvoGzvDr8jmQhg7DG5XLbTYi0mifuofwk="; | |
}; | |
propagatedBuildInputs = [ | |
numpy | |
]; | |
patches = [ | |
./simplenet.patch | |
]; | |
buildPhase = '' | |
${build}/bin/pyproject-build --no-isolation | |
''; | |
doCheck = false; | |
meta = with lib; { | |
homepage = "https://github.com/n8henrie/simplenet"; | |
description = "A simple neural network in Python "; | |
license = licenses.mit; | |
maintainers = [ ]; | |
}; | |
} |
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
--- a/setup.cfg 2022-07-01 13:59:18.009491094 +0700 | |
+++ b/setup.cfg 2022-07-01 13:59:31.423435045 +0700 | |
@@ -24,3 +24,3 @@ include_package_data = True | |
install_requires = | |
- numpy==1.22.4 | |
+ numpy~=1.21.6 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment