[general, networking] use rtl8821ce driver for bluetooth stuttering fix, enable flatpak, more

Signed-off-by: Jo <johannesreckers2006@gmail.com>
This commit is contained in:
Jo 2024-06-06 12:22:10 +02:00
parent f9343a67b6
commit 674e20233b
6 changed files with 113 additions and 2 deletions

View file

@ -52,6 +52,22 @@
"type": "github"
}
},
"nix-flatpak": {
"locked": {
"lastModified": 1711997201,
"narHash": "sha256-J71xzQlVYsjagA4AsVwRazhBh2rZrPpKvxTgs6UzL7c=",
"owner": "gmodena",
"repo": "nix-flatpak",
"rev": "b76fa31346db7fc958a9898f3c594696ca71c4fd",
"type": "github"
},
"original": {
"owner": "gmodena",
"ref": "v0.4.1",
"repo": "nix-flatpak",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1716509168,
@ -96,6 +112,7 @@
"catppuccin": "catppuccin",
"hardware": "hardware",
"home-manager": "home-manager",
"nix-flatpak": "nix-flatpak",
"nixpkgs": "nixpkgs",
"plasma-manager": "plasma-manager"
}

View file

@ -21,9 +21,11 @@
hardware.url = "github:NixOS/nixos-hardware/master";
catppuccin.url = "github:catppuccin/nix";
nix-flatpak.url = "github:gmodena/nix-flatpak/?ref=v0.4.1";
};
outputs = { self, nixpkgs, home-manager, plasma-manager, hardware, catppuccin, ... } @inputs:
outputs = { self, nixpkgs, home-manager, plasma-manager, hardware, catppuccin, nix-flatpak, ... } @inputs:
let
inherit (self) outputs;
@ -68,6 +70,7 @@
extraSpecialArgs = {inherit inputs outputs;};
modules = [
./users/jo/home.nix
nix-flatpak.homeManagerModules.nix-flatpak
];
};

View file

@ -19,6 +19,21 @@
config = {
allowUnfree = true;
};
overlays = [
(final: prev: {
linuxPackages_latest = prev.linuxPackages_latest.extend (lpfinal: lpprev: {
rtl8821ce = lpprev.rtl8821ce.overrideAttrs ({src, ...}: {
version = "${lpprev.kernel.version}-unstable-2024-03-26";
src = final.fetchFromGitHub {
inherit (src) owner repo;
rev = "f119398d868b1a3395f40c1df2e08b57b2c882cd";
hash = "sha256-EfpKa5ZRBVM5T8EVim3cVX1PP1UM9CyG6tN5Br8zYww=";
};
});
});
})
];
};
nix = {
@ -56,6 +71,15 @@
# Install the latest kernel
boot.kernelPackages = pkgs.linuxPackages_latest;
# Network card driver
boot.extraModulePackages = [
pkgs.linuxPackages_latest.rtl8821ce
];
boot.blacklistedKernelModules = [
"rtw88_8821ce"
];
# Bootloader.
boot.loader.grub = {
enable = true;
@ -130,6 +154,9 @@
services.blueman.enable = true;
# Enable flatpak
services.flatpak.enable = true;
programs.steam = {
remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play
dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server

View file

@ -9,4 +9,8 @@ pkgs: {
gnomeExtensions = {
rounded-window-corners = pkgs.callPackage ./gnomeExtensions/rounded-window-corners.nix { };
};
kernelPackages = {
rtl8821ce = pkgs.callPackage ./kernelPackages/rtl8821ce.nix { };
};
}

View file

@ -0,0 +1,45 @@
{ lib
, stdenv
, fetchFromGitHub
, kernel
, bc
}:
stdenv.mkDerivation rec {
pname = "rtl8821ce";
version = "${kernel.version}-unstable-2024-03-26";
src = fetchFromGitHub {
owner = "tomaspinho";
repo = "rtl8821ce";
rev = "f119398d868b1a3395f40c1df2e08b57b2c882cd";
hash = "sha256-EfpKa5ZRBVM5T8EVim3cVX1PP1UM9CyG6tN5Br8zYww=";
};
hardeningDisable = [ "pic" ];
nativeBuildInputs = [ bc ] ++ kernel.moduleBuildDependencies;
makeFlags = kernel.makeFlags;
prePatch = ''
substituteInPlace ./Makefile \
--replace /lib/modules/ "${kernel.dev}/lib/modules/" \
--replace /sbin/depmod \# \
--replace '$(MODDESTDIR)' "$out/lib/modules/${kernel.modDirVersion}/kernel/net/wireless/"
'';
preInstall = ''
mkdir -p "$out/lib/modules/${kernel.modDirVersion}/kernel/net/wireless/"
'';
enableParallelBuilding = true;
meta = with lib; {
description = "Realtek rtl8821ce driver";
homepage = "https://github.com/tomaspinho/rtl8821ce";
license = licenses.gpl2Only;
platforms = platforms.linux;
maintainers = with maintainers; [ hhm ivar ];
broken = stdenv.isAarch64 || ((lib.versions.majorMinor kernel.version) == "5.4" && kernel.isHardened);
};
}

View file

@ -27,6 +27,17 @@
homeDirectory = "/home/jo";
};
# Flatpak packages
services.flatpak = {
enable = true;
update.auto.enable = true;
uninstallUnmanaged = true;
packages = [
"com.jeffser.Alpaca"
];
};
# General packages
home.packages = with pkgs; [
qflipper
@ -34,18 +45,22 @@
vesktop
lunar-client
steam
g4music
# For development
avra
avrdude
vscodium
jetbrains.phpstorm
git
nodejs_22
bun
# Work stuff for when I'm not actually working
teams-for-linux
enpass
# Notes and Organisation
obsidian
];
# Enable home-manager