~ruther/nixos-config

ref: 6d88e6ab1c41f1829b8ab87ba04633c15edc6b52 nixos-config/hosts/desktop/hardware-configuration.nix -rw-r--r-- 4.5 KiB
6d88e6ab — Rutherther feat: add direnv support to doom emacs 1 year, 6 months ago
                                                                                
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
#
# Hardware settings for my H310M S2H Desktop
#
# flake.nix
#  └─ ./hosts
#      └─ ./desktop
#          └─ hardware-configuration.nix *
#
# Do not modify this file!  It was generated by ‘nixos-generate-config’
# and may be overwritten by future invocations.  Please make changes
# to /etc/nixos/configuration.nix instead.
#

{ config, lib, pkgs, modulesPath, ... }:

{
  imports =
    [ (modulesPath + "/installer/scan/not-detected.nix")
    ];

  boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usb_storage" "usbhid" "uas" "sd_mod" ];
  boot.initrd.kernelModules = [ ];
  boot.kernelModules = [ "kvm-intel"];
  boot.extraModulePackages = with config.boot.kernelPackages; [ ];

  fileSystems."/" =
    { #device = "/dev/disk/by-uuid/80e0d316-954b-4959-8c5d-06be7255a036";
      device = "/dev/disk/by-label/nixos";
      fsType = "ext4";
    };

  fileSystems."/boot" =
    { #device = "/dev/disk/by-uuid/FCCC-9ECD";
      device = "/dev/disk/by-label/boot";
      fsType = "vfat";
    };

  #fileSystems."/ssd" =
  #  { #device = "/dev/disk/by-uuid/748e6628-0f4e-4479-8940-daa8531d3390";
  #    device = "/dev/disk/by-label/ssd";
  #    fsType = "ntfs";
  #    options = [ "nofail" ];
  #  };

  #fileSystems."/hdd" =
  #  { #device = "/dev/disk/by-uuid/bbab0f8a-50f4-4a7c-a0d3-0ccb036f11d5";
  #    device = "/dev/disk/by-label/hdd";
  #    fsType = "ext4";
  #    options = [ "nofail" ];
  #  };

  fileSystems."/mnt/toshiba1" =
    { #device = "/dev/disk/by-uuid/7491ea96-a62d-4202-ada7-8d0310dfc967";
      device = "/dev/disk/by-label/toshiba";
      fsType = "ext4";
      options = [ "nofail" ];
    };

  fileSystems."/mnt/toshiba2" =
    { #device = "/dev/disk/by-uuid/21307718-de74-4a24-aaa7-dd09f7e89e32";
      device = "/dev/disk/by-label/toshiba2";
      fsType = "ext4";
      options = [ "nofail" ];
    };

  fileSystems."/mnt/toshiba3" =
    { #device = "/dev/disk/by-uuid/7f5e9ea1-2bc3-44c5-9b6a-d8fe2a311b73"; 
      device = "/dev/disk/by-label/toshiba3";
      fsType = "ext4";
      options = [ "nofail" ];
    };

  fileSystems."/mnt/maxtor" =
    { #device = "/dev/disk/by-uuid/36E6613DE660FE8D";
      device = "/dev/disk/by-label/maxtor";
      fsType = "ntfs";
      options = [ "nofail" ];
    };

  fileSystems."/storage" =
    { #truenas smb storage
      device = "//192.168.0.3/storage";
      fsType = "cifs";
      options = let
        automount_opts = "x-systemd.automount,noauto,x-systemd.idle-timeout=60,x-systemd.device-timeout=5s,x-systemd.mount-timeout=5s";
      in ["${automount_opts},mfsymlinks,uid=1000,gid=100,credentials=/home/matthias/smb"];
    };

  fileSystems."/media" =
    { #truenas smb storage
      device = "//192.168.0.3/media";
      fsType = "cifs";
      options = let
        automount_opts = "x-systemd.automount,noauto,x-systemd.idle-timeout=60,x-systemd.device-timeout=5s,x-systemd.mount-timeout=5s";
      in ["${automount_opts},mfsymlinks,uid=1000,gid=100,credentials=/home/matthias/smb"];
    };

  #swapDevices =
  #  [
  #    { #device = "/dev/disk/by-uuid/7d0c3f66-c6eb-413c-956f-dfdd8ceb0cae";
  #      device = "/dev/disk/by-label/swap";
  #    }
  #  ];

  powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
  hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;

  networking = {
    useDHCP = false;                            # Deprecated
    hostName = "desktop";
    enableIPv6 = false;
    bridges = {                                 # Bridge so interface can be used with virtual machines
      "br0" = {
        interfaces = [ "enp3s0" ];              # enp2s0 without 16x PCI-e populated
      };
    };
    interfaces = {
      # enp2s0 = {                              # Change to correct network driver
      #   #useDHCP = true;                      # Disabled because fixed ip
      #   ipv4.addresses = [ {                  # Ip settings: *.0.50 for main machine
      #     address = "192.168.0.50";
      #     prefixLength = 24;
      #   } ];
      # };
      # wlp1s0.useDHCP = true;                  # Wireless card
      br0.ipv4.addresses = [{
        address = "192.168.0.50";
        prefixLength = 24;
      } ];
    };
    defaultGateway = "192.168.0.1";
    nameservers = [ "192.168.0.4" "1.1.1.1"];   # Pi-Hole DNS
    #nameservers = [ "1.1.1.1" "1.0.0.1" ];     # Cloudflare (when Pi-Hole is down)
  };

  #services.hostapd = {                          # Wifi hotspot 
  #  enable = true;
  #  interface = "wlp1s0";
  #  ssid = "desktop";
  #  wpaPassphrase = "<password>";
  #  extraConfig = ''
  #    bridge=br0
  #  '';
  #};
}
Do not follow this link