89 lines
2.1 KiB
Nix
89 lines
2.1 KiB
Nix
{ pkgs, lib, ... }:
|
|
let
|
|
intel-driver = (
|
|
if (lib.versionOlder (lib.versions.majorMinor lib.version) "23.11") then
|
|
pkgs.vaapiIntel
|
|
else
|
|
pkgs.intel-vaapi-driver
|
|
);
|
|
intel-driver32 = (
|
|
if (lib.versionOlder (lib.versions.majorMinor lib.version) "23.11") then
|
|
pkgs.driversi686Linux.vaapiIntel
|
|
else
|
|
pkgs.driversi686Linux.intel-vaapi-driver
|
|
);
|
|
in
|
|
{
|
|
sound.enable = true;
|
|
networking.networkmanager.enable = true;
|
|
time.timeZone = "Asia/Shanghai";
|
|
security.sudo.wheelNeedsPassword = false;
|
|
|
|
environment.variables.VDPAU_DRIVER = "va_gl";
|
|
hardware = {
|
|
opengl = {
|
|
enable = true;
|
|
extraPackages = with pkgs; [
|
|
mesa.drivers
|
|
libvdpau-va-gl
|
|
vaapiVdpau
|
|
intel-driver
|
|
];
|
|
|
|
driSupport32Bit = true;
|
|
extraPackages32 = with pkgs.driversi686Linux; [
|
|
intel-driver32
|
|
mesa.drivers
|
|
libvdpau-va-gl
|
|
vaapiVdpau
|
|
];
|
|
};
|
|
};
|
|
|
|
# Select internationalisation properties.
|
|
i18n = {
|
|
defaultLocale = "zh_CN.UTF-8";
|
|
extraLocaleSettings = {
|
|
LC_ADDRESS = "zh_CN.UTF-8";
|
|
LC_IDENTIFICATION = "zh_CN.UTF-8";
|
|
LC_MEASUREMENT = "zh_CN.UTF-8";
|
|
LC_MONETARY = "zh_CN.UTF-8";
|
|
LC_NAME = "zh_CN.UTF-8";
|
|
LC_NUMERIC = "zh_CN.UTF-8";
|
|
LC_PAPER = "zh_CN.UTF-8";
|
|
LC_TELEPHONE = "zh_CN.UTF-8";
|
|
LC_TIME = "zh_CN.UTF-8";
|
|
};
|
|
};
|
|
|
|
nix = {
|
|
settings = {
|
|
auto-optimise-store = true;
|
|
experimental-features = [
|
|
"nix-command"
|
|
"flakes"
|
|
];
|
|
|
|
substituters = [
|
|
"https://mirrors.ustc.edu.cn/nix-channels/store" # 中科大
|
|
"https://mirrors.tuna.tsinghua.edu.cn/nix-channels/store" # 清华
|
|
"https://mirrors.bfsu.edu.cn/nix-channels/store" # 北外
|
|
"https://mirror.sjtu.edu.cn/nix-channels/store" # 交大
|
|
"https://nixos-cn.cachix.org"
|
|
"https://cache.nixos.org/"
|
|
];
|
|
|
|
trusted-users = [
|
|
"root"
|
|
"@wheel"
|
|
];
|
|
};
|
|
|
|
gc = {
|
|
automatic = true;
|
|
dates = "weekly";
|
|
options = "--delete-older-than 1w";
|
|
};
|
|
};
|
|
}
|