Files
home-manager/tests/modules/programs/cargo/cargo-home.nix
2026-04-13 22:02:40 -05:00

32 lines
573 B
Nix

{
config,
...
}:
{
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}
'';
}