diff --git a/gui/kde.nix b/gui/kde.nix index 9bd6dde..a60a761 100644 --- a/gui/kde.nix +++ b/gui/kde.nix @@ -1,20 +1,21 @@ { config, lib, pkgs, ... }: -with lib; { - options = { kde = { enable = mkEnableOption "Enable KDE desktop."; }; }; +let inherit (pkgs.libsForQt5) callPackage; in { + options = { kde = { enable = lib.mkEnableOption "Enable KDE desktop."; }; }; - config = mkIf config.kde.enable { + config = lib.mkIf config.kde.enable { services.xserver.displayManager.sddm.enable = true; services.xserver.desktopManager.plasma5.enable = true; # Listen for KDE Connect connections on the tailnet networking.firewall.interfaces = { "tailscale0" = { - allowedTCPPorts = range 1714 1764; - allowedUDPPorts = range 1714 1764; + allowedTCPPorts = lib.range 1714 1764; + allowedUDPPorts = lib.range 1714 1764; }; }; environment.systemPackages = with pkgs; [ + (callPackage ../pkgs/tile-gaps.nix { }) akonadi plasma5Packages.akonadiconsole plasma5Packages.akonadi-contacts diff --git a/pkgs/tile-gaps.nix b/pkgs/tile-gaps.nix new file mode 100644 index 0000000..815f2f0 --- /dev/null +++ b/pkgs/tile-gaps.nix @@ -0,0 +1,39 @@ +{ lib, mkDerivation, fetchFromGitHub +, kcoreaddons, kwindowsystem, plasma-framework, systemsettings }: + +mkDerivation rec { + pname = "tile-gaps"; + version = "7.1"; + + src = fetchFromGitHub { + owner = "nclarius"; + repo = "tile-gaps"; + rev = "window-gaps_v${version}"; + sha256 = "sha256-7tW098kP50rQApn0SW538NrJT0YArpkw/njYWavMvLo="; + }; + + buildInputs = [ + kcoreaddons kwindowsystem plasma-framework systemsettings + ]; + + dontBuild = true; + + # 1. --global still installs to $HOME/.local/share so we use --packageroot + # 2. plasmapkg2 doesn't copy metadata.desktop into place, so we do that manually + installPhase = '' + runHook preInstall + + plasmapkg2 --type kwinscript --install ${src} --packageroot $out/share/kwin/scripts + install -Dm644 ${src}/metadata.desktop $out/share/kservices5/tilegaps.desktop + + runHook postInstall + ''; + + meta = with lib; { + description = "Tiling script for kwin"; + license = licenses.gpl3; + maintainers = with maintainers; [ qbit ]; + inherit (src.meta) homepage; + inherit (kwindowsystem.meta) platforms; + }; +}