1
0
mirror of https://github.com/nix-community/home-manager synced 2024-07-03 03:48:31 +02:00
home-manager/tests/modules/programs/gh/warnings.nix
Harsh Shandilya d1d950841d gh: include version in settings
Also add an activation script block for allowing gh version 2.40.0 and
later to perform account migration.
2023-12-27 11:42:06 +05:30

37 lines
955 B
Nix

{ config, options, lib, pkgs, ... }:
{
config = {
programs.gh = {
enable = true;
aliases = { co = "pr checkout"; };
editor = "vim";
};
test.stubs.gh = { };
test.asserts.warnings.expected = [
"The option `programs.gh.editor' defined in ${
lib.showFiles options.programs.gh.editor.files
} has been renamed to `programs.gh.settings.editor'."
"The option `programs.gh.aliases' defined in ${
lib.showFiles options.programs.gh.aliases.files
} has been renamed to `programs.gh.settings.aliases'."
];
test.asserts.warnings.enable = true;
nmt.script = ''
assertFileExists home-files/.config/gh/config.yml
assertFileContent home-files/.config/gh/config.yml ${
builtins.toFile "config-file.yml" ''
aliases:
co: pr checkout
editor: vim
git_protocol: https
version: '1'
''
}
'';
};
}