diff --git a/flake.nix b/flake.nix index 5503da6..dd149d6 100644 --- a/flake.nix +++ b/flake.nix @@ -103,23 +103,20 @@ prev.cmake ]; src = inputs.sway-git; - })).override - { - wlroots = wlroots-git; - }; + })).override { wlroots = wlroots-git; }; waybar = prev.waybar.override { wlroots = wlroots-git; }; - xwayland = prev.xwayland.overrideAttrs (old: { - version = "22.2"; - src = inputs.xorg-git; - buildInputs = old.buildInputs ++ [ - prev.udev - prev.xorg.libpciaccess - ]; - }); + # xwayland = prev.xwayland.overrideAttrs (old: { + # version = "22.2"; + # src = inputs.xorg-git; + # buildInputs = old.buildInputs ++ [ + # prev.udev + # prev.xorg.libpciaccess + # ]; + # }); steam = prev.steam.override { extraPkgs = pkgs: [ @@ -135,6 +132,22 @@ src = inputs.gamescope-git; }); + mesa-git = (prev.mesa.overrideAttrs (old: { + version = "23.0"; + src = inputs.mesa-git; + buildInputs = old.buildInputs ++ [ + pkgs.glslang + ]; + patches = [ + ./pkgs/mesa-git/opencl.patch + ./pkgs/mesa-git/disk_cache-include-dri-driver-path-in-cache-key.patch + ]; + })).override { + galliumDrivers = [ "radeonsi" "swrast" ]; + vulkanDrivers = [ "amd" ]; + enableGalliumNine = false; # Replaced by DXVK + }; + inherit (veloren.packages."${system}") veloren-voxygen; }); @@ -156,12 +169,11 @@ home-manager.nixosModules.home-manager { home-manager = { - useGlobalPkgs = true; + #useGlobalPkgs = true; useUserPackages = true; users.${username} = import ./user/home.nix; extraSpecialArgs = { - inherit inputs; - inherit pkgs; + inherit inputs pkgs; }; }; } diff --git a/pkgs/mesa-git/disk_cache-include-dri-driver-path-in-cache-key.patch b/pkgs/mesa-git/disk_cache-include-dri-driver-path-in-cache-key.patch new file mode 100644 index 0000000..a0a4908 --- /dev/null +++ b/pkgs/mesa-git/disk_cache-include-dri-driver-path-in-cache-key.patch @@ -0,0 +1,58 @@ +diff --git a/meson_options.txt b/meson_options.txt +index 283a02bc934..21964e00cf7 100644 +--- a/meson_options.txt ++++ b/meson_options.txt +@@ -464,6 +464,12 @@ option( + value : true, + description : 'Enable direct rendering in GLX and EGL for DRI', + ) ++option( ++ 'disk-cache-key', ++ type : 'string', ++ value : '', ++ description : 'Mesa cache key.' ++) + option('egl-lib-suffix', + type : 'string', + value : '', +diff --git a/src/util/disk_cache.c b/src/util/disk_cache.c +index 274508ecfd6..ac963633157 100644 +--- a/src/util/disk_cache.c ++++ b/src/util/disk_cache.c +@@ -209,8 +209,10 @@ disk_cache_create(const char *gpu_name, const char *driver_id, + + /* Create driver id keys */ + size_t id_size = strlen(driver_id) + 1; ++ size_t key_size = strlen(DISK_CACHE_KEY) + 1; + size_t gpu_name_size = strlen(gpu_name) + 1; + cache->driver_keys_blob_size += id_size; ++ cache->driver_keys_blob_size += key_size; + cache->driver_keys_blob_size += gpu_name_size; + + /* We sometimes store entire structs that contains a pointers in the cache, +@@ -231,6 +233,7 @@ disk_cache_create(const char *gpu_name, const char *driver_id, + uint8_t *drv_key_blob = cache->driver_keys_blob; + DRV_KEY_CPY(drv_key_blob, &cache_version, cv_size) + DRV_KEY_CPY(drv_key_blob, driver_id, id_size) ++ DRV_KEY_CPY(drv_key_blob, DISK_CACHE_KEY, key_size) + DRV_KEY_CPY(drv_key_blob, gpu_name, gpu_name_size) + DRV_KEY_CPY(drv_key_blob, &ptr_size, ptr_size_size) + DRV_KEY_CPY(drv_key_blob, &driver_flags, driver_flags_size) +diff --git a/src/util/meson.build b/src/util/meson.build +index 37fdc8b299e..ca2b8947cf8 100644 +--- a/src/util/meson.build ++++ b/src/util/meson.build +@@ -273,7 +273,12 @@ _libmesa_util = static_library( + include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux], + dependencies : deps_for_libmesa_util, + link_with: [libmesa_format, libmesa_util_sse41], +- c_args : [c_msvc_compat_args], ++ c_args : [ ++ c_msvc_compat_args, ++ '-DDISK_CACHE_KEY="@0@"'.format( ++ get_option('disk-cache-key') ++ ), ++ ], + gnu_symbol_visibility : 'hidden', + build_by_default : false + ) diff --git a/pkgs/mesa-git/opencl.patch b/pkgs/mesa-git/opencl.patch new file mode 100644 index 0000000..ce6e3d5 --- /dev/null +++ b/pkgs/mesa-git/opencl.patch @@ -0,0 +1,70 @@ +diff --git a/meson_options.txt b/meson_options.txt +index a7030aba31e..1d2d8814992 100644 +--- a/meson_options.txt ++++ b/meson_options.txt +@@ -18,6 +18,12 @@ + # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + # SOFTWARE. + ++option( ++ 'clang-libdir', ++ type : 'string', ++ value : '', ++ description : 'Locations to search for clang libraries.' ++) + option( + 'platforms', + type : 'array', +diff --git a/src/gallium/targets/opencl/meson.build b/src/gallium/targets/opencl/meson.build +index b77826b6e1e..14fa9ba7177 100644 +--- a/src/gallium/targets/opencl/meson.build ++++ b/src/gallium/targets/opencl/meson.build +@@ -30,6 +30,7 @@ if with_ld_version_script + endif + + llvm_libdir = dep_llvm.get_variable(cmake : 'LLVM_LIBRARY_DIR', configtool: 'libdir') ++clang_libdir = get_option('clang-libdir') + opencl_libname = with_opencl_icd ? 'MesaOpenCL' : 'OpenCL' + + polly_dep = null_dep +@@ -60,19 +61,19 @@ else + endif + if not (dep_clang.found() and dep_clang_usable) + dep_clang = [ +- cpp.find_library('clangCodeGen', dirs : llvm_libdir), +- cpp.find_library('clangFrontendTool', dirs : llvm_libdir), +- cpp.find_library('clangFrontend', dirs : llvm_libdir), +- cpp.find_library('clangDriver', dirs : llvm_libdir), +- cpp.find_library('clangSerialization', dirs : llvm_libdir), +- cpp.find_library('clangParse', dirs : llvm_libdir), +- cpp.find_library('clangSema', dirs : llvm_libdir), +- cpp.find_library('clangAnalysis', dirs : llvm_libdir), +- cpp.find_library('clangAST', dirs : llvm_libdir), +- cpp.find_library('clangASTMatchers', dirs : llvm_libdir), +- cpp.find_library('clangEdit', dirs : llvm_libdir), +- cpp.find_library('clangLex', dirs : llvm_libdir), +- cpp.find_library('clangBasic', dirs : llvm_libdir), ++ cpp.find_library('clangCodeGen', dirs : clang_libdir), ++ cpp.find_library('clangFrontendTool', dirs : clang_libdir), ++ cpp.find_library('clangFrontend', dirs : clang_libdir), ++ cpp.find_library('clangDriver', dirs : clang_libdir), ++ cpp.find_library('clangSerialization', dirs : clang_libdir), ++ cpp.find_library('clangParse', dirs : clang_libdir), ++ cpp.find_library('clangSema', dirs : clang_libdir), ++ cpp.find_library('clangAnalysis', dirs : clang_libdir), ++ cpp.find_library('clangAST', dirs : clang_libdir), ++ cpp.find_library('clangASTMatchers', dirs : clang_libdir), ++ cpp.find_library('clangEdit', dirs : clang_libdir), ++ cpp.find_library('clangLex', dirs : clang_libdir), ++ cpp.find_library('clangBasic', dirs : clang_libdir), + polly_dep, polly_isl_dep, + ] + # check clang once more +@@ -120,6 +121,6 @@ if with_opencl_icd + input : 'mesa.icd.in', + output : 'mesa.icd', + install : true, +- install_dir : join_paths(get_option('sysconfdir'), 'OpenCL', 'vendors'), ++ install_dir : join_paths(get_option('prefix'), 'etc', 'OpenCL', 'vendors'), + ) + endif diff --git a/system/configuration.nix b/system/configuration.nix index ff57ca7..9b230ce 100644 --- a/system/configuration.nix +++ b/system/configuration.nix @@ -78,6 +78,8 @@ hardware.opengl = { enable = true; + package = pkgs.mesa-git.drivers; + package32 = pkgs.pkgsi686Linux.mesa-git.drivers; extraPackages = [ pkgs.libvdpau-va-gl ]; @@ -132,7 +134,17 @@ # Define a user account. Don't forget to set a password with ‘passwd’. users.users.manuel = { isNormalUser = true; - extraGroups = [ "users" "wheel" "audio" "video" "games" "input" "geoclue" "networkmanager" "nm-openvpn" ]; + extraGroups = [ + "audio" + "games" + "geoclue" + "input" + "networkmanager" + "nm-openvpn" + "users" + "video" + "wheel" + ]; shell = pkgs.fish; }; diff --git a/user/configs/fish/fish.nix b/user/configs/fish/fish.nix index a5e9bd0..a7402bd 100644 --- a/user/configs/fish/fish.nix +++ b/user/configs/fish/fish.nix @@ -42,7 +42,7 @@ nou = '' pushd &> /dev/null cd "${config.home.homeDirectory}/.dotfiles" - nix flake lock --commit-lock-file --update-input nixpkgs --update-input home-manager --update-input nur + nix flake lock --commit-lock-file --update-input nixpkgs --update-input home-manager doas nixos-rebuild switch --upgrade --flake .# popd &> /dev/null ''; diff --git a/user/configs/kakoune/kakoune.nix b/user/configs/kakoune/kakoune.nix index 5b11a71..ffa9adb 100644 --- a/user/configs/kakoune/kakoune.nix +++ b/user/configs/kakoune/kakoune.nix @@ -15,13 +15,12 @@ in programs.kakoune = { enable = true; plugins = with pkgs.kakounePlugins; [ - smarttab - kakboard - #auto-pairs-kak kak-lsp - sort-selections - powerline-kak + kakboard kakoune-extra-filetypes + powerline-kak + smarttab + sort-selections ]; config = { colorScheme = "gruvbox-dark"; diff --git a/user/home.nix b/user/home.nix index 6672ac5..df7e5c1 100644 --- a/user/home.nix +++ b/user/home.nix @@ -19,9 +19,9 @@ home.homeDirectory = "/home/manuel"; home.packages = [ pkgs.appimage-run - # pkgs.bottles pkgs.discord pkgs.firefox + pkgs.gamescope pkgs.lutris pkgs.nerdfonts pkgs.noto-fonts-cjk-sans @@ -29,17 +29,15 @@ pkgs.pass pkgs.pavucontrol pkgs.polymc + pkgs.protontricks pkgs.steam pkgs.steam-run + pkgs.sxiv pkgs.thunderbird pkgs.twemoji-color-font - pkgs.xivlauncher - pkgs.sxiv pkgs.veloren-voxygen - pkgs.gamescope - pkgs.wineWowPackages.stagingFull - pkgs.protontricks + #pkgs.xivlauncher ]; home.sessionVariables = { @@ -56,13 +54,13 @@ services.udiskie.enable = true; - services.kdeconnect = { - enable = true; - indicator = true; - }; + # services.kdeconnect = { + # enable = true; + # indicator = true; + # }; services.gammastep = { - enable = true; + enable = false; provider = "geoclue2"; };