1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-11-08 19:46:05 +01:00
home-manager/tests/modules/programs/ssh/renamed-options.nix
2025-08-26 17:12:13 -05:00

46 lines
1.1 KiB
Nix

{ lib, options, ... }:
{
programs.ssh = {
enable = true;
enableDefaultConfig = false;
forwardAgent = true;
addKeysToAgent = "yes";
compression = true;
serverAliveInterval = 1;
serverAliveCountMax = 2;
hashKnownHosts = true;
userKnownHostsFile = "~/.ssh/my_known_hosts";
controlMaster = "yes";
controlPath = "~/.ssh/myfile-%r@%n:%p";
controlPersist = "10m";
};
test.asserts.warnings.expected =
let
renamedOptions = [
"controlPersist"
"controlPath"
"controlMaster"
"userKnownHostsFile"
"hashKnownHosts"
"serverAliveCountMax"
"serverAliveInterval"
"compression"
"addKeysToAgent"
"forwardAgent"
];
in
map (
o:
"The option `programs.ssh.${o}' defined in ${
lib.showFiles options.programs.ssh.${o}.files
} has been renamed to `programs.ssh.matchBlocks.*.${o}'."
) renamedOptions;
nmt.script = ''
assertFileExists home-files/.ssh/config
assertFileContent home-files/.ssh/config \
${./renamed-options-expected.conf}
'';
}