Compare commits

...

2 Commits

Author SHA1 Message Date
timd 2f03595e5e
Merge 846fcd3683 into f2dc48d92f 2024-06-28 18:53:59 +02:00
Timothy DeHerrera 846fcd3683
nix: fix build by deferring submodule fetching
Currently, it isn't possible to fetch submodules on `inputs.self` of a
Nix flake. As a workaround, use `builtins.fetchGit` with `self.rev` of
the current checkout to include submodules.

This implementation defers submodule fetching to build time instead of
before the flake evaluation begins, which would be the case if it were
possible to specify submodule fetching in the `inputs` of `self` as with
other inputs. This way, when interacting with the other outputs of the
flake, the cost of fetching submodules is avoided.
2024-06-20 19:04:18 -06:00
2 changed files with 12 additions and 1 deletions

View File

@ -1,4 +1,5 @@
{
self,
lib,
stdenv,
pkg-config,
@ -68,7 +69,16 @@ assert lib.assertMsg (!hidpiXWayland) "The option `hidpiXWayland` has been remov
baseName = baseNameOf (toString name);
in
! (lib.hasSuffix ".nix" baseName);
src = lib.cleanSource ../.;
src = lib.cleanSource (
if self ? rev
then builtins.fetchGit {
url = "https://github.com/hyprwm/Hyprland";
inherit (self) rev;
submodules = true;
allRefs = true;
}
else ../.
);
};
postPatch = ''

View File

@ -36,6 +36,7 @@ in {
version = "${props.version}+date=${date}_${self.shortRev or "dirty"}";
commit = self.rev or "";
inherit date;
inherit (inputs) self;
};
hyprland-unwrapped = final.hyprland.override {wrapRuntimeDeps = false;};
hyprland-debug = final.hyprland.override {debug = true;};