summaryrefslogtreecommitdiff
path: root/machines/lib/base.nix
blob: 3805aa4095a53a4d6928188017060b4e0f10ad70 (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
{ config, lib, pkgs, ... }:

let
  nixpkgs = builtins.fetchTarball (import ../../nixpkgs.nix);
in {
  console.font = "${pkgs.fira-code}/share/fonts/truetype/FiraCode-VF.ttf";

  environment.systemPackages = with pkgs; [
    yubioath-flutter
    yubico-pam
    yubikey-manager
    yubikey-personalization
  ];


  fonts.fonts = with pkgs; [
    google-fonts mononoki source-code-pro fantasque-sans-mono hack-font
    fira fira-code fira-code-symbols
  ];

  location.latitude = 40.80;
  location.longitude = -81.52;

  programs.bash.enableCompletion = true;
  programs.command-not-found.enable = true;
  programs.light.enable = true;
  programs.gnupg.agent.enable = true;
  programs.gnupg.agent.enableSSHSupport = true;
  programs.mosh.enable = true;
  programs.ssh.agentTimeout = "1h";

  security.pam.yubico.control = "sufficient";  # use yubikey in lieu of password
  security.pam.yubico.debug = false;
  security.pam.yubico.enable = true;
  security.pam.yubico.mode = "challenge-response";
  security.sudo.wheelNeedsPassword = true;

  services.pcscd.enable = true;

  services.logind.lidSwitch = "suspend";
  services.logind.lidSwitchDocked = "lock";
  services.logind.lidSwitchExternalPower = "lock";

  services.clight.enable = true;
  services.clight.temperature.day = 6500;
  services.clight.temperature.night = 1800;

  services.printing.enable = true;

  services.xserver.xkbOptions = "caps:ctrl_modifier";

  services.vnstat.enable = true;

  services.fail2ban.enable = true;
  services.clamav.daemon.enable = false;
  services.clamav.updater.enable = false;

  nix.nixPath = [
    "nixpkgs=${nixpkgs}"
    "nixos-config=/etc/nixos/configuration.nix"
    "/nix/var/nix/profiles/per-user/root/channels"
  ];
  nix.gc.automatic = false;
  nix.gc.dates = "03:15";
  nix.extraOptions = ''
    builders-use-substitutes = true
  '';

  nixpkgs.config.allowUnfree = true;
  nixpkgs.config.allowBroken = true;

  time.timeZone = "America/New_York";
}