System Gen121 @ 2025-12-12-19:47:19 by jonas@monolith

This commit is contained in:
Jonas Röger 2025-12-12 19:47:19 +01:00
parent 450fc3554c
commit 0b70c63f33
2 changed files with 65 additions and 1 deletions

57
fixes/plasma-fix.nix Normal file
View File

@ -0,0 +1,57 @@
# https://github.com/NixOS/nixpkgs/issues/126590#issuecomment-3194531220
{
config,
pkgs,
lib,
...
}: {
nixpkgs.overlays = lib.singleton (final: prev: {
kdePackages =
prev.kdePackages
// {
plasma-workspace = let
# the package we want to override
basePkg = prev.kdePackages.plasma-workspace;
# a helper package that merges all the XDG_DATA_DIRS into a single directory
xdgdataPkg = pkgs.stdenv.mkDerivation {
name = "${basePkg.name}-xdgdata";
buildInputs = [basePkg];
dontUnpack = true;
dontFixup = true;
dontWrapQtApps = true;
installPhase = ''
mkdir -p $out/share
( IFS=:
for DIR in $XDG_DATA_DIRS; do
if [[ -d "$DIR" ]]; then
cp -r $DIR/. $out/share/
chmod -R u+w $out/share
fi
done
)
'';
};
# undo the XDG_DATA_DIRS injection that is usually done in the qt wrapper
# script and instead inject the path of the above helper package
derivedPkg = basePkg.overrideAttrs {
preFixup = ''
for index in "''${!qtWrapperArgs[@]}"; do
if [[ ''${qtWrapperArgs[$((index+0))]} == "--prefix" ]] && [[ ''${qtWrapperArgs[$((index+1))]} == "XDG_DATA_DIRS" ]]; then
unset -v "qtWrapperArgs[$((index+0))]"
unset -v "qtWrapperArgs[$((index+1))]"
unset -v "qtWrapperArgs[$((index+2))]"
unset -v "qtWrapperArgs[$((index+3))]"
fi
done
qtWrapperArgs=("''${qtWrapperArgs[@]}")
qtWrapperArgs+=(--prefix XDG_DATA_DIRS : "${xdgdataPkg}/share")
qtWrapperArgs+=(--prefix XDG_DATA_DIRS : "$out/share")
'';
};
in
derivedPkg;
};
});
}

View File

@ -85,7 +85,13 @@
isHM = false; isHM = false;
}; };
modules = [ modules = [
({...}: {nixpkgs.overlays = [overlay-unstable self.overlays.default audio.overlays.default];}) ({...}: {
nixpkgs.overlays = [
overlay-unstable
self.overlays.default
audio.overlays.default
];
})
({...}: { ({...}: {
nixpkgs.config.allowUnfree = true; nixpkgs.config.allowUnfree = true;
nixpkgs.config.nvidia.acceptLicense = true; nixpkgs.config.nvidia.acceptLicense = true;
@ -99,6 +105,7 @@
nixos-hardware.nixosModules.lenovo-thinkpad-t14-amd-gen1 nixos-hardware.nixosModules.lenovo-thinkpad-t14-amd-gen1
inputs.sops-nix.nixosModules.sops inputs.sops-nix.nixosModules.sops
nixos-cosmic.nixosModules.default nixos-cosmic.nixosModules.default
./fixes/plasma-fix.nix
./modules ./modules
./hosts/monolith/configuration.nix ./hosts/monolith/configuration.nix
]; ];