poetry: add module

This commit is contained in:
Mirko Lenz 2024-02-24 17:39:35 +01:00 committed by Robert Helgesson
parent 2846d5230a
commit 670d9ecc3e
No known key found for this signature in database
GPG key ID: 96E745BD17AA17ED
7 changed files with 113 additions and 0 deletions

View file

@ -0,0 +1,27 @@
{ pkgs, ... }:
{
programs.poetry = {
enable = true;
settings = {
virtualenvs.create = true;
virtualenvs.in-project = true;
};
};
test.stubs.poetry = { };
nmt.script = let
expectedConfDir =
if pkgs.stdenv.isDarwin then "Library/Application Support" else ".config";
expectedConfigPath = "home-files/${expectedConfDir}/pypoetry/config.toml";
expectedConfigContent = pkgs.writeText "poetry.config-custom.expected" ''
[virtualenvs]
create = true
in-project = true
'';
in ''
assertFileExists "${expectedConfigPath}"
assertFileContent "${expectedConfigPath}" "${expectedConfigContent}"
'';
}

View file

@ -0,0 +1,15 @@
{ pkgs, ... }:
{
programs.poetry = { enable = true; };
test.stubs.poetry = { };
nmt.script = let
expectedConfDir =
if pkgs.stdenv.isDarwin then "Library/Application Support" else ".config";
expectedConfigPath = "home-files/${expectedConfDir}/pypoetry/config.toml";
in ''
assertPathNotExists "${expectedConfigPath}"
'';
}

View file

@ -0,0 +1,4 @@
{
poetry-default-settings = ./default-settings.nix;
poetry-custom-settings = ./custom-settings.nix;
}