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

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

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

  # set state version
  system.stateVersion = config.stateVersion;

  # enable nixos-rebuild-ng
  system.rebuild.enableNg = 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_testing;

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

  # timezone
  time.timeZone = config.timeZone;

  # dbus
  services.dbus.implementation = "broker";

  # 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" "tty"];
    home = config.homePath;
    shell = pkgs.zsh;
  };

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