aboutsummaryrefslogtreecommitdiff
path: root/infra/libkookie/home-manager/tests/modules/programs/gh/config-file.nix
blob: 0c0186942052d7f8e32a5fd5ed71f10e761b2f7a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
{ config, lib, pkgs, ... }:

{
  config = {
    programs.gh = {
      enable = true;
      aliases = { co = "pr checkout"; };
      editor = "vim";
    };

    nixpkgs.overlays = [
      (self: super: {
        gitAndTools = super.gitAndTools // {
          gh = pkgs.writeScriptBin "dummy-gh" "";
        };
      })
    ];

    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","gitProtocol":"https"}''
      }
    '';
  };
}