summaryrefslogtreecommitdiff
path: root/configuration.nix
blob: 8bb2a7ce1a58d93b64d84445a00b2fb771956c4d (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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
{ lib, config, pkgs, modulesPath, ... }:
let
  kentSshKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICzXYZ0uwhhyOeHSBHSGQF+Y++qyoLEuyWnmF3/BJ5jp kent";
  ciSshKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBoe/bwC67CzRrnWzAP/qMeiVzp0RhHxFkLzM1DSxuvw ci";
in
{
  imports =
    [ (modulesPath + "/installer/scan/not-detected.nix")
    ];

  boot.initrd.availableKernelModules = [ "nvme" ];
  boot.initrd.kernelModules = [ ];
  boot.kernelModules = [ ];
  boot.extraModulePackages = [ ];

  fileSystems."/" =
    { device = "/dev/disk/by-label/root";
      fsType = "xfs";
    };

  fileSystems."/boot" =
    { device = "/dev/disk/by-label/boot";
      fsType = "vfat";
      options = [ "fmask=0077" "dmask=0077" ];
    };

  swapDevices = [ ];

  networking.useDHCP = lib.mkDefault true;
  nixpkgs.hostPlatform = lib.mkDefault "aarch64-linux";
  boot.swraid.enable = true;

  boot.loader.systemd-boot.enable = true;
  boot.loader.efi.canTouchEfiVariables = false;

  networking.hostName = "nixos";
  
  console = {
    font = "Lat2-Terminus16";
    keyMap = "dvorak";
  };

  i18n.defaultLocale = "en_US.UTF-8";

  services.openssh.enable = true;

  users.users = { 
    root = {
      openssh.authorizedKeys.keys = [ kentSshKey ];
    };

    kent = {
      isNormalUser = true;
      openssh.authorizedKeys.keys = [ kentSshKey ];
    };

    testdashboard = {
      isNormalUser = true;
      openssh.authorizedKeys.keys = [ ciSshKey ];
    };
  };

  environment.systemPackages = with pkgs; [
    pciutils
    killall
    file
    schedtool
    nix-prefetch-github
    usbutils
    lsof
    smem
    sysstat
    wget
    gnupg
    git
    htop
    moreutils

    direnv
    tmux

    irssi
    vim

    # ktest / dev
    brotli
    config.boot.kernelPackages.perf
    getopt
    flex
    bison
    gcc
    clang
    gdb
    gnumake
    bc
    pkg-config
    binutils
    (python3.withPackages (p: with p; [ ply GitPython ]))
    pahole
    qemu
    nixos-shell
    minicom
    socat
    vde2
    elfutils
    ncurses
    openssl
    zlib
    lcov
  ];
  
  nix = {
    daemonCPUSchedPolicy = "idle";
    settings = {
      auto-optimise-store = true;
      trusted-users = [ "@wheel" ];
    };
    extraOptions = ''
      experimental-features = nix-command flakes
    '';
  };

  system.stateVersion = "22.05";
}