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