nixos-config/hosts/jupiter/hardware-configuration.nix

239 lines
6.9 KiB
Nix
Raw Normal View History

2023-09-03 10:18:04 +02:00
#
# Hardware settings for Teclast F5 10" Laptop
# NixOS @ sda2
#
# flake.nix
# └─ ./hosts
# └─ ./laptop
# └─ 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 + "/profiles/qemu-guest.nix")
];
2023-10-01 09:22:19 +02:00
boot.initrd.availableKernelModules = [ "uhci_hcd" "ehci_pci" "ahci" "virtio_pci" "virtio_scsi" "sr_mod" "virtio_blk" ];
boot.initrd.kernelModules = [ ];
2023-09-03 14:07:45 +02:00
# boot.initrd.secrets = {
# "/root/NASKeyfile" =
# /root/NASKeyfile;
# };
2023-09-03 10:18:04 +02:00
# boot.initrd.luks.devices = {
# NAS-RAID1 = {
# device = "/dev/disk/by-uuid/57e6446d-faca-4b67-9063-e8d9afb80088";
# keyFile = "/root/NASKeyfile";
# };
# NAS-RAID2 = {
# device = "/dev/disk/by-uuid/b9edc489-ac37-4b28-981d-442722df7ae2";
# keyFile = "/root/NASKeyfile";
# };
# };
2023-10-01 09:22:19 +02:00
boot.kernelModules = [ ];
2023-09-03 10:18:04 +02:00
boot.extraModulePackages = [ ];
2023-09-23 09:19:56 +02:00
boot.tmp.useTmpfs = false;
boot.tmp.cleanOnBoot = true;
2023-09-03 10:18:04 +02:00
zramSwap.enable = true;
services.btrfs.autoScrub = {
enable = true;
interval = "monthly";
fileSystems = [
"/"
2023-10-01 09:22:19 +02:00
"/mnt/Mars"
2023-09-03 10:18:04 +02:00
# "/mnt/Pluto"
];
};
services.btrbk = {
instances = {
hf = {
onCalendar = "hourly";
settings = {
incremental = "yes";
snapshot_create = "ondemand";
snapshot_dir = "@snapshots";
timestamp_format = "long";
snapshot_preserve = "2m 2w 5d 5h";
snapshot_preserve_min = "latest";
volume = {
"/mnt/snapshots/root" = {
snapshot_create = "always";
subvolume = {
"@" = {};
"@home" = {};
2023-10-01 09:22:19 +02:00
};
};
};
volume = {
"/mnt/snapshots/Mars" = {
snapshot_create = "always";
subvolume = {
2023-09-10 09:36:07 +02:00
"@nas" = {};
2023-09-03 10:18:04 +02:00
};
};
};
};
};
# lf = {
# onCalendar = "daily";
# settings = {
# incremental = "yes";
# snapshot_create = "ondemand";
# snapshot_dir = "@snapshots";
# timestamp_format = "long";
#
# snapshot_preserve = "2m 2w 5d";
# snapshot_preserve_min = "latest";
#
# volume = {
# "/mnt/snapshots/Pluto" = {
# snapshot_create = "always";
# subvolume = {
# "@" = {};
# "@/Backups" = {};
# "@/Games" = {};
# "@/IT" = {};
# "@/Media" = {};
# "@/Pictures" = {};
# "@/Rest" = {};
# };
# };
# };
# };
# };
};
};
fileSystems."/" =
{ device = "/dev/disk/by-label/NIXROOT";
fsType = "btrfs";
options = [ "compress=zstd,space_cache=v2,ssd,noatime,subvol=@,discard=async" ];
};
fileSystems."/home" =
{ device = "/dev/disk/by-label/NIXROOT";
fsType = "btrfs";
options = [ "compress=zstd,space_cache=v2,ssd,noatime,subvol=@home,discard=async" ];
};
fileSystems."/srv" =
{ device = "/dev/disk/by-label/NIXROOT";
fsType = "btrfs";
options = [ "compress=zstd,space_cache=v2,ssd,noatime,subvol=@srv,discard=async" ];
};
fileSystems."/nix" =
{ device = "/dev/disk/by-label/NIXROOT";
fsType = "btrfs";
options = [ "compress=zstd,space_cache=v2,ssd,noatime,subvol=@nix,discard=async" ];
};
2023-09-23 09:19:56 +02:00
fileSystems."/swap" =
{ device = "/dev/disk/by-label/NIXROOT";
fsType = "btrfs";
options = [ "compress=zstd,space_cache=v2,ssd,noatime,subvol=@swap,discard=async" ];
};
2023-09-03 10:18:04 +02:00
fileSystems."/mnt/snapshots/root" =
{ device = "/dev/disk/by-label/NIXROOT";
fsType = "btrfs";
options = [ "compress=zstd,space_cache=v2,ssd,noatime,subvolid=5,discard=async" ];
};
2023-09-03 19:39:29 +02:00
fileSystems."/mnt/snapshots/Mars" =
{ device = "/dev/disk/by-label/MARS";
2023-09-03 19:39:29 +02:00
fsType = "btrfs";
options = [ "compress=zstd,space_cache=v2,ssd,noatime,subvolid=5,discard=async" ];
};
2023-09-03 10:18:04 +02:00
# fileSystems."/mnt/snapshots/Pluto" =
# { device = "/dev/disk/by-label/NAS-RAID";
# fsType = "btrfs";
# options = [ "compress=zstd,space_cache=v2,noatime,subvolid=5" ];
# };
#
# fileSystems."/mnt/Pluto" =
# { device = "/dev/disk/by-label/NAS-RAID";
# fsType = "btrfs";
# options = [ "compress=zstd,space_cache=v2,noatime,subvol=@" ];
# };
#
2023-09-03 19:39:29 +02:00
fileSystems."/mnt/Mars" =
{ device = "/dev/disk/by-label/MARS";
2023-09-03 19:39:29 +02:00
fsType = "btrfs";
options = [ "compress=zstd,space_cache=v2,ssd,noatime,subvol=@nas,discard=async" ];
};
2023-09-03 10:18:04 +02:00
fileSystems."/boot" =
{ device = "/dev/disk/by-label/NIXBOOT";
fsType = "vfat";
};
# fileSystems."/export/Pluto" =
# { device = "/mnt/Pluto";
# options = [ "bind" ];
# };
2023-09-03 19:39:29 +02:00
fileSystems."/export/Mars" =
{ device = "/mnt/Mars";
options = [ "bind" ];
};
2023-09-03 10:18:04 +02:00
2023-09-23 09:19:56 +02:00
swapDevices = [ { device = "/swap/swapfile"; } ];
2023-09-03 10:18:04 +02:00
networking = {
hostName = "jupiter";
domain = "home.opel-online.de";
networkmanager = {
enable = false;
};
timeServers = [
"192.168.2.1"
];
interfaces = {
2023-10-01 09:22:19 +02:00
enp6s18 = {
useDHCP = true; # For versatility sake, manually edit IP on nm-applet.
2023-09-03 10:18:04 +02:00
# ipv4.addresses = [ {
# address = "45.142.114.153";
# prefixLength = 24;
# } ];
# ipv6.addresses = [ {
# address = "2a00:ccc1:101:19D::2";
# prefixLength = 64;
# } ];
# };
};
};
# defaultGateway = "45.142.114.1";
defaultGateway6 = {
address = "fe80::1";
2023-10-01 09:22:19 +02:00
interface = "enp6s18";
2023-09-03 10:18:04 +02:00
};
# nameservers = [ "9.9.9.9" "2620:fe::fe" ];
#firewall = {
# enable = false;
# #allowedUDPPorts = [ 53 67 ];
# #allowedTCPPorts = [ 53 80 443 9443 ];
#};
};
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
powerManagement = {
cpuFreqGovernor = lib.mkDefault "powersave";
powertop.enable = true;
2023-09-03 19:39:29 +02:00
scsiLinkPolicy = "med_power_with_dipm";
# powerUpCommands = ''
2023-09-03 10:18:04 +02:00
# ${pkgs.hdparm}/sbin/hdparm -S 150 /dev/disk/by-uuid/57e6446d-faca-4b67-9063-e8d9afb80088
# ${pkgs.hdparm}/sbin/hdparm -S 150 /dev/disk/by-uuid/b9edc489-ac37-4b28-981d-442722df7ae2
# '';
};
}