cargo: add cargoHome option
This commit is contained in:
parent
b92cad188c
commit
38539206d0
3 changed files with 58 additions and 8 deletions
33
tests/modules/programs/cargo/cargo-home.nix
Normal file
33
tests/modules/programs/cargo/cargo-home.nix
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
programs.cargo = {
|
||||
enable = true;
|
||||
|
||||
cargoHome = "${config.xdg.dataHome}/cargo";
|
||||
|
||||
settings = {
|
||||
net = {
|
||||
git-fetch-with-cli = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
nmt.script =
|
||||
let
|
||||
cargoTestPath = "home-files/.local/share/cargo";
|
||||
configTestPath = "${cargoTestPath}/config.toml";
|
||||
in
|
||||
''
|
||||
assertPathNotExists home-files/.cargo/config
|
||||
assertDirectoryExists ${cargoTestPath}
|
||||
assertFileExists ${configTestPath}
|
||||
assertFileContent ${configTestPath} \
|
||||
${./example-config.toml}
|
||||
'';
|
||||
}
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
{
|
||||
cargo = ./example-config.nix;
|
||||
cargo-empty-config = ./empty-config.nix;
|
||||
cargo-home = ./cargo-home.nix;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue