Finally on thinkpad
This commit is contained in:
parent
55ead06206
commit
4dbc3df3a7
4 changed files with 125 additions and 47 deletions
|
@ -5,47 +5,23 @@
|
||||||
fleetModules,
|
fleetModules,
|
||||||
...
|
...
|
||||||
}: {
|
}: {
|
||||||
imports = fleetModules [
|
imports =
|
||||||
|
[
|
||||||
|
./zfs.nix
|
||||||
|
./hardware-configuration.nix
|
||||||
|
]
|
||||||
|
++ fleetModules [
|
||||||
"common"
|
"common"
|
||||||
"audio"
|
"audio"
|
||||||
"ccr"
|
"ccr"
|
||||||
"exwm"
|
"exwm"
|
||||||
];
|
];
|
||||||
|
|
||||||
hardware.cpu.intel.updateMicrocode = true;
|
|
||||||
hardware.enableRedistributableFirmware = true;
|
|
||||||
|
|
||||||
boot.initrd.availableKernelModules = ["xhci_pci" "nvme" "usb_storage" "sd_mod"];
|
boot.initrd.availableKernelModules = ["xhci_pci" "nvme" "usb_storage" "sd_mod"];
|
||||||
boot.initrd.kernelModules = [];
|
boot.initrd.kernelModules = [];
|
||||||
boot.kernelModules = ["kvm-intel"];
|
boot.kernelModules = ["kvm-intel"];
|
||||||
boot.extraModulePackages = [];
|
boot.extraModulePackages = [];
|
||||||
|
|
||||||
fileSystems."/" = {
|
|
||||||
device = "rpool/system/root";
|
|
||||||
fsType = "zfs";
|
|
||||||
};
|
|
||||||
|
|
||||||
fileSystems."/nix" = {
|
|
||||||
device = "rpool/system/nix";
|
|
||||||
fsType = "zfs";
|
|
||||||
};
|
|
||||||
|
|
||||||
fileSystems."/home" = {
|
|
||||||
device = "rpool/user/home";
|
|
||||||
fsType = "zfs";
|
|
||||||
};
|
|
||||||
|
|
||||||
fileSystems."/boot" = {
|
|
||||||
device = "/dev/disk/by-label/boot";
|
|
||||||
fsType = "vfat";
|
|
||||||
};
|
|
||||||
|
|
||||||
swapDevices = [
|
|
||||||
{device = "/dev/disk/by-uuid/3cab8a5d-602c-4e3d-b436-c0e5595aeb94";}
|
|
||||||
];
|
|
||||||
|
|
||||||
networking.hostId = "8ef630a9";
|
|
||||||
|
|
||||||
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
||||||
# (the default) this is the recommended approach. When using systemd-networkd it's
|
# (the default) this is the recommended approach. When using systemd-networkd it's
|
||||||
# still possible to use this option, but it's recommended to use it in conjunction
|
# still possible to use this option, but it's recommended to use it in conjunction
|
||||||
|
@ -53,16 +29,6 @@
|
||||||
#networking.interfaces.enp0s31f6.useDHCP = lib.mkDefault true;
|
#networking.interfaces.enp0s31f6.useDHCP = lib.mkDefault true;
|
||||||
#networking.interfaces.wlp0s20f3.useDHCP = lib.mkDefault true;
|
#networking.interfaces.wlp0s20f3.useDHCP = lib.mkDefault true;
|
||||||
|
|
||||||
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
|
|
||||||
|
|
||||||
boot.loader.grub = {
|
|
||||||
enable = true;
|
|
||||||
copyKernels = true;
|
|
||||||
efiSupport = true;
|
|
||||||
devices = ["nodev"];
|
|
||||||
efiInstallAsRemovable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
networking.hostName = "thinkpad"; # Define your hostname.
|
networking.hostName = "thinkpad"; # Define your hostname.
|
||||||
# Pick only one of the below networking options.
|
# Pick only one of the below networking options.
|
||||||
#networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
|
#networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
|
||||||
|
@ -117,6 +83,8 @@
|
||||||
wget
|
wget
|
||||||
];
|
];
|
||||||
|
|
||||||
|
programs.light.enable = true;
|
||||||
|
|
||||||
# Some programs need SUID wrappers, can be configured further or are
|
# Some programs need SUID wrappers, can be configured further or are
|
||||||
# started in user sessions.
|
# started in user sessions.
|
||||||
# programs.mtr.enable = true;
|
# programs.mtr.enable = true;
|
||||||
|
|
73
hosts/thinkpad/hardware-configuration.nix
Normal file
73
hosts/thinkpad/hardware-configuration.nix
Normal file
|
@ -0,0 +1,73 @@
|
||||||
|
# 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" "nvme" "usb_storage" "sd_mod"];
|
||||||
|
boot.initrd.kernelModules = [];
|
||||||
|
boot.kernelModules = [];
|
||||||
|
boot.extraModulePackages = [];
|
||||||
|
|
||||||
|
fileSystems."/" = {
|
||||||
|
device = "rpool/nixos/root";
|
||||||
|
fsType = "zfs";
|
||||||
|
options = ["zfsutil" "X-mount.mkdir"];
|
||||||
|
};
|
||||||
|
|
||||||
|
fileSystems."/home" = {
|
||||||
|
device = "rpool/nixos/home";
|
||||||
|
fsType = "zfs";
|
||||||
|
options = ["zfsutil" "X-mount.mkdir"];
|
||||||
|
};
|
||||||
|
|
||||||
|
fileSystems."/var/lib" = {
|
||||||
|
device = "rpool/nixos/var/lib";
|
||||||
|
fsType = "zfs";
|
||||||
|
options = ["zfsutil" "X-mount.mkdir"];
|
||||||
|
};
|
||||||
|
|
||||||
|
fileSystems."/var/log" = {
|
||||||
|
device = "rpool/nixos/var/log";
|
||||||
|
fsType = "zfs";
|
||||||
|
options = ["zfsutil" "X-mount.mkdir"];
|
||||||
|
};
|
||||||
|
|
||||||
|
fileSystems."/boot" = {
|
||||||
|
device = "bpool/nixos/root";
|
||||||
|
fsType = "zfs";
|
||||||
|
options = ["zfsutil" "X-mount.mkdir"];
|
||||||
|
};
|
||||||
|
|
||||||
|
fileSystems."/boot/efis/nvme-INTEL_SSDPEKKF010T8L_PHHP938405741P0D-part1" = {
|
||||||
|
device = "/dev/disk/by-uuid/5C39-390F";
|
||||||
|
fsType = "vfat";
|
||||||
|
};
|
||||||
|
|
||||||
|
fileSystems."/boot/efi" = {
|
||||||
|
device = "/boot/efis/nvme-INTEL_SSDPEKKF010T8L_PHHP938405741P0D-part1";
|
||||||
|
fsType = "none";
|
||||||
|
options = ["bind"];
|
||||||
|
};
|
||||||
|
|
||||||
|
swapDevices = [];
|
||||||
|
|
||||||
|
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
||||||
|
# (the default) this is the recommended approach. When using systemd-networkd it's
|
||||||
|
# still possible to use this option, but it's recommended to use it in conjunction
|
||||||
|
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
|
||||||
|
networking.useDHCP = lib.mkDefault true;
|
||||||
|
# networking.interfaces.enp0s31f6.useDHCP = lib.mkDefault true;
|
||||||
|
# networking.interfaces.wlp0s20f3.useDHCP = lib.mkDefault true;
|
||||||
|
|
||||||
|
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
|
||||||
|
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||||
|
}
|
37
hosts/thinkpad/zfs.nix
Normal file
37
hosts/thinkpad/zfs.nix
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
boot.supportedFilesystems = ["zfs"];
|
||||||
|
networking.hostId = "adf0b5e7";
|
||||||
|
boot.kernelPackages = config.boot.zfs.package.latestCompatibleLinuxPackages;
|
||||||
|
boot.loader.efi.efiSysMountPoint = "/boot/efi";
|
||||||
|
boot.loader.efi.canTouchEfiVariables = false;
|
||||||
|
boot.loader.generationsDir.copyKernels = true;
|
||||||
|
boot.loader.grub.efiInstallAsRemovable = true;
|
||||||
|
boot.loader.grub.enable = true;
|
||||||
|
boot.loader.grub.version = 2;
|
||||||
|
boot.loader.grub.copyKernels = true;
|
||||||
|
boot.loader.grub.efiSupport = true;
|
||||||
|
boot.loader.grub.zfsSupport = true;
|
||||||
|
boot.loader.grub.extraPrepareConfig = ''
|
||||||
|
mkdir -p /boot/efis
|
||||||
|
for i in /boot/efis/*; do mount $i ; done
|
||||||
|
|
||||||
|
mkdir -p /boot/efi
|
||||||
|
mount /boot/efi
|
||||||
|
'';
|
||||||
|
boot.loader.grub.extraInstallCommands = ''
|
||||||
|
ESP_MIRROR=$(mktemp -d)
|
||||||
|
cp -r /boot/efi/EFI $ESP_MIRROR
|
||||||
|
for i in /boot/efis/*; do
|
||||||
|
cp -r $ESP_MIRROR/EFI $i
|
||||||
|
done
|
||||||
|
rm -rf $ESP_MIRROR
|
||||||
|
'';
|
||||||
|
boot.loader.grub.devices = [
|
||||||
|
"/dev/disk/by-id/nvme-INTEL_SSDPEKKF010T8L_PHHP938405741P0D"
|
||||||
|
];
|
||||||
|
users.users.root.initialHashedPassword = "$6$EqXfyFLxUZfpmJ8F$UH3pLcHwgLpOZwiSDhdq/iR/p.uyZZYlk6G4Q0S8BtYr3Qt2xKU56Fwv3Mgco.J0i3cx1Nm8XMfvythSuv8gh/";
|
||||||
|
}
|
|
@ -45,8 +45,8 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
mkConfigurations = {
|
mkConfigurations = {
|
||||||
pc = mkConfiguration {
|
thinkpad = mkConfiguration {
|
||||||
name = "pc";
|
name = "thinkpad";
|
||||||
system = supportedSystems.x86_64-linux;
|
system = supportedSystems.x86_64-linux;
|
||||||
modules = [];
|
modules = [];
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue