feat: 新增 laptop 主机配置(Ultra 9 285H / Arc)
- hosts/laptop/hardware.nix: 本机真实硬件配置(btrfs 子卷 / NPU / 微码) - hosts/laptop/default.nix: 复用 common/desktop-plasma/chinese/gaming/printing/apps,跳过 nvidia 与 fpga;加 Intel Arc VA-API - flake.nix: 抽出 mkSystem,新增 nixosConfigurations.laptop / nixos
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
description = "whc NixOS — desktop (i7-12700F + RTX 4060)";
|
description = "whc NixOS — desktop (i7-12700F + RTX 4060) + laptop (Ultra 9 285H / Arc)";
|
||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||||
@@ -9,11 +9,17 @@
|
|||||||
{ self, nixpkgs, ... }:
|
{ self, nixpkgs, ... }:
|
||||||
let
|
let
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
|
mkSystem = host: nixpkgs.lib.nixosSystem {
|
||||||
|
inherit system;
|
||||||
|
modules = [ (./hosts + "/${host}") ];
|
||||||
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
nixosConfigurations.desktop = nixpkgs.lib.nixosSystem {
|
nixosConfigurations = {
|
||||||
inherit system;
|
desktop = mkSystem "desktop";
|
||||||
modules = [ ./hosts/desktop ];
|
laptop = mkSystem "laptop";
|
||||||
|
# hostname 仍是 nixos:让不带 attr 的 `nixos-rebuild --flake .#` 也能命中
|
||||||
|
nixos = mkSystem "laptop";
|
||||||
};
|
};
|
||||||
|
|
||||||
# 无 flake 时也可:把本仓库拷到 /etc/nixos 后 nixos-rebuild switch
|
# 无 flake 时也可:把本仓库拷到 /etc/nixos 后 nixos-rebuild switch
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
# 笔记本:Intel Core Ultra 9 285H + Intel Arc(Arrow Lake-P),无 NVIDIA
|
||||||
|
{ pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./hardware.nix
|
||||||
|
../../modules/common.nix
|
||||||
|
../../modules/desktop-plasma.nix
|
||||||
|
../../modules/chinese.nix
|
||||||
|
../../modules/gaming.nix
|
||||||
|
../../modules/printing.nix
|
||||||
|
../../modules/apps.nix
|
||||||
|
# 本机无 NVIDIA:刻意不导入 ../../modules/nvidia.nix
|
||||||
|
# FPGA 工具链依赖 Qt5,在 unstable 上求值风险高,暂不导入 ../../modules/fpga.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
networking.hostName = "nixos";
|
||||||
|
|
||||||
|
# 笔记本不照抄 desktop 的 "performance",交给内核默认调度
|
||||||
|
# powerManagement.cpuFreqGovernor = "powersave";
|
||||||
|
|
||||||
|
# Intel Arc 硬解(VA-API),可选
|
||||||
|
hardware.graphics.extraPackages = [ pkgs.intel-media-driver ];
|
||||||
|
|
||||||
|
system.stateVersion = "26.05";
|
||||||
|
}
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
# 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, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports =
|
||||||
|
[ (modulesPath + "/installer/scan/not-detected.nix")
|
||||||
|
];
|
||||||
|
|
||||||
|
boot.initrd.availableKernelModules = [ "xhci_pci" "thunderbolt" "nvme" "uas" "sd_mod" ];
|
||||||
|
boot.initrd.kernelModules = [ ];
|
||||||
|
boot.kernelModules = [ "kvm-intel" ];
|
||||||
|
boot.extraModulePackages = [ ];
|
||||||
|
|
||||||
|
fileSystems."/" =
|
||||||
|
{ device = "/dev/disk/by-uuid/cbcb5930-50a9-4ff8-92f9-4622bd869579";
|
||||||
|
fsType = "btrfs";
|
||||||
|
};
|
||||||
|
|
||||||
|
fileSystems."/home" =
|
||||||
|
{ device = "/dev/disk/by-uuid/cbcb5930-50a9-4ff8-92f9-4622bd869579";
|
||||||
|
fsType = "btrfs";
|
||||||
|
options = [ "subvol=home" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
fileSystems."/nix" =
|
||||||
|
{ device = "/dev/disk/by-uuid/cbcb5930-50a9-4ff8-92f9-4622bd869579";
|
||||||
|
fsType = "btrfs";
|
||||||
|
options = [ "subvol=nix" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
fileSystems."/boot" =
|
||||||
|
{ device = "/dev/disk/by-uuid/84D8-EB50";
|
||||||
|
fsType = "vfat";
|
||||||
|
options = [ "fmask=0077" "dmask=0077" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
swapDevices =
|
||||||
|
[ { device = "/dev/disk/by-uuid/d62e342b-271a-40e7-912d-3a748b5f55a1"; }
|
||||||
|
];
|
||||||
|
|
||||||
|
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||||
|
hardware.cpu.intel.npu.enable = true;
|
||||||
|
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user