From b7bf0a19c841a11348932c08b1900616b1f33f99 Mon Sep 17 00:00:00 2001 From: chayleaf Date: Mon, 13 Feb 2023 21:56:34 +0700 Subject: [PATCH] proton-ge and other stuff --- home/_sources/generated.json | 17 +++++++++++++++++ home/_sources/generated.nix | 12 ++++++++++++ home/common/general.nix | 2 +- home/common/i3-sway.nix | 24 +++++++++++++++++++----- home/common/vim.nix | 18 ++++++++++++------ home/hosts/nixmsi.nix | 14 ++++++++++++++ home/nvfetcher.toml | 3 +++ system/common/vfio.nix | 2 +- system/flake.nix | 3 +++ system/hosts/nixmsi.nix | 28 +++++++++++++++++++++++++--- 10 files changed, 107 insertions(+), 16 deletions(-) create mode 100644 home/_sources/generated.json create mode 100644 home/_sources/generated.nix create mode 100644 home/nvfetcher.toml diff --git a/home/_sources/generated.json b/home/_sources/generated.json new file mode 100644 index 0000000..f3c2fc0 --- /dev/null +++ b/home/_sources/generated.json @@ -0,0 +1,17 @@ +{ + "proton-ge": { + "cargoLocks": null, + "date": null, + "extract": null, + "name": "proton-ge", + "passthru": null, + "pinned": false, + "src": { + "name": null, + "sha256": "sha256-T+7R+zFMd0yQ0v7/WGym2kzMMulUmATS/LCEQS8whiw=", + "type": "url", + "url": "https://github.com/GloriousEggroll/proton-ge-custom/releases/download/GE-Proton7-49/GE-Proton7-49.tar.gz" + }, + "version": "GE-Proton7-49" + } +} \ No newline at end of file diff --git a/home/_sources/generated.nix b/home/_sources/generated.nix new file mode 100644 index 0000000..b8722f6 --- /dev/null +++ b/home/_sources/generated.nix @@ -0,0 +1,12 @@ +# This file was generated by nvfetcher, please do not modify it manually. +{ fetchgit, fetchurl, fetchFromGitHub, dockerTools }: +{ + proton-ge = { + pname = "proton-ge"; + version = "GE-Proton7-49"; + src = fetchurl { + url = "https://github.com/GloriousEggroll/proton-ge-custom/releases/download/GE-Proton7-49/GE-Proton7-49.tar.gz"; + sha256 = "sha256-T+7R+zFMd0yQ0v7/WGym2kzMMulUmATS/LCEQS8whiw="; + }; + }; +} diff --git a/home/common/general.nix b/home/common/general.nix index b289914..d87bf58 100644 --- a/home/common/general.nix +++ b/home/common/general.nix @@ -131,6 +131,6 @@ home.packages = with pkgs; [ rclone sshfs fuse jq python3Full killall - appimage-run comma + appimage-run comma nvfetcher ]; } diff --git a/home/common/i3-sway.nix b/home/common/i3-sway.nix index 952d6ce..a96a446 100644 --- a/home/common/i3-sway.nix +++ b/home/common/i3-sway.nix @@ -181,7 +181,7 @@ in exec i3 ''; xsession.initExtra = '' - setxkbmap -layout jp,ru -option caps:swapescape,compose:menu,grp:win_space_toggle + setxkbmap -layout jp,ru -option compose:ralt,grp:win_space_toggle ''; home.packages = with pkgs; if config.wayland.windowManager.sway.enable then [ wl-clipboard @@ -189,14 +189,25 @@ in xdg-desktop-portal-wlr xdg-desktop-portal-gtk ] else []; + services.playerctld.enable = true; programs.waybar = { enable = true; + package = pkgs.waybar.override { withMediaPlayer = true; }; settings = [{ layer = "bottom"; # position = "bottom"; ipc = true; height = 40; - modules-left = [ "cpu" "sway/workspaces" "sway/mode" ]; + modules-left = [ "tray" "cpu" "memory" "sway/workspaces" "sway/mode" ]; + mpris = { + format = "{player_icon} {title}"; + format-paused = "{status_icon} {title}"; + player-icons = { + default = "▶"; + mpd = "🎵"; + }; + status-icons.paused = "⏸"; + }; "sway/workspaces" = { disable-scroll = true; format = "{value}{icon}"; @@ -232,7 +243,7 @@ in "(.*) - KeePassXC" = "$1"; }; }; - modules-right = [ "memory" "tray" "wireplumber" "clock" "sway/language" ]; + modules-right = [ "mpris" "wireplumber" "clock" "sway/language" ]; cpu = { # format = "{usage}% "; format = " {icon0}{icon1}{icon2}{icon3}{icon4}{icon5}{icon6}{icon7}{icon8}{icon9}{icon10}{icon11}{icon12}{icon13}{icon14}{icon15}"; @@ -367,7 +378,7 @@ in input = { "*" = { xkb_layout = "jp,ru"; - xkb_options = "caps:swapescape,compose:ralt,grp:win_space_toggle"; + xkb_options = "compose:ralt,grp:win_space_toggle"; }; }; }; in swayConfig // commonConfig // swayConfig; @@ -378,9 +389,12 @@ in export QT_WAYLAND_DISABLE_WINDOWDECORATION=1 export QT_QPA_PLATFORMTHEME=gnome export MOZ_ENABLE_WAYLAND=1 - export GDK_BACKEND=wayland + export GDK_BACKEND=wayland,x11 export GTK_USE_PORTAL=1 export XDG_CURRENT_DESKTOP=sway + # SDL3 exists, so i can't really set SDL_DYNAMIC_API + # instead, running apps with SDL_DYNAMIC_API=$SDL2_DYNAMIC_API does the trick + export SDL2_DYNAMIC_API=${pkgs.SDL2.out}/lib/libSDL2.so ''; }; services.swayidle = let swaylock-start = builtins.toString (with pkgs; writeScript "swaylock-start" '' diff --git a/home/common/vim.nix b/home/common/vim.nix index b5e068f..251e76c 100644 --- a/home/common/vim.nix +++ b/home/common/vim.nix @@ -6,15 +6,17 @@ package = pkgs.neovim-unwrapped; extraPackages = with pkgs; [ rust-analyzer - nodePackages.bash-language-server shellcheck - nodePackages.typescript-language-server + nodePackages_latest.bash-language-server shellcheck + nodePackages_latest.typescript-language-server + nodePackages_latest.svelte-language-server clang-tools - nodePackages.vscode-langservers-extracted + nodePackages_latest.vscode-langservers-extracted nil marksman taplo + python3Packages.python-lsp-server ]; - extraPython3Packages = pyPkgs: with pyPkgs; [ python-lsp-server ]; + # extraPython3Packages = pyPkgs: with pyPkgs; [ python-lsp-server ]; extraConfig = '' autocmd BufReadPost * if @% !~# '\.git[\/\\]COMMIT_EDITMSG$' && line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g`\"" | endif syntax on @@ -25,13 +27,13 @@ vimAlias = true; vimdiffAlias = true; plugins = - # TODO make pure let lua = (s: '' lua << EOF ${s} EOF ''); in with pkgs.vimPlugins; [ + vim-svelte # TODO remove on next nvim update (0.8.3/0.9) vim-nix { plugin = nvim-web-devicons; @@ -137,7 +139,11 @@ flags = lsp_flags, capabilities = capabilities, } - -- todo completion + require'lspconfig'.svelte.setup{ + on_attach = on_attach, + flags = lsp_flags, + capabilities = capabilities, + } require'lspconfig'.html.setup{ on_attach = on_attach, flags = lsp_flags, diff --git a/home/hosts/nixmsi.nix b/home/hosts/nixmsi.nix index f01b67f..785f109 100644 --- a/home/hosts/nixmsi.nix +++ b/home/hosts/nixmsi.nix @@ -28,6 +28,7 @@ programs.ncmpcpp = { enable = true; }; + services.kdeconnect.enable = true; nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ "steam-run" "steam" @@ -35,6 +36,19 @@ "steam-runtime" "steamcmd" ]; + home.sessionVariables = let sources = (import ../_sources/generated.nix { + inherit (pkgs) fetchgit fetchurl fetchFromGitHub dockerTools; + }); + proton-ge = pkgs.stdenv.mkDerivation { + inherit (sources.proton-ge) pname version src; + nativeBuildInputs = []; + installPhase = '' + mkdir -p $out + tar -C $out --strip=1 -x -f $src + ''; + }; in { + STEAM_EXTRA_COMPAT_TOOLS_PATHS = "${proton-ge}"; + }; home.packages = with pkgs; [ steam-run steam easyeffects diff --git a/home/nvfetcher.toml b/home/nvfetcher.toml new file mode 100644 index 0000000..9facd71 --- /dev/null +++ b/home/nvfetcher.toml @@ -0,0 +1,3 @@ +[proton-ge] +src.github = "GloriousEggroll/proton-ge-custom" +fetch.url = "https://github.com/GloriousEggroll/proton-ge-custom/releases/download/$ver/$ver.tar.gz" diff --git a/system/common/vfio.nix b/system/common/vfio.nix index c6ab817..5265f60 100644 --- a/system/common/vfio.nix +++ b/system/common/vfio.nix @@ -108,7 +108,7 @@ extraModprobeConfig = let ivshmemConfig = if enableIvshmem then '' options kvmfr static_size_mb=${lib.concatStringsSep "," (map (x: toString x.size) cfg.lookingGlass.ivshmem)} '' else ""; in '' - options vfio-pci ids=${gpuIDs} + options vfio-pci ids=${gpuIDs} disable_idle_d3=1 options kvm ignore_msrs=1 ${ivshmemConfig} ''; diff --git a/system/flake.nix b/system/flake.nix index 7bb99e7..1a6ea5e 100644 --- a/system/flake.nix +++ b/system/flake.nix @@ -50,6 +50,9 @@ hw.common-pc-laptop # enables tlp (getPriv "nixmsi") ]; + extraArgs = { + inherit nixpkgs; + }; }; }; }; diff --git a/system/hosts/nixmsi.nix b/system/hosts/nixmsi.nix index 1fb8991..18fa594 100644 --- a/system/hosts/nixmsi.nix +++ b/system/hosts/nixmsi.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, ... }: +{ config, lib, pkgs, nixpkgs, ... }: let efiPart = "/dev/disk/by-uuid/D77D-8CE0"; @@ -63,8 +63,29 @@ in { "vm.dirty_background_ratio" = 2; "vm.swappiness" = 40; }; - kernelPackages = pkgs.linuxPackages_zen; + kernelPackages = lib.mkDefault pkgs.linuxPackages_zen; }; + # specialisation = let + # zenKernels = pkgs.callPackage "${nixpkgs}/pkgs/os-specific/linux/kernel/zen-kernels.nix"; + # zenKernel = (version: sha256: (zenKernels { + # kernelPatches = [ + # pkgs.linuxKernel.kernelPatches.bridge_stp_helper + # pkgs.linuxKernel.kernelPatches.request_key_helper + # ]; + # argsOverride = { + # src = pkgs.fetchFromGitHub { + # owner = "zen-kernel"; + # repo = "zen-kernel"; + # rev = "v${version}-zen1"; + # inherit sha256; + # }; + # inherit version; + # modDirVersion = lib.versions.pad 3 "${version}-zen1"; + # }; + # }).zen); + # in { + # zen619.configuration.boot.kernelPackages = pkgs.linuxPackagesFor (zenKernel "6.1.9" "0fsmcjsawxr32fxhpp6sgwfwwj8kqymy0rc6vh4qli42fqmwdjgv"); + # }; nixpkgs.config.allowUnfreePredicate = pkg: (lib.getName pkg) == "steam-original"; hardware = { steam-hardware.enable = true; @@ -201,7 +222,8 @@ in { # from nix-gaming lowLatency = { enable = true; - quantum = 64; + # 96 is mostly fine but has just a little xruns + quantum = 128; rate = 48000; }; };