me like nix
0

Configure Feed

Select the types of activity you want to include in your feed.

Add Lenovo IdeaPad 5 host

author
Sean Aye
date (May 10, 2026, 3:12 PM -0400) commit eada83c9 parent 81073a13 change-id qpuqotuw
+133
+41
hosts/ideapad5/hardware-configuration.nix
··· 1 + # Generic hardware profile for the Lenovo IdeaPad 5 AMD laptop. 2 + # Replace this with the output from `nixos-generate-config --show-hardware-config` 3 + # on the laptop before installing/switching. 4 + { config, lib, modulesPath, ... }: 5 + 6 + { 7 + imports = [ 8 + (modulesPath + "/installer/scan/not-detected.nix") 9 + ]; 10 + 11 + boot.initrd.availableKernelModules = [ 12 + "nvme" 13 + "xhci_pci" 14 + "usb_storage" 15 + "usbhid" 16 + "sd_mod" 17 + "rtsx_pci_sdmmc" 18 + ]; 19 + boot.initrd.kernelModules = [ ]; 20 + boot.kernelModules = [ "kvm-amd" ]; 21 + boot.extraModulePackages = [ ]; 22 + 23 + # TODO: replace these placeholder labels with the laptop's generated hardware config 24 + # or create filesystems with matching labels during installation. 25 + fileSystems."/" = { 26 + device = "/dev/disk/by-label/nixos"; 27 + fsType = "ext4"; 28 + }; 29 + 30 + fileSystems."/boot" = { 31 + device = "/dev/disk/by-label/BOOT"; 32 + fsType = "vfat"; 33 + options = [ "fmask=0077" "dmask=0077" ]; 34 + }; 35 + 36 + swapDevices = [ ]; 37 + 38 + networking.useDHCP = lib.mkDefault true; 39 + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; 40 + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; 41 + }
+49
modules/hosts/ideapad5.nix
··· 1 + { inputs, config, ... }: 2 + 3 + let 4 + nm = config.flake.modules.nixos; 5 + hm = config.flake.modules.homeManager; 6 + in 7 + { 8 + flake.nixosConfigurations.ideapad5 = inputs.nixpkgs.lib.nixosSystem { 9 + system = "x86_64-linux"; 10 + modules = [ 11 + # Hardware 12 + ../../hosts/ideapad5/hardware-configuration.nix 13 + 14 + # External NixOS modules 15 + inputs.catppuccin.nixosModules.catppuccin 16 + inputs.home-manager.nixosModules.home-manager 17 + { nixpkgs.overlays = [ inputs.niri.overlays.niri ]; } 18 + 19 + # Common aspects 20 + nm.nix-settings 21 + nm.base 22 + nm.security 23 + nm.sean 24 + nm.desktop 25 + nm.fonts 26 + 27 + # Lenovo IdeaPad-specific aspects 28 + nm.lenovo-ideapad5 29 + 30 + # Home Manager 31 + { 32 + home-manager.users.sean = { 33 + imports = [ 34 + inputs.catppuccin.homeModules.catppuccin 35 + inputs.niri.homeModules.niri 36 + inputs.zen-browser.homeModules.beta 37 + inputs.agenix.homeManagerModules.default 38 + hm.sean 39 + hm.desktop 40 + hm.fonts 41 + hm.shell 42 + hm.editor 43 + hm.apps 44 + ]; 45 + }; 46 + } 47 + ]; 48 + }; 49 + }
+43
modules/lenovo-ideapad5.nix
··· 1 + { ... }: { 2 + flake.modules.nixos.lenovo-ideapad5 = 3 + { pkgs, lib, config, ... }: 4 + { 5 + networking.hostName = "ideapad5"; 6 + 7 + # AMD laptop basics 8 + boot.kernelModules = [ "kvm-amd" ]; 9 + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; 10 + boot.kernelParams = [ "amdgpu.abmlevel=0" ]; 11 + 12 + # Low-spec laptop tuning: compressed RAM helps avoid swap thrashing. 13 + zramSwap = { 14 + enable = true; 15 + algorithm = "zstd"; 16 + memoryPercent = 100; 17 + }; 18 + boot.kernel.sysctl."vm.swappiness" = 180; 19 + 20 + # Laptop power management. 21 + services.power-profiles-daemon.enable = true; 22 + services.fstrim.enable = true; 23 + 24 + environment.systemPackages = with pkgs; [ 25 + brightnessctl 26 + ]; 27 + 28 + # SSH 29 + services.openssh = { 30 + enable = true; 31 + settings = { 32 + PasswordAuthentication = false; 33 + KbdInteractiveAuthentication = false; 34 + PermitRootLogin = "no"; 35 + AllowUsers = [ "sean" ]; 36 + }; 37 + }; 38 + 39 + networking.firewall.enable = true; 40 + 41 + system.stateVersion = "25.05"; 42 + }; 43 + }