From 4e2bb71ed58e19352f0059867b2b65362700eb62 Mon Sep 17 00:00:00 2001 From: Oleks Date: Thu, 23 Apr 2026 20:18:35 +0300 Subject: [PATCH] feat: add xontribs, hyprspace, and gcc15-fixes overlay - packages/xontribs.nix: xontrib-prompt-starship, -broot, -term-integrations wheels for use with `programs.xonsh.extraPackages` (or xonsh.override) - packages/hyprspace.nix + hyprspace flake input (flake=false): rebuild plugin against the consumer's hyprland; exposed via overlays.hyprspace - overlays/gcc15-fixes.nix: hotdoc/kitty/libsecret/xdg-desktop-portal/afdko workarounds so fleet nodes on the same pin can opt in with one line - flake.nix: lift overlays out of eachSystem to the root (overlays.default was previously nested per-system, which doesn't match flake schema) --- flake.lock | 18 +++++++++++++++ flake.nix | 47 +++++++++++++++++++++++++++++++++------- overlays/gcc15-fixes.nix | 43 ++++++++++++++++++++++++++++++++++++ packages/hyprspace.nix | 22 +++++++++++++++++++ packages/xontribs.nix | 43 ++++++++++++++++++++++++++++++++++++ 5 files changed, 165 insertions(+), 8 deletions(-) create mode 100644 overlays/gcc15-fixes.nix create mode 100644 packages/hyprspace.nix create mode 100644 packages/xontribs.nix diff --git a/flake.lock b/flake.lock index 5c140de..7ad58e4 100644 --- a/flake.lock +++ b/flake.lock @@ -69,6 +69,23 @@ "url": "https://git.oleks.space/oleks/fleet-pins" } }, + "hyprspace": { + "flake": false, + "locked": { + "lastModified": 1764820995, + "narHash": "sha256-IMa4mvkF0w7OAy+yEzPFYs2an332K30lf5qfUOAS9Cw=", + "owner": "KZDKM", + "repo": "Hyprspace", + "rev": "0467be86b18cfc324fab04afbd40fe9ef80f7fa9", + "type": "github" + }, + "original": { + "owner": "KZDKM", + "repo": "Hyprspace", + "rev": "0467be86b18cfc324fab04afbd40fe9ef80f7fa9", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1771848320, @@ -89,6 +106,7 @@ "inputs": { "flake-utils": "flake-utils", "fleet-pins": "fleet-pins", + "hyprspace": "hyprspace", "nixpkgs": [ "fleet-pins", "nixpkgs-projects" diff --git a/flake.nix b/flake.nix index ad6346b..b57225a 100644 --- a/flake.nix +++ b/flake.nix @@ -5,6 +5,13 @@ fleet-pins.url = "git+https://git.oleks.space/oleks/fleet-pins?ref=main"; nixpkgs.follows = "fleet-pins/nixpkgs-projects"; flake-utils.url = "github:numtide/flake-utils"; + + # Hyprspace source; no flake.nix in the repo so we consume it as raw src. + # Pin tracks the last v0.52-compatible commit of Hyprspace. + hyprspace = { + url = "github:KZDKM/Hyprspace/0467be86b18cfc324fab04afbd40fe9ef80f7fa9"; + flake = false; + }; }; outputs = @@ -13,6 +20,7 @@ nixpkgs, fleet-pins, flake-utils, + hyprspace, ... }: let @@ -27,13 +35,33 @@ "s390x-linux" = "s390x-linux"; }; - mkPackages = pkgs: { - hello-world = pkgs.callPackage ./packages/hello-world.nix { }; - geesefs = pkgs.callPackage ./packages/geesefs.nix { }; - xonsh = pkgs.callPackage ./packages/xonsh.nix { - xonsh-unwrapped = import ./packages/xonsh-unwrapped.nix { - inherit (pkgs) lib python3Packages fetchFromGitHub; + mkPackages = + pkgs: + let + xontribs = import ./packages/xontribs.nix { + inherit (pkgs) python3Packages fetchurl; }; + in + { + hello-world = pkgs.callPackage ./packages/hello-world.nix { }; + geesefs = pkgs.callPackage ./packages/geesefs.nix { }; + xonsh = pkgs.callPackage ./packages/xonsh.nix { + xonsh-unwrapped = import ./packages/xonsh-unwrapped.nix { + inherit (pkgs) lib python3Packages fetchFromGitHub; + }; + }; + } + # Xontribs: pass into `programs.xonsh.extraPackages` or + # `pkgs.xonsh.override { extraPackages = ps: [...]; }`. + // xontribs; + + # Overlay providing Hyprspace. Requires `pkgs.hyprland` to be present + # (consumer applies the Hyprland flake's overlay first). Kept out of + # `mkPackages` because standalone `nix build .#hyprspace` has no + # Hyprland in scope. + hyprspaceOverlay = final: _prev: { + hyprspace = final.callPackage ./packages/hyprspace.nix { + src = hyprspace; }; }; @@ -127,8 +155,6 @@ default = packages.hello-world; }; - overlays.default = final: prev: mkPackages final; - devShells.default = pkgs.mkShell { name = "oleks-hub-shell"; buildInputs = [ self.packages.${system}.default ]; @@ -196,5 +222,10 @@ native // { packages = (native.packages or { }) // cross; + overlays = { + default = final: _prev: mkPackages final; + gcc15-fixes = import ./overlays/gcc15-fixes.nix; + hyprspace = hyprspaceOverlay; + }; }; } diff --git a/overlays/gcc15-fixes.nix b/overlays/gcc15-fixes.nix new file mode 100644 index 0000000..355beb6 --- /dev/null +++ b/overlays/gcc15-fixes.nix @@ -0,0 +1,43 @@ +# Narrow fixes for packages that fail under the fleet's pinned nixpkgs +# with GCC 15 / current upstream breakage. Remove entries as upstream fixes +# land so consumers can drop them on the next pin bump. +final: prev: { + # hotdoc's bundled cmark declares `project(cmark VERSION 0.28.3)` without + # LANGUAGES, which makes CMake probe CXX; GCC 15 fails the probe. Adding + # LANGUAGES C skips the CXX check. + hotdoc = prev.hotdoc.overrideAttrs (old: { + postPatch = (old.postPatch or "") + '' + substituteInPlace cmark/CMakeLists.txt \ + --replace-fail "project(cmark VERSION 0.28.3)" "project(cmark VERSION 0.28.3 LANGUAGES C)" + ''; + }); + + # kitty's bundled base64 lib has incompatible pointer types that GCC 15 + # promotes from warning to error. + kitty = prev.kitty.overrideAttrs (old: { + env = (old.env or { }) // { + NIX_CFLAGS_COMPILE = (old.env.NIX_CFLAGS_COMPILE or "") + " -Wno-error=incompatible-pointer-types"; + }; + }); + + # Skip D-Bus-dependent checks that fail under remote-builder sandboxes. + libsecret = prev.libsecret.overrideAttrs (_: { + doCheck = false; + }); + xdg-desktop-portal = prev.xdg-desktop-portal.overrideAttrs (_: { + doCheck = false; + }); + + # afdko has two pre-existing test failures that block + # nototools → noto-fonts-color-emoji. + pythonPackagesExtensions = (prev.pythonPackagesExtensions or [ ]) ++ [ + (pyFinal: pyPrev: { + afdko = pyPrev.afdko.overrideAttrs (old: { + disabledTests = (old.disabledTests or [ ]) ++ [ + "test_non_varying_glyphs_bug356" + "test_ufo_contentsplist_parsing" + ]; + }); + }) + ]; +} diff --git a/packages/hyprspace.nix b/packages/hyprspace.nix new file mode 100644 index 0000000..31cf57b --- /dev/null +++ b/packages/hyprspace.nix @@ -0,0 +1,22 @@ +# Rebuilds the Hyprspace plugin against the consumer's Hyprland. Requires +# `pkgs.hyprland` to already be in scope (consumers apply the upstream +# Hyprland flake overlay first). `src` comes from the hyprspace flake +# input pinned in ../flake.nix. +{ + gcc14Stdenv, + hyprland, + src, +}: + +gcc14Stdenv.mkDerivation { + pname = "Hyprspace"; + version = "unstable-${src.shortRev or "dirty"}"; + inherit src; + inherit (hyprland) nativeBuildInputs; + buildInputs = [ hyprland ] ++ hyprland.buildInputs; + dontUseCmakeConfigure = true; + installFlags = [ "PREFIX=$(out)" ]; + postInstall = '' + mv $out/lib/Hyprspace.so $out/lib/libHyprspace.so + ''; +} diff --git a/packages/xontribs.nix b/packages/xontribs.nix new file mode 100644 index 0000000..63d60bb --- /dev/null +++ b/packages/xontribs.nix @@ -0,0 +1,43 @@ +{ + python3Packages, + fetchurl, +}: + +let + mkWheel = + { + pname, + version, + url, + sha256, + }: + python3Packages.buildPythonPackage { + inherit pname version; + src = fetchurl { inherit url sha256; }; + format = "wheel"; + doCheck = false; + dontCheckRuntimeDeps = true; + }; +in +{ + xontrib-prompt-starship = mkWheel { + pname = "xontrib-prompt-starship"; + version = "0.3.7"; + url = "https://files.pythonhosted.org/packages/94/71/968450a151d003bb80ed6fbfb190f22cfac076cbd4442dc58b48c5545644/xontrib_prompt_starship-0.3.7-py3-none-any.whl"; + sha256 = "12a213fc454c9547c6426d19c4a43982be48500019378267bdab465d0749dccd"; + }; + + xontrib-broot = mkWheel { + pname = "xontrib-broot"; + version = "0.2.1"; + url = "https://files.pythonhosted.org/packages/a8/97/a595ef322a40bcfaf885af8538d48cd0c506b8e06e3834458909c6b9bf90/xontrib_broot-0.2.1-py3-none-any.whl"; + sha256 = "5eee2af0740fcc0355937b1365a15bcfebbe7c045215f0a597a519ce05cca96f"; + }; + + xontrib-term-integrations = mkWheel { + pname = "xontrib-term-integrations"; + version = "0.2.0"; + url = "https://files.pythonhosted.org/packages/0e/df/76f0d98fb67267124f498b0da6b598939e85d5ef9aad49c3476929395ea0/xontrib_term_integrations-0.2.0-py3-none-any.whl"; + sha256 = "cc55f4a1885361349d1a5a39aa6f44abc080e318355335bc14e7ea28c5b30776"; + }; +}