Expose pythonEnv from flake
This commit is contained in:
parent
e72f9aa349
commit
c903947f00
|
@ -159,6 +159,8 @@ cython_debug/
|
||||||
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
||||||
#.idea/
|
#.idea/
|
||||||
|
|
||||||
|
venv
|
||||||
|
|
||||||
# nixos-shell
|
# nixos-shell
|
||||||
nixos.qcow2
|
nixos.qcow2
|
||||||
|
|
||||||
|
|
3
Makefile
3
Makefile
|
@ -3,6 +3,9 @@
|
||||||
help: ## display this help
|
help: ## display this help
|
||||||
@awk 'BEGIN{FS = ":.*##"; printf "\033[1m\nUsage\n \033[1;92m make\033[0;36m <target>\033[0m\n"} /^[a-zA-Z0-9_-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } ' $(MAKEFILE_LIST)
|
@awk 'BEGIN{FS = ":.*##"; printf "\033[1m\nUsage\n \033[1;92m make\033[0;36m <target>\033[0m\n"} /^[a-zA-Z0-9_-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } ' $(MAKEFILE_LIST)
|
||||||
|
|
||||||
|
venv: ## link the python dev environment to ./venv
|
||||||
|
nix build .#pythonEnv -o venv
|
||||||
|
|
||||||
lint: ## run linters
|
lint: ## run linters
|
||||||
nix fmt
|
nix fmt
|
||||||
black **/*.py
|
black **/*.py
|
||||||
|
|
22
flake.nix
22
flake.nix
|
@ -23,6 +23,14 @@
|
||||||
let
|
let
|
||||||
inherit (nixpkgs.lib) makeOverridable nixosSystem;
|
inherit (nixpkgs.lib) makeOverridable nixosSystem;
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
|
pkgs = nixpkgs.legacyPackages.${system};
|
||||||
|
pythonEnv = pkgs.python3.withPackages (
|
||||||
|
pypkgs: with pypkgs; [
|
||||||
|
flask
|
||||||
|
black
|
||||||
|
pytest
|
||||||
|
]
|
||||||
|
);
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
formatter.${system} = nixpkgs.legacyPackages.${system}.nixfmt-rfc-style;
|
formatter.${system} = nixpkgs.legacyPackages.${system}.nixfmt-rfc-style;
|
||||||
|
@ -39,21 +47,11 @@
|
||||||
{
|
{
|
||||||
default = self.packages.${system}.intake;
|
default = self.packages.${system}.intake;
|
||||||
inherit (pkgs) intake;
|
inherit (pkgs) intake;
|
||||||
|
inherit pythonEnv;
|
||||||
};
|
};
|
||||||
|
|
||||||
devShells.${system} = {
|
devShells.${system} = {
|
||||||
default =
|
default = pkgs.mkShell {
|
||||||
let
|
|
||||||
pkgs = nixpkgs.legacyPackages.${system};
|
|
||||||
pythonEnv = pkgs.python3.withPackages (
|
|
||||||
pypkgs: with pypkgs; [
|
|
||||||
flask
|
|
||||||
black
|
|
||||||
pytest
|
|
||||||
]
|
|
||||||
);
|
|
||||||
in
|
|
||||||
pkgs.mkShell {
|
|
||||||
packages = [
|
packages = [
|
||||||
pythonEnv
|
pythonEnv
|
||||||
pkgs.gnumake
|
pkgs.gnumake
|
||||||
|
|
Loading…
Reference in New Issue