summary refs log tree commit diff
path: root/modules/common.nix
blob: fcd676a6d6b3004e6204874dac777a053669b6ef (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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
{
  me,
  pkgs,
  ...
}:

{
  imports = [
    ./packages.nix
    ./nix.nix
    ./user.nix
    ./locale.nix
    ./vim.nix
    ./tmux.nix
    ./nix-ld.nix
    ./oom.nix
  ];

  services.envfs.enable = true;

  virtualisation = {
    libvirtd.enable = true;
    docker.enable = true;
  };

  # fish enables this by default,
  # it makes every nixos rebuild very slow.
  documentation.man.generateCaches = false;
  documentation = {
    info.enable = true;
    doc.enable = true;
    dev.enable = true;
    nixos = {
      enable = true;
      includeAllModules = true;
    };
  };

  networking.hostName = me.name;
  # use corsac dns server
  networking.nameservers =
    let
      corsacTailnet = "100.64.100.100";
    in
    [ corsacTailnet ];

  services.resolved.enable = true;

  services = {
    acpid.enable = true;
    sysprof.enable = true;
    tailscale = {
      enable = true;
      useRoutingFeatures = "both";
      extraUpFlags = [ "--ssh" ];
    };

    # sometimes needed for gnupg
    pcscd.enable = true;

    # dbus-broker implements the dbus implementation with better performance
    dbus.implementation = "broker";
  };

  programs = {
    fish.enable = true;
    git.enable = true;

    gnupg.agent = {
      enable = true;
      enableSSHSupport = true;
    };
  };

  environment.etc.openvpn.source = "${pkgs.update-resolv-conf}/libexec/openvpn";
}