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.
|
||||
#.idea/
|
||||
|
||||
venv
|
||||
|
||||
# nixos-shell
|
||||
nixos.qcow2
|
||||
|
||||
|
|
3
Makefile
3
Makefile
|
@ -3,6 +3,9 @@
|
|||
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)
|
||||
|
||||
venv: ## link the python dev environment to ./venv
|
||||
nix build .#pythonEnv -o venv
|
||||
|
||||
lint: ## run linters
|
||||
nix fmt
|
||||
black **/*.py
|
||||
|
|
44
flake.nix
44
flake.nix
|
@ -23,6 +23,14 @@
|
|||
let
|
||||
inherit (nixpkgs.lib) makeOverridable nixosSystem;
|
||||
system = "x86_64-linux";
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
pythonEnv = pkgs.python3.withPackages (
|
||||
pypkgs: with pypkgs; [
|
||||
flask
|
||||
black
|
||||
pytest
|
||||
]
|
||||
);
|
||||
in
|
||||
{
|
||||
formatter.${system} = nixpkgs.legacyPackages.${system}.nixfmt-rfc-style;
|
||||
|
@ -39,32 +47,22 @@
|
|||
{
|
||||
default = self.packages.${system}.intake;
|
||||
inherit (pkgs) intake;
|
||||
inherit pythonEnv;
|
||||
};
|
||||
|
||||
devShells.${system} = {
|
||||
default =
|
||||
let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
pythonEnv = pkgs.python3.withPackages (
|
||||
pypkgs: with pypkgs; [
|
||||
flask
|
||||
black
|
||||
pytest
|
||||
]
|
||||
);
|
||||
in
|
||||
pkgs.mkShell {
|
||||
packages = [
|
||||
pythonEnv
|
||||
pkgs.gnumake
|
||||
pkgs.nixos-shell
|
||||
# We only take this dependency for htpasswd, which is a little unfortunate
|
||||
pkgs.apacheHttpd
|
||||
];
|
||||
shellHook = ''
|
||||
PS1="(develop) $PS1"
|
||||
'';
|
||||
};
|
||||
default = pkgs.mkShell {
|
||||
packages = [
|
||||
pythonEnv
|
||||
pkgs.gnumake
|
||||
pkgs.nixos-shell
|
||||
# We only take this dependency for htpasswd, which is a little unfortunate
|
||||
pkgs.apacheHttpd
|
||||
];
|
||||
shellHook = ''
|
||||
PS1="(develop) $PS1"
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
overlays.default = final: prev: {
|
||||
|
|
Loading…
Reference in New Issue