|
@@ -4,10 +4,12 @@
|
|
|
nixpkgs.url = github:nixos/nixpkgs/nixos-unstable;
|
|
|
flake-utils.url = github:numtide/flake-utils;
|
|
|
};
|
|
|
+
|
|
|
outputs = { self, nixpkgs, flake-utils }:
|
|
|
flake-utils.lib.eachDefaultSystem (system:
|
|
|
let
|
|
|
pkgs = nixpkgs.legacyPackages.${system};
|
|
|
+ python = pkgs.python3.withPackages (ps: with ps; []);
|
|
|
arklog = pkgs.python3Packages.buildPythonPackage rec {
|
|
|
pname = "arklog";
|
|
|
version = "0.5.1";
|
|
@@ -28,9 +30,9 @@
|
|
|
description = "Custom python logging formatter with color output.";
|
|
|
};
|
|
|
};
|
|
|
- in rec {
|
|
|
+ in {
|
|
|
packages = rec {
|
|
|
- spendpoint = pkgs.python3Packages.buildPythonPackage rec {
|
|
|
+ spendpoint = pkgs.python3Packages.buildPythonApplication {
|
|
|
pname = "spendpoint";
|
|
|
version = "0.4.0";
|
|
|
format = "pyproject";
|
|
@@ -51,25 +53,47 @@
|
|
|
python-magic
|
|
|
uvicorn
|
|
|
];
|
|
|
- checkInputs = with pkgs.python3Packages; [
|
|
|
- pytest
|
|
|
- sparqlwrapper
|
|
|
- ];
|
|
|
- buildInputs = with pkgs.python3Packages; [
|
|
|
- sphinx
|
|
|
- tox
|
|
|
- pip
|
|
|
- flit
|
|
|
- twine
|
|
|
- numpy
|
|
|
- invoke
|
|
|
- jinja2
|
|
|
- flake8
|
|
|
- coverage
|
|
|
- ];
|
|
|
+# checkInputs = with pkgs.python3Packages; [
|
|
|
+# pytest
|
|
|
+# sparqlwrapper
|
|
|
+# ];
|
|
|
+# buildInputs = with pkgs.python3Packages; [
|
|
|
+# sphinx
|
|
|
+# tox
|
|
|
+# pip
|
|
|
+# flit
|
|
|
+# twine
|
|
|
+# numpy
|
|
|
+# invoke
|
|
|
+# jinja2
|
|
|
+# flake8
|
|
|
+# coverage
|
|
|
+# ];
|
|
|
+ };
|
|
|
+
|
|
|
+ # https://discourse.nixos.org/t/basic-flake-run-existing-python-bash-script/19886/2
|
|
|
+ server = pkgs.writeScriptBin "run-python" ''
|
|
|
+ ${python}/bin/python -m spendpoint
|
|
|
+ '';
|
|
|
+
|
|
|
+ launchScript = pkgs.writeTextFile {
|
|
|
+ name = "run.sh";
|
|
|
+ text = ''${python}/bin/python -m spendpoint'';
|
|
|
+ executable = true;
|
|
|
+ };
|
|
|
+
|
|
|
+ default = spendpoint;
|
|
|
+ };
|
|
|
+
|
|
|
+ apps = rec {
|
|
|
+ # App that starts when invoking `nix run .#spendpoint`
|
|
|
+ spendpoint = {
|
|
|
+ type = "app";
|
|
|
+ program = "${self.packages.${system}.launchScript}";
|
|
|
};
|
|
|
+ # App that starts when invoking `nix run .`
|
|
|
+ default=spendpoint;
|
|
|
};
|
|
|
- defaultPackage = packages.spendpoint;
|
|
|
});
|
|
|
nixConfig.bash-prompt-prefix = "\\e\[94;1m[spendpoint]\\e\[m ";
|
|
|
}
|