mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-26 08:45:58 +01:00
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.
This commit is contained in:
parent
fabc30df52
commit
846fcd3683
2 changed files with 12 additions and 1 deletions
|
@ -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 = ''
|
||||
|
|
|
@ -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;};
|
||||
|
|
Loading…
Reference in a new issue