summaryrefslogtreecommitdiff
path: root/common/core.nix
blob: c06069aa90e406d4a4d4d931176a48038b5a15a1 (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
# Boot, networking, locale, and Nix settings shared by all machines.
{ pkgs, ... }:

{
  # Editor available on every machine (even a headless one).
  environment.systemPackages = [ pkgs.neovim ];
  programs.neovim = {
    enable = true;
    defaultEditor = true;
  };

  # Bootloader.
  boot.loader.systemd-boot.enable = true;
  boot.loader.efi.canTouchEfiVariables = true;

  # Enable networking
  networking.networkmanager.enable = true;

  # for tailscale; open only its discovery/connection UDP port and let the
  # normal host firewall rules apply to tailnet traffic too.
  networking.firewall.allowPing = true;
  networking.firewall.allowedUDPPorts = [ 41641 ];
  services.tailscale.enable = true;

  # Set your time zone.
  time.timeZone = "America/Chicago";

  # Select internationalisation properties.
  i18n.defaultLocale = "en_US.UTF-8";

  i18n.extraLocaleSettings = {
    LC_ADDRESS = "en_US.UTF-8";
    LC_IDENTIFICATION = "en_US.UTF-8";
    LC_MEASUREMENT = "en_US.UTF-8";
    LC_MONETARY = "en_US.UTF-8";
    LC_NAME = "en_US.UTF-8";
    LC_NUMERIC = "en_US.UTF-8";
    LC_PAPER = "en_US.UTF-8";
    LC_TELEPHONE = "en_US.UTF-8";
    LC_TIME = "en_US.UTF-8";
  };

  # trusted-users is set per-machine (see machines/<host>/default.nix).

  nix.settings.experimental-features = [
    "nix-command"
    "flakes"
  ];

  # Allow unfree packages
  nixpkgs.config.allowUnfree = true;

  environment.localBinInPath = true;
}