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