fork/home-manager

git clone https://git.julia.blue/fork/home-manager

Nicolas Berbichegh: use structural settings (#2339)82c92a18

master
932 B35 linesraw
1{ config, options, lib, pkgs, ... }:
2
3{
4  config = {
5    programs.gh = {
6      enable = true;
7      aliases = { co = "pr checkout"; };
8      editor = "vim";
9    };
10
11    test.stubs.gh = { };
12
13    test.asserts.warnings.expected = [
14      "The option `programs.gh.editor' defined in ${
15        lib.showFiles options.programs.gh.editor.files
16      } has been renamed to `programs.gh.settings.editor'."
17      "The option `programs.gh.aliases' defined in ${
18        lib.showFiles options.programs.gh.aliases.files
19      } has been renamed to `programs.gh.settings.aliases'."
20    ];
21    test.asserts.warnings.enable = true;
22
23    nmt.script = ''
24      assertFileExists home-files/.config/gh/config.yml
25      assertFileContent home-files/.config/gh/config.yml ${
26        builtins.toFile "config-file.yml" ''
27          aliases:
28            co: pr checkout
29          editor: vim
30          git_protocol: https
31        ''
32      }
33    '';
34  };
35}