From 5b5e8e01f233088c6687d34e6813f6afb651b187 Mon Sep 17 00:00:00 2001 From: Matthias Thym Date: Tue, 5 Mar 2024 08:58:00 +0100 Subject: [PATCH] Apply suggestions --- examples/python-directory/devenv.yaml | 2 -- examples/python-poetry/devenv.yaml | 2 -- src/modules/languages/python.nix | 19 +++++++++++-------- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/examples/python-directory/devenv.yaml b/examples/python-directory/devenv.yaml index 15728c9fc..a32e623e1 100644 --- a/examples/python-directory/devenv.yaml +++ b/examples/python-directory/devenv.yaml @@ -1,5 +1,3 @@ ---- - inputs: nixpkgs: url: github:NixOS/nixpkgs/nixpkgs-unstable diff --git a/examples/python-poetry/devenv.yaml b/examples/python-poetry/devenv.yaml index 15728c9fc..a32e623e1 100644 --- a/examples/python-poetry/devenv.yaml +++ b/examples/python-poetry/devenv.yaml @@ -1,5 +1,3 @@ ---- - inputs: nixpkgs: url: github:NixOS/nixpkgs/nixpkgs-unstable diff --git a/src/modules/languages/python.nix b/src/modules/languages/python.nix index ecd325a3a..857f9d3ec 100644 --- a/src/modules/languages/python.nix +++ b/src/modules/languages/python.nix @@ -118,6 +118,17 @@ in example = "3.11 or 3.11.2"; }; + directory = lib.mkOption { + type = lib.types.str; + default = config.devenv.root; + defaultText = lib.literalExpression "config.devenv.root"; + description = '' + The Python project's root directory. Defaults to the root of the devenv project. + Can be an absolute path or one relative to the root of the devenv project. + ''; + example = "./directory"; + }; + venv.enable = lib.mkEnableOption "Python virtual environment"; venv.requirements = lib.mkOption { @@ -135,14 +146,6 @@ in description = "Whether `pip install` should avoid outputting messages during devenv initialisation."; }; - directory = lib.mkOption { - type = lib.types.str; - default = config.devenv.root; - description = '' - The Python project's root directory. Defaults to the root of the devenv project. - ''; - }; - poetry = { enable = lib.mkEnableOption "poetry"; install = {