From a09d1fd32a0ae96ee7f252635cb8f802ed1cb152 Mon Sep 17 00:00:00 2001 From: Alexander Bantyev Date: Tue, 4 Oct 2022 13:21:57 +0400 Subject: [PATCH] Fix t420-laptop --- machines/T420-Laptop/default.nix | 10 +++++- .../T420-Laptop/hardware-configuration.nix | 36 +++++++++++-------- profiles/workspace/locale/default.nix | 2 ++ 3 files changed, 33 insertions(+), 15 deletions(-) diff --git a/machines/T420-Laptop/default.nix b/machines/T420-Laptop/default.nix index 954dccb..f5ba131 100644 --- a/machines/T420-Laptop/default.nix +++ b/machines/T420-Laptop/default.nix @@ -1,4 +1,4 @@ -{ inputs, ... }: { +{ inputs, lib, ... }: { imports = with inputs.self.nixosModules; with inputs.self.nixosProfiles; [ ./hardware-configuration.nix inputs.self.nixosRoles.server @@ -19,6 +19,14 @@ system.stateVersion = "21.11"; + boot.loader = { + systemd-boot.enable = lib.mkForce false; + grub = { + enable = lib.mkForce true; + device = "/dev/sda"; + }; + }; + deviceSpecific.devInfo = { legacy = true; cpu = { diff --git a/machines/T420-Laptop/hardware-configuration.nix b/machines/T420-Laptop/hardware-configuration.nix index a2dda33..1b5919d 100644 --- a/machines/T420-Laptop/hardware-configuration.nix +++ b/machines/T420-Laptop/hardware-configuration.nix @@ -4,27 +4,35 @@ { config, lib, pkgs, modulesPath, ... }: { - imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; + imports = + [ (modulesPath + "/profiles/qemu-guest.nix") + ]; - boot.initrd.availableKernelModules = - [ "ehci_pci" "ahci" "uas" "sd_mod" "sdhci_pci" ]; + boot.initrd.availableKernelModules = [ "ahci" "xhci_pci" "virtio_pci" "sd_mod" "sr_mod" ]; boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-intel" ]; + boot.kernelModules = [ ]; boot.extraModulePackages = [ ]; - fileSystems."/" = { - device = "/dev/disk/by-uuid/d3a1bd83-db4d-4e98-9231-b7c7f19a2cfc"; - fsType = "ext4"; - }; + fileSystems."/" = + { device = "/dev/disk/by-uuid/1364826d-5333-4ec9-93cf-aba2925e41d0"; + fsType = "ext4"; + }; - fileSystems."/boot" = { - device = "/dev/disk/by-uuid/D36A-068D"; - fsType = "vfat"; - }; + fileSystems."/var/lib" = + { device = "/dev/disk/by-uuid/e4122adb-3f73-44b5-8763-7fb91e9a52e7"; + fsType = "ext4"; + }; swapDevices = [ ]; - nix.settings.max-jobs = lib.mkDefault 4; + # 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..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.enp1s0.useDHCP = lib.mkDefault true; - powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; + # nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + nix.settings.max-jobs = 4; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; } diff --git a/profiles/workspace/locale/default.nix b/profiles/workspace/locale/default.nix index d9dc1ac..14bf3d4 100644 --- a/profiles/workspace/locale/default.nix +++ b/profiles/workspace/locale/default.nix @@ -10,6 +10,8 @@ XCOMPOSEFILE = "${config.home-manager.users.balsoft.xdg.configHome}/XCompose"; }; + i18n.defaultLocale = "en_GB.UTF-8"; + time.timeZone = "Asia/Tbilisi"; home-manager.users.balsoft = { home.file.".XCompose".source = ./compose;