cargo: add module
This commit is contained in:
parent
c220f242cd
commit
86ff0ef506
6 changed files with 94 additions and 0 deletions
4
tests/modules/programs/cargo/default.nix
Normal file
4
tests/modules/programs/cargo/default.nix
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
cargo = ./example-config.nix;
|
||||
cargo-empty-config = ./empty-config.nix;
|
||||
}
|
||||
14
tests/modules/programs/cargo/empty-config.nix
Normal file
14
tests/modules/programs/cargo/empty-config.nix
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
programs.docker-cli = {
|
||||
settings = {
|
||||
net = {
|
||||
git-fetch-with-cli = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertPathNotExists home-files/.cargo/config
|
||||
assertPathNotExists home-files/.cargo/config.toml
|
||||
'';
|
||||
}
|
||||
22
tests/modules/programs/cargo/example-config.nix
Normal file
22
tests/modules/programs/cargo/example-config.nix
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
programs.cargo = {
|
||||
enable = true;
|
||||
|
||||
settings = {
|
||||
net = {
|
||||
git-fetch-with-cli = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
nmt.script =
|
||||
let
|
||||
configTestPath = "home-files/.cargo/config.toml";
|
||||
in
|
||||
''
|
||||
assertPathNotExists home-files/.cargo/config
|
||||
assertFileExists ${configTestPath}
|
||||
assertFileContent ${configTestPath} \
|
||||
${./example-config.toml}
|
||||
'';
|
||||
}
|
||||
2
tests/modules/programs/cargo/example-config.toml
Normal file
2
tests/modules/programs/cargo/example-config.toml
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
[net]
|
||||
git-fetch-with-cli = true
|
||||
Loading…
Add table
Add a link
Reference in a new issue