Skip to content

Commit

Permalink
chore: add deprecation warning to packages
Browse files Browse the repository at this point in the history
sway/hypr packages will emit a warning and build wlroots feature
  • Loading branch information
VTimofeenko committed Jul 20, 2024
1 parent c6ccf60 commit 2d79d04
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions overlay/default.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# Overlay file that contains the definition of building a package
{ xremap, craneLib, ... }:
{
xremap,
craneLib,
pkgs,
...
}:
let
inherit (pkgs) lib;
commonArgs = {
src = xremap;
strictDeps = true;
Expand Down Expand Up @@ -30,15 +36,24 @@ let
meta.mainProgram = "xremap";
}
);

mkUpstreamDeprecatedNote =
feature:
lib.warn
''
Xremap: upstream has deprecated feature '${feature}' in favor of 'wlroots'.
The package will be built with 'wlroots' but in future release of the Nix flake this will turn into an error.''
(packageWithFeature "wlroots");
in
rec {
# No features
default = xremap;
xremap = packageWithFeature null;
xremap-wlroots = packageWithFeature "wlroots";
xremap-sway = packageWithFeature "sway";
xremap-sway = mkUpstreamDeprecatedNote "sway";
xremap-gnome = packageWithFeature "gnome";
xremap-x11 = packageWithFeature "x11";
xremap-hypr = packageWithFeature "hypr";
xremap-hypr = mkUpstreamDeprecatedNote "hypr";
xremap-kde = packageWithFeature "kde";
}

0 comments on commit 2d79d04

Please sign in to comment.