proton-ge and other stuff

This commit is contained in:
chayleaf 2023-02-13 21:56:34 +07:00
parent 43e00a5481
commit b7bf0a19c8
10 changed files with 107 additions and 16 deletions

View file

@ -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"
}
}

View file

@ -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=";
};
};
}

View file

@ -131,6 +131,6 @@
home.packages = with pkgs; [ home.packages = with pkgs; [
rclone sshfs fuse rclone sshfs fuse
jq python3Full killall jq python3Full killall
appimage-run comma appimage-run comma nvfetcher
]; ];
} }

View file

@ -181,7 +181,7 @@ in
exec i3 exec i3
''; '';
xsession.initExtra = '' 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 [ home.packages = with pkgs; if config.wayland.windowManager.sway.enable then [
wl-clipboard wl-clipboard
@ -189,14 +189,25 @@ in
xdg-desktop-portal-wlr xdg-desktop-portal-wlr
xdg-desktop-portal-gtk xdg-desktop-portal-gtk
] else []; ] else [];
services.playerctld.enable = true;
programs.waybar = { programs.waybar = {
enable = true; enable = true;
package = pkgs.waybar.override { withMediaPlayer = true; };
settings = [{ settings = [{
layer = "bottom"; layer = "bottom";
# position = "bottom"; # position = "bottom";
ipc = true; ipc = true;
height = 40; 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} <i>{title}</i>";
player-icons = {
default = "";
mpd = "🎵";
};
status-icons.paused = "";
};
"sway/workspaces" = { "sway/workspaces" = {
disable-scroll = true; disable-scroll = true;
format = "{value}{icon}"; format = "{value}{icon}";
@ -232,7 +243,7 @@ in
"(.*) - KeePassXC" = "$1"; "(.*) - KeePassXC" = "$1";
}; };
}; };
modules-right = [ "memory" "tray" "wireplumber" "clock" "sway/language" ]; modules-right = [ "mpris" "wireplumber" "clock" "sway/language" ];
cpu = { cpu = {
# format = "{usage}% "; # format = "{usage}% ";
format = "{icon0}{icon1}{icon2}{icon3}{icon4}{icon5}{icon6}{icon7}{icon8}{icon9}{icon10}{icon11}{icon12}{icon13}{icon14}{icon15}"; format = "{icon0}{icon1}{icon2}{icon3}{icon4}{icon5}{icon6}{icon7}{icon8}{icon9}{icon10}{icon11}{icon12}{icon13}{icon14}{icon15}";
@ -367,7 +378,7 @@ in
input = { input = {
"*" = { "*" = {
xkb_layout = "jp,ru"; 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; }; in swayConfig // commonConfig // swayConfig;
@ -378,9 +389,12 @@ in
export QT_WAYLAND_DISABLE_WINDOWDECORATION=1 export QT_WAYLAND_DISABLE_WINDOWDECORATION=1
export QT_QPA_PLATFORMTHEME=gnome export QT_QPA_PLATFORMTHEME=gnome
export MOZ_ENABLE_WAYLAND=1 export MOZ_ENABLE_WAYLAND=1
export GDK_BACKEND=wayland export GDK_BACKEND=wayland,x11
export GTK_USE_PORTAL=1 export GTK_USE_PORTAL=1
export XDG_CURRENT_DESKTOP=sway 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" '' services.swayidle = let swaylock-start = builtins.toString (with pkgs; writeScript "swaylock-start" ''

View file

@ -6,15 +6,17 @@
package = pkgs.neovim-unwrapped; package = pkgs.neovim-unwrapped;
extraPackages = with pkgs; [ extraPackages = with pkgs; [
rust-analyzer rust-analyzer
nodePackages.bash-language-server shellcheck nodePackages_latest.bash-language-server shellcheck
nodePackages.typescript-language-server nodePackages_latest.typescript-language-server
nodePackages_latest.svelte-language-server
clang-tools clang-tools
nodePackages.vscode-langservers-extracted nodePackages_latest.vscode-langservers-extracted
nil nil
marksman marksman
taplo taplo
python3Packages.python-lsp-server
]; ];
extraPython3Packages = pyPkgs: with pyPkgs; [ python-lsp-server ]; # extraPython3Packages = pyPkgs: with pyPkgs; [ python-lsp-server ];
extraConfig = '' extraConfig = ''
autocmd BufReadPost * if @% !~# '\.git[\/\\]COMMIT_EDITMSG$' && line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g`\"" | endif autocmd BufReadPost * if @% !~# '\.git[\/\\]COMMIT_EDITMSG$' && line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g`\"" | endif
syntax on syntax on
@ -25,13 +27,13 @@
vimAlias = true; vimAlias = true;
vimdiffAlias = true; vimdiffAlias = true;
plugins = plugins =
# TODO make pure
let lua = (s: '' let lua = (s: ''
lua << EOF lua << EOF
${s} ${s}
EOF EOF
''); '');
in with pkgs.vimPlugins; [ in with pkgs.vimPlugins; [
vim-svelte
# TODO remove on next nvim update (0.8.3/0.9) # TODO remove on next nvim update (0.8.3/0.9)
vim-nix vim-nix
{ plugin = nvim-web-devicons; { plugin = nvim-web-devicons;
@ -137,7 +139,11 @@
flags = lsp_flags, flags = lsp_flags,
capabilities = capabilities, capabilities = capabilities,
} }
-- todo completion require'lspconfig'.svelte.setup{
on_attach = on_attach,
flags = lsp_flags,
capabilities = capabilities,
}
require'lspconfig'.html.setup{ require'lspconfig'.html.setup{
on_attach = on_attach, on_attach = on_attach,
flags = lsp_flags, flags = lsp_flags,

View file

@ -28,6 +28,7 @@
programs.ncmpcpp = { programs.ncmpcpp = {
enable = true; enable = true;
}; };
services.kdeconnect.enable = true;
nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
"steam-run" "steam-run"
"steam" "steam"
@ -35,6 +36,19 @@
"steam-runtime" "steam-runtime"
"steamcmd" "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; [ home.packages = with pkgs; [
steam-run steam steam-run steam
easyeffects easyeffects

3
home/nvfetcher.toml Normal file
View file

@ -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"

View file

@ -108,7 +108,7 @@
extraModprobeConfig = let ivshmemConfig = if enableIvshmem then '' extraModprobeConfig = let ivshmemConfig = if enableIvshmem then ''
options kvmfr static_size_mb=${lib.concatStringsSep "," (map (x: toString x.size) cfg.lookingGlass.ivshmem)} options kvmfr static_size_mb=${lib.concatStringsSep "," (map (x: toString x.size) cfg.lookingGlass.ivshmem)}
'' else ""; in '' '' else ""; in ''
options vfio-pci ids=${gpuIDs} options vfio-pci ids=${gpuIDs} disable_idle_d3=1
options kvm ignore_msrs=1 options kvm ignore_msrs=1
${ivshmemConfig} ${ivshmemConfig}
''; '';

View file

@ -50,6 +50,9 @@
hw.common-pc-laptop # enables tlp hw.common-pc-laptop # enables tlp
(getPriv "nixmsi") (getPriv "nixmsi")
]; ];
extraArgs = {
inherit nixpkgs;
};
}; };
}; };
}; };

View file

@ -1,4 +1,4 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, nixpkgs, ... }:
let let
efiPart = "/dev/disk/by-uuid/D77D-8CE0"; efiPart = "/dev/disk/by-uuid/D77D-8CE0";
@ -63,8 +63,29 @@ in {
"vm.dirty_background_ratio" = 2; "vm.dirty_background_ratio" = 2;
"vm.swappiness" = 40; "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"; nixpkgs.config.allowUnfreePredicate = pkg: (lib.getName pkg) == "steam-original";
hardware = { hardware = {
steam-hardware.enable = true; steam-hardware.enable = true;
@ -201,7 +222,8 @@ in {
# from nix-gaming # from nix-gaming
lowLatency = { lowLatency = {
enable = true; enable = true;
quantum = 64; # 96 is mostly fine but has just a little xruns
quantum = 128;
rate = 48000; rate = 48000;
}; };
}; };