kore / nixos / hosts / peony.nix81 lines · 1834B · raw
1{ inputs, modulesPath, ... }:
2
3{
4 imports = [
5 inputs.disko.nixosModules.disko
6
7 ( modulesPath + "/installer/scan/not-detected.nix" )
8 ];
9
10 time.timeZone = "Asia/Bangkok";
11
12 boot = {
13 kernelModules = [ "kvm-intel" ];
14
15 loader = {
16 systemd-boot = {
17 enable = true;
18 editor = false;
19 };
20 efi.canTouchEfiVariables = true;
21 };
22
23 initrd = {
24 systemd.enable = true;
25 availableKernelModules = [ "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ];
26 };
27 };
28
29 hardware = {
30 graphics.enable = true;
31 cpu.intel.updateMicrocode = true;
32 };
33
34 disko.devices.disk.main = {
35 type = "disk";
36 device = "/dev/sda";
37 content = {
38 type = "gpt";
39 partitions = {
40 ESP = {
41 size = "512M";
42 type = "EF00";
43 content = {
44 type = "filesystem";
45 format = "vfat";
46 mountpoint = "/boot";
47 mountOptions = [ "umask=0077" ];
48 };
49 };
50 luks = {
51 size = "100%";
52 content = {
53 type = "luks";
54 name = "crypted";
55 settings.allowDiscards = true;
56 content = {
57 type = "btrfs";
58 extraArgs = [ "-f" ];
59 subvolumes = let
60 options = [ "compress=zstd" "noatime" "ssd" "discard=async" ];
61 in {
62 "/@" = {
63 mountpoint = "/";
64 mountOptions = options;
65 };
66 "/@nix" = {
67 mountpoint = "/nix";
68 mountOptions = options;
69 };
70 "/@persist" = {
71 mountpoint = "/persist";
72 mountOptions = options;
73 };
74 };
75 };
76 };
77 };
78 };
79 };
80 };
81}