mirror of
https://github.com/nix-community/home-manager.git
synced 2025-11-08 19:46:05 +01:00
uv: init module
This commit is contained in:
parent
a0461b67ff
commit
1d2d6b9568
6 changed files with 107 additions and 0 deletions
|
|
@ -466,6 +466,7 @@ import nmtSrc {
|
|||
./modules/programs/tmux
|
||||
./modules/programs/topgrade
|
||||
./modules/programs/translate-shell
|
||||
./modules/programs/uv
|
||||
./modules/programs/vifm
|
||||
./modules/programs/vim-vint
|
||||
./modules/programs/vscode
|
||||
|
|
|
|||
4
tests/modules/programs/uv/default.nix
Normal file
4
tests/modules/programs/uv/default.nix
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
uv-example-settings = ./example-settings.nix;
|
||||
uv-no-settings = ./no-settings.nix;
|
||||
}
|
||||
29
tests/modules/programs/uv/example-settings.nix
Normal file
29
tests/modules/programs/uv/example-settings.nix
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
programs.uv = {
|
||||
enable = true;
|
||||
settings = {
|
||||
python-downloads = "never";
|
||||
python-preference = "only-system";
|
||||
pip.index-url = "https://test.pypi.org/simple";
|
||||
};
|
||||
};
|
||||
|
||||
test.stubs.uv = { };
|
||||
|
||||
nmt.script =
|
||||
let
|
||||
expectedConfigPath = "home-files/.config/uv/uv.toml";
|
||||
expectedConfigContent = pkgs.writeText "uv.config-custom.expected" ''
|
||||
python-downloads = "never"
|
||||
python-preference = "only-system"
|
||||
[pip]
|
||||
index-url = "https://test.pypi.org/simple"
|
||||
'';
|
||||
in
|
||||
''
|
||||
assertFileExists "${expectedConfigPath}"
|
||||
assertFileContent "${expectedConfigPath}" "${expectedConfigContent}"
|
||||
'';
|
||||
}
|
||||
16
tests/modules/programs/uv/no-settings.nix
Normal file
16
tests/modules/programs/uv/no-settings.nix
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
{ ... }:
|
||||
{
|
||||
programs.uv = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
test.stubs.uv = { };
|
||||
|
||||
nmt.script =
|
||||
let
|
||||
expectedConfigPath = "home-files/.config/uv/uv.toml";
|
||||
in
|
||||
''
|
||||
assertPathNotExists "${expectedConfigPath}"
|
||||
'';
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue