kore / nixos / hosts / sunflower.nix88 lines · 2116B · raw
1{ pkgs, inputs, modulesPath, ... }:
2
3{
4 imports = [
5 inputs.disko.nixosModules.disko
6
7 ( modulesPath + "/installer/scan/not-detected.nix" )
8 ];
9
10 boot = {
11 kernelModules = [ "kvm-intel" ];
12
13 loader = {
14 systemd-boot.enable = true;
15 efi.canTouchEfiVariables = true;
16 };
17
18 initrd = {
19 systemd.enable = true;
20 availableKernelModules = [ "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ];
21 };
22 };
23
24 users.users.lostduk = {
25 password = "tmp";
26 isNormalUser = true;
27
28 extraGroups = [ "wheel" ];
29 subUidRanges = [{ startUid = 100000; count = 65536; }];
30 subGidRanges = [{ startGid = 100000; count = 65536; }];
31 };
32
33 hardware = {
34 graphics = {
35 enable = true;
36 extraPackages = with pkgs; [ libGL ];
37 };
38 cpu.intel.updateMicrocode = true;
39 };
40
41 disko.devices.disk.main = {
42 type = "disk";
43 device = "/dev/sda";
44 content = {
45 type = "gpt";
46 partitions = {
47 ESP = {
48 size = "512M";
49 type = "EF00";
50 content = {
51 type = "filesystem";
52 format = "vfat";
53 mountpoint = "/boot";
54 mountOptions = [ "defaults" "uid=0" "gid=0" "fmask=0077" "dmask=0077" ];
55 };
56 };
57 luks = {
58 size = "100%";
59 content = {
60 name = "crypted";
61 type = "luks";
62 extraFormatArgs = [ "--type luks2" ];
63 content = {
64 type = "btrfs";
65 extraArgs = [ "-f" ];
66 subvolumes = let
67 options = [ "compress=zstd" "noatime" "space_cache=v2" "discard=async" "ssd" ];
68 in {
69 "/@" = {
70 mountpoint = "/";
71 mountOptions = options;
72 };
73 "/@nix" = {
74 mountpoint = "/nix";
75 mountOptions = options;
76 };
77 "/@persist" = {
78 mountpoint = "/persist";
79 mountOptions = options;
80 };
81 };
82 };
83 };
84 };
85 };
86 };
87 };
88}