From 16a0c541b125b14d070c74f83e6abb2a9f02c313 Mon Sep 17 00:00:00 2001 From: Michael Thomson Date: Tue, 18 Mar 2025 12:23:11 -0400 Subject: [PATCH] add thinkpad --- hosts/thinkpad/configuration.nix | 30 +++++++++---- hosts/thinkpad/hardware-configuration.nix | 42 +++++++++---------- hosts/thinkpad/home.nix | 51 ++++++++++------------- 3 files changed, 63 insertions(+), 60 deletions(-) diff --git a/hosts/thinkpad/configuration.nix b/hosts/thinkpad/configuration.nix index 7dd45a5..7b54e91 100644 --- a/hosts/thinkpad/configuration.nix +++ b/hosts/thinkpad/configuration.nix @@ -11,23 +11,34 @@ # Include the results of the hardware scan. ./hardware-configuration.nix inputs.home-manager.nixosModules.default - inputs.nixos-hardware.nixosModules.lenovo-thinkpad-x220 + inputs.nixos-hardware.nixosModules.lenovo-thinkpad-t480 + ../../modules/nixos/bootloader.nix ../../modules/nixos/user.nix - ../../modules/nixos/i3.nix + ../../modules/nixos/ssh.nix + ../../modules/nixos/bluetooth.nix + ../../modules/nixos/hyprland.nix ../../modules/nixos/nm.nix ../../modules/nixos/sound.nix + ../../modules/nixos/steam.nix ../../modules/nixos/env.nix - ../../modules/nixos/1password.nix + ../../modules/nixos/docker.nix ]; - boot.kernelPackages = pkgs.linuxPackages_latest; - - boot.loader.grub.enable = true; - boot.loader.grub.device = "/dev/sda"; - boot.loader.grub.useOSProber = true; - networking.hostName = "thinkpad"; + nix.settings = { + trusted-users = ["mthomson"]; + + substituters = [ + "https://cache.nixos.org" + "https://nix-community.cachix.org" + ]; + + trusted-public-keys = [ + "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" + ]; + }; + time.timeZone = "America/Toronto"; i18n.defaultLocale = "en_CA.UTF-8"; @@ -40,6 +51,7 @@ wget git curl + lsof ]; home-manager = { diff --git a/hosts/thinkpad/hardware-configuration.nix b/hosts/thinkpad/hardware-configuration.nix index bb02357..c88a9d1 100644 --- a/hosts/thinkpad/hardware-configuration.nix +++ b/hosts/thinkpad/hardware-configuration.nix @@ -1,37 +1,37 @@ # 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, ... }: + { - config, - lib, - pkgs, - modulesPath, - ... -}: { - imports = [ - (modulesPath + "/installer/scan/not-detected.nix") - ]; + imports = + [ (modulesPath + "/installer/scan/not-detected.nix") + ]; - boot.initrd.availableKernelModules = ["ehci_pci" "ahci" "usb_storage" "sd_mod" "sdhci_pci"]; - boot.initrd.kernelModules = []; - boot.kernelModules = []; - boot.extraModulePackages = []; + boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "usb_storage" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; - fileSystems."/" = { - device = "/dev/disk/by-uuid/08ecde1d-02ae-4308-a6d1-93ec9361a2fc"; - fsType = "ext4"; - }; + fileSystems."/" = + { device = "/dev/disk/by-uuid/6212512c-31fc-4366-9756-a0aa05fd3c20"; + fsType = "ext4"; + }; - swapDevices = [ - {device = "/dev/disk/by-uuid/add2134a-831a-42bd-8822-8a4f0702aa06";} - ]; + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/A8AE-5CBB"; + fsType = "vfat"; + options = [ "fmask=0077" "dmask=0077" ]; + }; + + 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..useDHCP`. networking.useDHCP = lib.mkDefault true; - # networking.interfaces.enp0s25.useDHCP = lib.mkDefault true; + # networking.interfaces.enp0s31f6.useDHCP = lib.mkDefault true; # networking.interfaces.wlp3s0.useDHCP = lib.mkDefault true; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; diff --git a/hosts/thinkpad/home.nix b/hosts/thinkpad/home.nix index 7c4ebfe..c123a44 100644 --- a/hosts/thinkpad/home.nix +++ b/hosts/thinkpad/home.nix @@ -4,45 +4,36 @@ ... }: { imports = [ - ../../modules/home-manager/i3 - ../../modules/home-manager/ssh - ../../modules/home-manager/git - ../../modules/home-manager/nixvim - ../../modules/home-manager/wezterm - ../../modules/home-manager/zsh - ../../modules/home-manager/tmux - ../../modules/home-manager/taskwarrior - ../../modules/home-manager/zoxide - ../../modules/home-manager/zathura - ../../modules/home-manager/syncthing - ../../modules/home-manager/email + ../../modules/home-manager/hyprland.nix + ../../modules/home-manager/git.nix + ../../modules/home-manager/nixvim.nix + ../../modules/home-manager/kitty.nix + ../../modules/home-manager/zsh.nix + ../../modules/home-manager/tmux.nix + ../../modules/home-manager/taskwarrior.nix + ../../modules/home-manager/email.nix + ../../modules/home-manager/syncthing.nix + ../../modules/home-manager/bitwarden.nix + ../../modules/home-manager/kubernetes.nix + ../../modules/home-manager/nix-index.nix + ../../modules/home-manager/bitwarden.nix + ../../modules/home-manager/direnv.nix + ../../modules/home-manager/jq.nix + ../../modules/home-manager/lazygit.nix + ../../modules/home-manager/man.nix ]; home.username = "mthomson"; home.homeDirectory = "/home/mthomson"; home.stateVersion = "23.11"; - programs = { - direnv = { - enable = true; - enableZshIntegration = true; # see note on other shells below - nix-direnv.enable = true; - }; - }; - home.packages = with pkgs; [ firefox gcc - fzf - ripgrep - jq - unzip - pavucontrol - pasystray - networkmanagerapplet - _1password-cli - upower - acpi ]; + home.sessionVariables = { + STEAM_EXTRA_COMPAT_TOOLS_PATH = "\${HOME}/.steam/root/compatibilitytools.d"; + }; + programs.home-manager.enable = true; }