From 40641b275a4cffe35037f6b750ec694aecf90bb2 Mon Sep 17 00:00:00 2001 From: twoneis Date: Fri, 7 Jun 2024 12:36:46 +0200 Subject: [PATCH] added initial config for thinkpad to save time later --- devices/inkvine/default.nix | 65 +++++++++++++++++++++++++++++++++++++ devices/inkvine/options.nix | 14 ++++++++ outputs.nix | 15 +++++++++ 3 files changed, 94 insertions(+) create mode 100644 devices/inkvine/default.nix create mode 100644 devices/inkvine/options.nix diff --git a/devices/inkvine/default.nix b/devices/inkvine/default.nix new file mode 100644 index 0000000..b5791ee --- /dev/null +++ b/devices/inkvine/default.nix @@ -0,0 +1,65 @@ +{ pkgs, ... }: { + imports = [ + ./options.nix + ]; + + nixpkgs.hostPlatform = "x86_64-linux"; + + networking = { + hostName = "inkvine"; + }; + + boot = { + initrd = { + availableKernelModules = [ "ahci" "xhci_pci" "ums_realtek" "usbhid" "usb_storage" "sd_mod" "sdhci_pci" ]; + }; + + kernelModules = [ "kvm-intel" ]; + kernelPackages = pkgs.linuxPackages_zen; + + loader = { + systemd-boot = { + enable = true; + }; + efi.canTouchEfiVariables = true; + }; + }; + + fileSystems = { + "/boot" = { + device = "/dev/disk/by-uuid/"; + fsType = "vfat"; + }; + "/" = { + device = "/dev/disk/by-uuid/"; + fsType = "btrfs"; + options = [ "subvol=root" "compress=zstd" "noatime" ]; + }; + "/nix" = { + fsType = "btrfs"; + options = [ "subvol=nix" "compress=zstd" "noatime" ]; + }; + "/swap" = { + fsType = "btrfs"; + options = [ "subvol=swap" "noatime" ]; + }; + }; + swapDevices = [ { device = "/swap/swapfile"; } ]; + + services.thermald.enable = true; + + hardware = { + enableRedistributableFirmware = true; + enableAllFirmware = true; + cpu.intel.updateMicrocode = true; + + opengl = { + enable = true; + driSupport = true; + driSupport32Bit = true; + }; + }; + + system.stateVersion = "24.05"; + +} diff --git a/devices/inkvine/options.nix b/devices/inkvine/options.nix new file mode 100644 index 0000000..04e1993 --- /dev/null +++ b/devices/inkvine/options.nix @@ -0,0 +1,14 @@ +{ ... }: { + minimalHome = true; + + withAudio = true; + withBluetooth = true; + withNvidia = false; + + withNiri = false; + withGnome = false; + + withVM = false; + withContainers = false; + withGames = false; +} diff --git a/outputs.nix b/outputs.nix index 387d219..1b61e52 100644 --- a/outputs.nix +++ b/outputs.nix @@ -34,5 +34,20 @@ home-manager.nixosModules.home-manager ]; }; + + # Lenovo Thinkpad + inkvine = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + specialArgs = { + inherit inputs; + }; + modules = [ + ./devices/inkvine + ./modules + ./options.nix + niri.nixosModules.niri + home-manager.nixosModules.home-manager + ]; + }; }; }