fix: nvidia open failed to build

This commit is contained in:
Ryan Yin
2026-02-15 18:15:57 +08:00
parent 6fdc5e7fb9
commit e3115813a1
4 changed files with 163 additions and 112 deletions

View File

@@ -12,37 +12,6 @@ let
# (for example gnome-keyring, kwallet5, KeepassXC)
"--password-store=gnome-libsecret"
];
code-cursor = pkgs-master.code-cursor;
# (pkgs-master.code-cursor.override {
# commandLineArgs = lib.concatStringsSep " " vscodeCliArgs;
# }).overrideAttrs
# (oldAttrs: rec {
# pname = "cursor";
# version = "2.1.36";
# src =
# with pkgs-master;
# appimageTools.extract {
# inherit pname version;
# src =
# let
# sources = {
# x86_64-linux = fetchurl {
# # curl -s https://api2.cursor.sh/updates/api/download/stable/linux-x64/cursor | jq
# url = "https://downloads.cursor.com/production/9cd7c8b6cebcbccc1242df211dee45a4b6fe15e4/linux/x64/Cursor-2.1.36-x86_64.AppImage";
# hash = "sha256-aaprRB2BAaUCHj7m5aGacCBHisjN2pVZ+Ca3u1ifxBA=";
# };
# aarch64-linux = fetchurl {
# # curl -s https://api2.cursor.sh/updates/api/download/stable/linux-arm64/cursor | jq
# url = "https://downloads.cursor.com/production/9cd7c8b6cebcbccc1242df211dee45a4b6fe15e4/linux/arm64/Cursor-2.1.36-aarch64.AppImage";
# hash = "sha256-S2vFYBI6m0zjBJEDbk7gc6/zFiKWyhM73OUm1xsNx6Q=";
# };
# };
# in
# sources.${stdenv.hostPlatform.system};
# };
# sourceRoot = "${pname}-${version}-extracted/usr/share/cursor";
# });
in
{
home.packages = [

View File

@@ -2,10 +2,10 @@
"sources": [
{
"enabled": true,
"name": "Official Noctalia Plugins",
"name": "Noctalia Plugins",
"url": "https://github.com/noctalia-dev/noctalia-plugins"
}
],
"states": {},
"version": 1
"version": 2
}

View File

@@ -1,12 +1,21 @@
{
"appLauncher": {
"autoPasteClipboard": false,
"clipboardWatchImageCommand": "wl-paste --type image --watch cliphist store",
"clipboardWatchTextCommand": "wl-paste --type text --watch cliphist store",
"clipboardWrapText": true,
"customLaunchPrefix": "",
"customLaunchPrefixEnabled": false,
"density": "default",
"enableClipPreview": true,
"enableClipboardHistory": true,
"enableSessionSearch": true,
"enableSettingsSearch": true,
"enableWindowsSearch": true,
"iconMode": "native",
"ignoreMouseInput": false,
"pinnedExecs": [],
"overviewLayer": false,
"pinnedApps": [],
"position": "center",
"screenshotAnnotationTool": "",
"showCategories": true,
@@ -18,24 +27,32 @@
},
"audio": {
"cavaFrameRate": 30,
"externalMixer": "pwvucontrol || pavucontrol",
"mprisBlacklist": [],
"preferredPlayer": "",
"visualizerType": "linear",
"volumeFeedback": false,
"volumeOverdrive": false,
"volumeStep": 1
},
"bar": {
"autoHideDelay": 500,
"autoShowDelay": 150,
"backgroundOpacity": 0.2,
"barType": "simple",
"capsuleColorKey": "none",
"capsuleOpacity": 1,
"density": "comfortable",
"exclusive": true,
"displayMode": "always_visible",
"floating": false,
"marginHorizontal": 0.25,
"marginVertical": 0.25,
"frameRadius": 12,
"frameThickness": 8,
"hideOnOverview": false,
"marginHorizontal": 5,
"marginVertical": 5,
"monitors": [],
"outerCorners": true,
"position": "top",
"screenOverrides": [],
"showCapsule": true,
"showOutline": false,
"useSeparateOpacity": true,
@@ -44,14 +61,20 @@
{
"characterCount": 2,
"colorizeIcons": false,
"emptyColor": "secondary",
"enableScrollWheel": true,
"focusedColor": "primary",
"followFocusedScreen": false,
"groupedBorderOpacity": 1,
"hideUnoccupied": false,
"iconScale": 0.8,
"id": "Workspace",
"labelMode": "index",
"occupiedColor": "secondary",
"pillSize": 0.6,
"reverseScroll": false,
"showApplications": false,
"showBadge": true,
"showLabelsOnlyWhenOccupied": true,
"unfocusedIconsOpacity": 1
}
@@ -59,32 +82,37 @@
"left": [
{
"icon": "rocket",
"id": "Launcher",
"usePrimaryColor": false
"iconColor": "none",
"id": "Launcher"
},
{
"clockColor": "none",
"customFont": "",
"formatHorizontal": "HH:mm ddd, MMM dd",
"formatVertical": "HH mm - dd MM",
"id": "Clock",
"tooltipFormat": "HH:mm ddd, MMM dd",
"useCustomFont": false,
"usePrimaryColor": false
"useCustomFont": false
},
{
"compactMode": false,
"diskPath": "/persistent",
"iconColor": "none",
"id": "SystemMonitor",
"showCpuFreq": false,
"showCpuTemp": false,
"showCpuUsage": true,
"showDiskAvailable": false,
"showDiskUsage": true,
"showDiskUsageAsPercent": false,
"showGpuTemp": false,
"showLoadAverage": true,
"showMemoryAsPercent": true,
"showMemoryUsage": true,
"showNetworkStats": true,
"useMonospaceFont": true,
"usePrimaryColor": false
"showSwapUsage": false,
"textColor": "none",
"useMonospaceFont": true
},
{
"colorizeIcons": false,
@@ -93,50 +121,63 @@
"maxWidth": 145,
"scrollingMode": "hover",
"showIcon": true,
"textColor": "none",
"useFixedWidth": false
},
{
"compactMode": false,
"compactShowAlbumArt": true,
"compactShowVisualizer": false,
"hideMode": "hidden",
"hideWhenIdle": false,
"id": "MediaMini",
"maxWidth": 145,
"panelShowAlbumArt": true,
"panelShowVisualizer": true,
"scrollingMode": "hover",
"showAlbumArt": false,
"showArtistFirst": true,
"showProgressRing": true,
"showVisualizer": false,
"textColor": "none",
"useFixedWidth": false,
"visualizerType": "linear"
}
],
"right": [
{
"id": "ScreenRecorder"
},
{
"hideWhenZero": false,
"hideWhenZeroUnread": false,
"iconColor": "none",
"id": "NotificationHistory",
"showUnreadBadge": true
"showUnreadBadge": true,
"unreadBadgeColor": "primary"
},
{
"deviceNativePath": "",
"displayMode": "alwaysShow",
"hideIfIdle": false,
"hideIfNotDetected": true,
"id": "Battery",
"showNoctaliaPerformance": true,
"showPowerProfiles": true,
"warningThreshold": 30
"showPowerProfiles": true
},
{
"displayMode": "alwaysShow",
"id": "Volume"
"iconColor": "none",
"id": "Volume",
"middleClickCommand": "pwvucontrol || pavucontrol",
"textColor": "none"
},
{
"displayMode": "alwaysShow",
"id": "Brightness"
"iconColor": "none",
"id": "Brightness",
"textColor": "none"
},
{
"blacklist": [],
"chevronColor": "none",
"colorizeIcons": false,
"drawerEnabled": true,
"hidePassive": false,
@@ -182,10 +223,10 @@
},
"colorSchemes": {
"darkMode": true,
"generateTemplatesForPredefined": true,
"generationMethod": "tonal-spot",
"manualSunrise": "06:30",
"manualSunset": "18:30",
"matugenSchemeType": "scheme-rainbow",
"monitorForColors": "",
"predefinedScheme": "Noctalia (default)",
"schedulingMode": "off",
"useWallpaperColors": true
@@ -227,9 +268,6 @@
{
"id": "Bluetooth"
},
{
"id": "ScreenRecorder"
},
{
"id": "WallpaperSelector"
}
@@ -307,30 +345,51 @@
"onlySameOutput": true,
"pinnedApps": [],
"pinnedStatic": false,
"position": "bottom",
"size": 1
},
"general": {
"allowPanelsOnScreenWithoutBar": true,
"allowPasswordWithFprintd": false,
"animationDisabled": false,
"animationSpeed": 1,
"autoStartAuth": false,
"avatarImage": "~/nix-config/_img/myself.jpg",
"boxRadiusRatio": 1,
"clockFormat": "hh\\nmm",
"clockStyle": "custom",
"compactLockScreen": false,
"dimmerOpacity": 0.2,
"enableLockScreenCountdown": true,
"enableShadows": true,
"forceBlackScreenCorners": false,
"iRadiusRatio": 1,
"keybinds": {
"keyDown": ["Down"],
"keyEnter": ["Return"],
"keyEscape": ["Esc"],
"keyLeft": ["Left"],
"keyRight": ["Right"],
"keyUp": ["Up"]
},
"language": "",
"lockOnSuspend": true,
"lockScreenAnimations": false,
"lockScreenBlur": 0,
"lockScreenCountdownDuration": 10000,
"lockScreenMonitors": [],
"lockScreenTint": 0,
"radiusRatio": 1,
"scaleRatio": 1,
"screenRadiusRatio": 1,
"shadowDirection": "bottom_right",
"shadowOffsetX": 2,
"shadowOffsetY": 3,
"showChangelogOnStartup": true,
"showHibernateOnLockScreen": false,
"showScreenCorners": false,
"showSessionButtonsOnLockScreen": true
"showSessionButtonsOnLockScreen": true,
"telemetryEnabled": false
},
"hooks": {
"darkModeChange": "",
@@ -339,11 +398,15 @@
"performanceModeEnabled": "",
"screenLock": "",
"screenUnlock": "",
"session": "",
"startup": "",
"wallpaperChange": ""
},
"location": {
"analogClockInCalendar": false,
"firstDayOfWeek": 1,
"hideWeatherCityName": false,
"hideWeatherTimezone": false,
"name": "Changsha",
"showCalendarEvents": true,
"showCalendarWeather": true,
@@ -373,7 +436,9 @@
"notifications": {
"backgroundOpacity": 1,
"criticalUrgencyDuration": 15,
"enableBatteryToast": true,
"enableKeyboardLayoutToast": true,
"enableMediaToast": false,
"enabled": true,
"location": "top_right",
"lowUrgencyDuration": 3,
@@ -405,17 +470,8 @@
"monitors": [],
"overlayLayer": true
},
"screenRecorder": {
"audioCodec": "opus",
"audioSource": "default_output",
"colorRange": "limited",
"copyToClipboard": false,
"directory": "~/Videos",
"frameRate": 30,
"quality": "high",
"showCursor": true,
"videoCodec": "h264",
"videoSource": "portal"
"plugins": {
"autoUpdate": false
},
"sessionMenu": {
"countdownDuration": 10000,
@@ -428,48 +484,57 @@
"action": "lock",
"command": "",
"countdownEnabled": true,
"enabled": true
"enabled": true,
"keybind": "1"
},
{
"action": "suspend",
"command": "",
"countdownEnabled": true,
"enabled": true
"enabled": true,
"keybind": "2"
},
{
"action": "hibernate",
"command": "",
"countdownEnabled": true,
"enabled": true
"enabled": true,
"keybind": "3"
},
{
"action": "reboot",
"command": "",
"countdownEnabled": true,
"enabled": true
"enabled": true,
"keybind": "4"
},
{
"action": "logout",
"command": "",
"countdownEnabled": true,
"enabled": true
"enabled": true,
"keybind": "5"
},
{
"action": "shutdown",
"command": "",
"countdownEnabled": true,
"enabled": true
"enabled": true,
"keybind": "6"
}
],
"showHeader": true,
"showNumberLabels": true
"showHeader": true
},
"settingsVersion": 37,
"settingsVersion": 53,
"systemMonitor": {
"batteryCriticalThreshold": 5,
"batteryWarningThreshold": 20,
"cpuCriticalThreshold": 95,
"cpuPollingInterval": 10000,
"cpuPollingInterval": 1000,
"cpuWarningThreshold": 80,
"criticalColor": "",
"diskAvailCriticalThreshold": 10,
"diskAvailWarningThreshold": 20,
"diskCriticalThreshold": 90,
"diskPollingInterval": 250,
"diskWarningThreshold": 80,
@@ -482,71 +547,59 @@
"memCriticalThreshold": 90,
"memPollingInterval": 250,
"memWarningThreshold": 80,
"networkPollingInterval": 3000,
"networkPollingInterval": 1000,
"swapCriticalThreshold": 90,
"swapWarningThreshold": 80,
"tempCriticalThreshold": 90,
"tempPollingInterval": 3000,
"tempWarningThreshold": 80,
"useCustomColors": false,
"warningColor": ""
},
"templates": {
"alacritty": false,
"cava": false,
"code": false,
"discord": false,
"emacs": false,
"enableUserTemplates": false,
"foot": false,
"fuzzel": false,
"ghostty": false,
"gtk": false,
"helix": false,
"hyprland": false,
"kcolorscheme": false,
"kitty": false,
"mango": false,
"niri": false,
"pywalfox": false,
"qt": false,
"spicetify": false,
"telegram": false,
"vicinae": false,
"walker": false,
"wezterm": false,
"yazi": false,
"zed": false
"activeTemplates": [],
"enableUserTheming": false
},
"ui": {
"bluetoothDetailsViewMode": "grid",
"bluetoothHideUnnamedDevices": false,
"boxBorderEnabled": false,
"fontDefault": "Maple Mono NF CN",
"fontDefaultScale": 1,
"fontFixed": "Maple Mono NF CN",
"fontFixedScale": 1,
"networkPanelView": "wifi",
"panelBackgroundOpacity": 0.85,
"panelsAttachedToBar": true,
"settingsPanelMode": "attached",
"tooltipsEnabled": true
"tooltipsEnabled": true,
"wifiDetailsViewMode": "grid"
},
"wallpaper": {
"directory": "~/Pictures/Wallpapers",
"automationEnabled": true,
"directory": "/home/ryan/Pictures/Wallpapers",
"enableMultiMonitorDirectories": false,
"enabled": true,
"favorites": [],
"fillColor": "#000000",
"fillMode": "crop",
"hideWallpaperFilenames": false,
"monitorDirectories": [],
"overviewBlur": 0.4,
"overviewEnabled": true,
"overviewTint": 0.6,
"panelPosition": "follow_bar",
"randomEnabled": true,
"randomIntervalSec": 600,
"recursiveSearch": true,
"setWallpaperOnAllMonitors": true,
"showHiddenFiles": false,
"skipStartupTransition": false,
"solidColor": "#1a1a2e",
"sortOrder": "name",
"transitionDuration": 1500,
"transitionEdgeSmoothness": 0.05,
"transitionType": "random",
"useSolidColor": false,
"useWallhaven": false,
"viewMode": "recursive",
"wallhavenApiKey": "",
"wallhavenCategories": "111",
"wallhavenOrder": "desc",

View File

@@ -1,4 +1,9 @@
{ config, lib, ... }:
{
config,
lib,
pkgs,
...
}:
{
# ===============================================================================================
# for Nvidia GPU
@@ -15,13 +20,37 @@
hardware.nvidia = {
# Open-source kernel modules are preferred over and planned to steadily replace proprietary modules
open = true;
nvidiaSettings = true;
# Optionally, you may need to select the appropriate driver version for your specific GPU.
# https://github.com/NixOS/nixpkgs/blob/nixos-unstable/pkgs/os-specific/linux/nvidia-x11/default.nix
package = config.boot.kernelPackages.nvidiaPackages.production;
# package = config.boot.kernelPackages.nvidiaPackages.production;
# https://github.com/NixOS/nixpkgs/issues/489947
# Apply CachyOS kernel 6.19 patch to NVIDIA latest driver
package =
let
base = config.boot.kernelPackages.nvidiaPackages.latest;
cachyos-nvidia-patch = pkgs.fetchpatch {
url = "https://raw.githubusercontent.com/CachyOS/CachyOS-PKGBUILDS/master/nvidia/nvidia-utils/kernel-6.19.patch";
sha256 = "sha256-YuJjSUXE6jYSuZySYGnWSNG5sfVei7vvxDcHx3K+IN4=";
};
# Patch the appropriate driver based on config.hardware.nvidia.open
driverAttr = if config.hardware.nvidia.open then "open" else "bin";
in
base
// {
${driverAttr} = base.${driverAttr}.overrideAttrs (oldAttrs: {
patches = (oldAttrs.patches or [ ]) ++ [ cachyos-nvidia-patch ];
});
};
# required by most wayland compositors!
modesetting.enable = true;
powerManagement.enable = true;
dynamicBoost.enable = lib.mkForce true;
};
hardware.nvidia-container-toolkit.enable = true;