refactor foureighty hardware config

This commit is contained in:
Cyryl Płotnicki 2020-07-25 09:56:03 +01:00
parent 536c0a842a
commit f8e1b886be
3 changed files with 52 additions and 52 deletions

View file

@ -2,38 +2,27 @@
{ {
networking.hostName = "foureighty"; networking.hostName = "foureighty";
boot = { imports = [
# need unlocked kernel for throttled daemon <home-manager/nixos>
kernelPackages = pkgs.linuxPackages_latest; ./hardware-configuration.nix
../../boot.nix
../../common.nix
../../gfx-nvidia-optimus.nix
../../zerotier.nix
../../distributed-builds.nix
../../libvirt.nix
../../backups.nix
../../gnome
];
kernelModules = [ "acpi_call" ]; boot.kernelPackages = pkgs.linuxPackages_latest;
extraModulePackages = with config.boot.kernelPackages; [ acpi_call ];
initrd.luks.devices = {
root = {
device = "/dev/disk/by-uuid/a9e8a44f-15be-4844-a0a1-46892cc5e44e";
allowDiscards = true;
};
};
loader.grub = {
device = "nodev";
efiSupport = true;
};
loader.efi.canTouchEfiVariables = true;
};
time.hardwareClockInLocalTime = true; time.hardwareClockInLocalTime = true;
time.timeZone = "Europe/London"; time.timeZone = "Europe/London";
hardware.trackpoint.enable = true;
services.throttled.enable = true; services.throttled.enable = true;
zramSwap = {
enable = true; hardware.trackpoint.enable = true;
algorithm = "zstd";
memoryPercent = 25;
};
services.hardware.bolt.enable = true; services.hardware.bolt.enable = true;
services.fprintd = { services.fprintd = {
enable = true; enable = true;
@ -61,20 +50,4 @@
home.file.".config/i3/status.toml".source = ../../../.config/i3/status-double-bat.toml; home.file.".config/i3/status.toml".source = ../../../.config/i3/status-double-bat.toml;
}; };
imports = [
<home-manager/nixos>
./hardware-configuration.nix
../../boot.nix
../../common.nix
../../gfx-nvidia-optimus.nix
../../zerotier.nix
../../distributed-builds.nix
../../libvirt.nix
../../backups.nix
../../gnome
];
nix.maxJobs = 2;
nix.buildCores = 6;
} }

View file

@ -3,13 +3,31 @@
{ {
imports = [ ]; imports = [ ];
boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "usbhid" "usb_storage" "sd_mod" ]; boot = {
boot.initrd.kernelModules = [ "dm-snapshot" ]; kernel.sysctl = {
boot.kernelModules = [ "kvm-intel" ]; "vm.swappiness" = 75;
boot.extraModulePackages = [ ]; };
boot.kernel.sysctl = { kernelModules = [ "kvm-intel" "acpi_call" ];
"vm.swappiness" = 75; extraModulePackages = with config.boot.kernelPackages; [ acpi_call ];
initrd = {
kernelModules = [ "dm-snapshot" ];
availableKernelModules = [ "xhci_pci" "nvme" "usbhid" "usb_storage" "sd_mod" ];
luks.devices = {
root = {
device = "/dev/disk/by-uuid/a9e8a44f-15be-4844-a0a1-46892cc5e44e";
allowDiscards = true;
};
};
};
loader.grub = {
device = "nodev";
efiSupport = true;
};
loader.efi.canTouchEfiVariables = true;
}; };
fileSystems."/" = { device = "/dev/disk/by-uuid/7ae9348d-604e-4196-a27b-24a7495438c3"; fsType = "ext4"; }; fileSystems."/" = { device = "/dev/disk/by-uuid/7ae9348d-604e-4196-a27b-24a7495438c3"; fsType = "ext4"; };
@ -18,5 +36,12 @@
swapDevices = [ ]; swapDevices = [ ];
nix.maxJobs = lib.mkDefault 8; zramSwap = {
enable = true;
algorithm = "zstd";
memoryPercent = 25;
};
nix.maxJobs = 2;
nix.buildCores = 6;
} }

View file

@ -23,9 +23,11 @@
fonts.fontconfig.enable = true; fonts.fontconfig.enable = true;
home-manager.users.cyryl = {...}: { home-manager.users.cyryl = {...}: {
imports = [ imports = [
../../home-common.nix imports = [
../../programs/git.nix ../../home-manager
../../gui.nix ../../home-manager/gui.nix
../../home-manager/programs/git.nix
];
]; ];
home.stateVersion = config.system.stateVersion; home.stateVersion = config.system.stateVersion;