aboutsummaryrefslogtreecommitdiff
path: root/infra/libkookie/roots/tempest.nix
blob: dce777eedaf249a3a50bab74bd2081e028f4d813 (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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
/* TOP LEVEL DEVICE CONFIGURATION FOR
 * 
 *    tempest (AMD workstation)
 *
 *
 * This file is part of LIBKOOKIE, a collection of nix expressions.
 * LIBKOOKIE is licensed under the GPL-3.0 (or later) -- see LICENSE
 */

{ lib, config, pkgs, ... } @ args:

let klib = (import <modules/harness/lib.nix>) args;
in
{


  ###################################################################
  #                    libkookie playground
  #
  #
  #


  imports = with klib; [
    # Load base modules required to bootstrap libkookie
    <home-manager/nixos> <modules> <configuration/nix>

    
    #################################################################
    # Modules that require NixOS integration
    #
    <configuration/workstation/fonts>

    <configuration/workstation/xkblayout>
    
    <configuration/workstation/yubikey>
    <configuration/workstation/gpg>

    
    #################################################################
    # home-manager modules that exist entirely in userspace
    #
    (loadModule <configuration/base> "default")

    # Set of base tools and system settings
    (loadModule <configuration/workstation/i3> "tempest")
    (loadModule <configuration/workstation/audio> "default")
    (loadModule <configuration/workstation/kitty> "default")
    (loadModule <configuration/workstation/office> "default")
    (loadModule <configuration/workstation/mail> "default")
    (loadModule <configuration/workstation/firefox> "default")

    (loadModule <configuration/workstation/devel> "default")

    # Various other graphical tools
    (loadModule <configuration/workstation/pass> "default")
    (loadModule <configuration/workstation/chat> "default")
    (loadModule <configuration/workstation/music> "default")
    (loadModule <configuration/workstation/games> "default")
    (loadModule <configuration/workstation/creative> "default")
  ];

  # Configure i3 with the amdgpu driver
  libkookie.ui.i3 = { enable = true; videoDrivers = [ "amdgpu" ]; };

  # Configure audio
  libkookie.audio = { enable = true; discovery = true; jack = true; };
  
  # Enable fish shell handling on the system
  libkookie.base.fish.enable = true;

  # Configure mail handling
  libkookie.workstation.mail = {
    enable = true;
    configPath = ../ext/mail;
    mailArchive = "/home/Office/mail";
    access = { user = "spacekookie"; group = "spacekookie"; };
  };
  
  # Enable desired users
  libkookie.activeUsers = [ (klib.load <configuration/users/spacekookie>) ];


  #
  #
  #
  #
  ###################################################################

  ###################################################################
  #                    NixOS base system options
  #
  #
  #


  
  # Use the GRUB 2 boot loader.
  boot.loader.grub = {
    enable = true;
    device = "/dev/disk/by-id/nvme-Samsung_SSD_970_EVO_Plus_2TB_S4J4NG0M920511P";
    enableCryptodisk = true;
    zfsSupport = true;
    version = 2;
  };

  hardware.cpu.amd.updateMicrocode = true;
  hardware.enableRedistributableFirmware = true;

  boot.initrd.availableKernelModules =
    [ "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" "nvme" "nvme_core" ];
  boot.initrd.kernelModules = [ "dm-snapshot" ];
  boot.kernelModules = [ "kvm-amd" ];
  boot.extraModulePackages = with config.boot.kernelPackages; [ v4l2loopback ];

  services.zfs.autoSnapshot.enable = true;
  
  fileSystems."/" = {
    device = "zroot";
    fsType = "zfs";

    encrypted = {
      enable = true;
      label = "lvm";
      blkDev = "/dev/disk/by-uuid/e01e1473-ea51-4ec7-a5a9-44d673396644";
    };
  };

  fileSystems."/boot" = {
    device = "/dev/disk/by-uuid/0583b1a0-88c1-4e1c-855e-2df948272cbf";
    options = [ "defaults" "discard" ];
    fsType = "ext4";
  };

  swapDevices = [];
  nix.maxJobs = 16;
  
  ## From Mass Effect: Andromeda
  networking.hostName = "tempest";
  networking.hostId = "01fd342c";
  # networking.firewall.allowedTCPPorts = [ 9000 ]; ?????
  
  networking.useDHCP = false;
  #networking.interfaces.enp8s0.useDHCP = true;
  networking.interfaces.eth0.useDHCP = true;
  
  # Select internationalisation properties.
  i18n.defaultLocale = "en_GB.UTF-8";

  # Set your time zone.
  time.timeZone = "Europe/Berlin";
  
  programs.mtr.enable = true;
  programs.gnupg.agent = { enable = true; enableSSHSupport = true; };
  services.openssh.enable = true;

  #
  #
  #
  #
  ###################################################################

  # This setting is not really relevant on this desktop machine, so
  # just update it when new stable NixOS releases are branched off
  system.stateVersion = "20.09";
  
  # Set a static password for this user
  users.users.spacekookie.hashedPassword = "$6$rounds=1000000$IncTbazL/YhUV5$brzwb3Xa0cmmazpxJGPPo93wfs6jAomL1NYJ7Amw3WSyTjXGXGbedIMmm06nkeCnJfJzoZ.Jd47q88ot3USZi/";
}