summaryrefslogtreecommitdiff
path: root/system/default.nix
blob: 36d11ee2f3d3cfd76a83be9a644f14c9da5d7b8e (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
{
  config,
  pkgs,
  self,
  ...
}: {
  imports = [
    ./battery.nix
    ./bluetooth.nix
    ./desktop.nix
    ./hardware.nix
    ./networking.nix
    ./sshd.nix
  ];

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

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

  # hostname
  networking.hostName = config.hostName;

  # common system packages
  environment.systemPackages = with pkgs; [
    # editor
    vim
    # lib
    libz
    openssl
    shared-mime-info
    # shell
    bash
    zsh
    # utility
    curl
    dig
    file
    fd
    htop
    jq
    killall
    openssh
    p7zip
    ripgrep
    rsync
    sbctl
    sl
    tree
    unzip
    wget
  ];

  # use the latest kernel
  boot.kernelPackages = pkgs.linuxPackages_latest;

  # sysrq
  boot.kernel.sysctl."kernel.sysrq" = 246;

  # timezone
  time.timeZone = config.timeZone;

  # docs
  documentation = {
    info.enable = false;
    dev.enable = false;
    nixos.enable = false;
  };

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

  # create user account
  users.users.${config.user} = {
    isNormalUser = true;
    description = config.fullName;
    extraGroups = ["wheel" "sys" "video" "audio"];
    home = config.homePath;
    shell = pkgs.zsh;
  };

  # certs
  security.pki.certificateFiles = self.lib.certs;
}