From 1f62998065f7460d94ef2689f023d6bc6ec85ee9 Mon Sep 17 00:00:00 2001 From: LavaDesu Date: Thu, 13 May 2021 20:31:05 +0700 Subject: [PATCH] split custom kernel into overlay also bump to 5.11.20 and add features thing so nix knows it has 32-bit emulation also added winesync --- cfg/winter/kernel.nix | 42 +-------------------- cfg/winter/main.nix | 1 + flake.nix | 1 + {cfg/winter => overlays}/kernel.config | 1 + overlays/linux.nix | 51 ++++++++++++++++++++++++++ 5 files changed, 55 insertions(+), 41 deletions(-) rename {cfg/winter => overlays}/kernel.config (99%) create mode 100644 overlays/linux.nix diff --git a/cfg/winter/kernel.nix b/cfg/winter/kernel.nix index 2d58bc0..1e1c77f 100644 --- a/cfg/winter/kernel.nix +++ b/cfg/winter/kernel.nix @@ -21,46 +21,6 @@ "radeon.si_support=0" "intel_pstate=passive" ]; - kernelPackages = pkgs.linuxPackagesFor (pkgs.linuxManualConfig { - inherit (pkgs) lib stdenv; - #stdenv = pkgs.ccacheStdenv; - version = "5.11.19-lqx-Lava"; - allowImportFromDerivation = true; - configfile = ./kernel.config; - isZen = true; - - src = builtins.fetchurl { - url = "https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.11.tar.xz"; - sha256 = "1d37w0zvmf8c1l99xvy1hy6p55icjhmbsv7f0amxy2nly1a7pw04"; - }; - kernelPatches = [ - { - name = "19-lqx1"; - patch = builtins.fetchurl { - url = "https://github.com/zen-kernel/zen-kernel/releases/download/v5.11.19-lqx1/v5.11.19-lqx1.patch.xz"; - sha256 = "15js72w0fnikdmiwhnh3ks3gdbdsng7zjhriirxbdkj3k1y8r7va"; - }; - } - { - name = "amd"; - patch = builtins.fetchurl { - url = "https://gist.githubusercontent.com/LavaDesu/98997b93ced7337ef3b6b12c4fc4d9dd/raw/7fe92260c2af90a405ff4c3153707a12664d8dd2/0001-Lava-s-amdgpu-patches.patch"; - sha256 = "09vf2scckw2blw75ggyjqk432x33vym6qyjhy61w5zpbgmm75lql"; - }; - } - { - name = "no-extver"; - patch = builtins.fetchurl { - url = "https://gist.githubusercontent.com/LavaDesu/98997b93ced7337ef3b6b12c4fc4d9dd/raw/7fe92260c2af90a405ff4c3153707a12664d8dd2/0001-Remove-EXTRAVERSION.patch"; - sha256 = "0yc1knzn5nq4dw0n3x0467rv4rdh9pmfz593w1cy5n642ivm8lac"; - }; - } - ]; - }); + kernelPackages = pkgs.linux-lava; }; - # programs.ccache = { - # enable = true; - # cacheDir = "/var/cache/ccache"; - # packageNames = ["dummy"]; - # }; } diff --git a/cfg/winter/main.nix b/cfg/winter/main.nix index 39cb188..80e0a5f 100644 --- a/cfg/winter/main.nix +++ b/cfg/winter/main.nix @@ -17,6 +17,7 @@ ''; }; nixpkgs.overlays = with overlays; [ + linux polybar picom ]; diff --git a/flake.nix b/flake.nix index 0765d5a..2aa0ae5 100644 --- a/flake.nix +++ b/flake.nix @@ -12,6 +12,7 @@ nix.registry.nixpkgs.flake = nixpkgs; }; overlays = { + linux = import ./overlays/linux.nix; picom = import ./overlays/picom.nix; polybar = import ./overlays/polybar.nix; }; diff --git a/cfg/winter/kernel.config b/overlays/kernel.config similarity index 99% rename from cfg/winter/kernel.config rename to overlays/kernel.config index 974eac6..c161227 100644 --- a/cfg/winter/kernel.config +++ b/overlays/kernel.config @@ -19,6 +19,7 @@ CONFIG_THREAD_INFO_IN_TASK=y # # General setup # +CONFIG_WINESYNC=m CONFIG_SCHED_MUQSS=y CONFIG_ZEN_INTERACTIVE=y CONFIG_INIT_ENV_ARG_LIMIT=32 diff --git a/overlays/linux.nix b/overlays/linux.nix new file mode 100644 index 0000000..cb34bc8 --- /dev/null +++ b/overlays/linux.nix @@ -0,0 +1,51 @@ +self: super: { + linux-lava = super.linuxPackagesFor ((super.linuxManualConfig { + inherit (super) lib stdenv; + version = "5.11.20-lqx-Lava"; + allowImportFromDerivation = true; + configfile = ./kernel.config; + isZen = true; + + src = builtins.fetchurl { + url = "https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.11.tar.xz"; + sha256 = "1d37w0zvmf8c1l99xvy1hy6p55icjhmbsv7f0amxy2nly1a7pw04"; + }; + kernelPatches = [ + { + name = "20-lqx1"; + patch = builtins.fetchurl { + url = "https://github.com/zen-kernel/zen-kernel/releases/download/v5.11.20-lqx1/v5.11.20-lqx1.patch.xz"; + sha256 = "0ff6w8xr3v85gqmdg0qk04hf34rnz4dkvd8xxyvkw78dkjfm4aqm"; + }; + } + { + name = "amd"; + patch = builtins.fetchurl { + url = "https://gist.githubusercontent.com/LavaDesu/98997b93ced7337ef3b6b12c4fc4d9dd/raw/7fe92260c2af90a405ff4c3153707a12664d8dd2/0001-Lava-s-amdgpu-patches.patch"; + sha256 = "09vf2scckw2blw75ggyjqk432x33vym6qyjhy61w5zpbgmm75lql"; + }; + } + { + name = "no-extver"; + patch = builtins.fetchurl { + url = "https://gist.githubusercontent.com/LavaDesu/98997b93ced7337ef3b6b12c4fc4d9dd/raw/89778e6256bc224abca16943c18f2f961286b941/0001-Remove-EXTRAVERSION.patch"; + sha256 = "03rrl1dns9r0nq0qmlmxazi4rxgrbflxzzgr1hmlp75ypcy9izyv"; + }; + } + { + name = "winesync"; + patch = builtins.fetchurl { + url = "https://raw.githubusercontent.com/Frogging-Family/linux-tkg/master/linux-tkg-patches/5.11/0007-v5.11-winesync.patch"; + sha256 = "0lf374ccxhhr8idb8kbpzxzw7pi4s4ghdvnffp4pd6q56qs5j86j"; + }; + } + ]; + }).overrideAttrs(o: { + passthru = o.passthru // { + features = { + efiBootStub = true; + ia32Emulation = true; + }; + }; + })); +}