mirror of
https://github.com/hyprwm/hyprlock.git
synced 2024-12-22 21:39:47 +01:00
nix: pass commit info to cmake
This commit is contained in:
parent
ee37e41723
commit
f2c153c09b
3 changed files with 9 additions and 1 deletions
|
@ -40,7 +40,7 @@
|
||||||
overlays = with self.overlays; [default];
|
overlays = with self.overlays; [default];
|
||||||
});
|
});
|
||||||
in {
|
in {
|
||||||
overlays = import ./nix/overlays.nix {inherit inputs lib;};
|
overlays = import ./nix/overlays.nix {inherit inputs lib self;};
|
||||||
|
|
||||||
packages = eachSystem (system: {
|
packages = eachSystem (system: {
|
||||||
default = self.packages.${system}.hyprlock;
|
default = self.packages.${system}.hyprlock;
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
wayland-protocols,
|
wayland-protocols,
|
||||||
wayland-scanner,
|
wayland-scanner,
|
||||||
version ? "git",
|
version ? "git",
|
||||||
|
shortRev ? "",
|
||||||
}:
|
}:
|
||||||
stdenv.mkDerivation {
|
stdenv.mkDerivation {
|
||||||
pname = "hyprlock";
|
pname = "hyprlock";
|
||||||
|
@ -55,6 +56,11 @@ stdenv.mkDerivation {
|
||||||
wayland-protocols
|
wayland-protocols
|
||||||
];
|
];
|
||||||
|
|
||||||
|
cmakeFlags = lib.mapAttrsToList lib.cmakeFeature {
|
||||||
|
HYPRLOCK_COMMIT = shortRev;
|
||||||
|
HYPRLOCK_VERSION_COMMIT = shortRev;
|
||||||
|
};
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
homepage = "https://github.com/hyprwm/hyprlock";
|
homepage = "https://github.com/hyprwm/hyprlock";
|
||||||
description = "A gpu-accelerated screen lock for Hyprland";
|
description = "A gpu-accelerated screen lock for Hyprland";
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
{
|
{
|
||||||
lib,
|
lib,
|
||||||
inputs,
|
inputs,
|
||||||
|
self,
|
||||||
}: let
|
}: let
|
||||||
mkDate = longDate: (lib.concatStringsSep "-" [
|
mkDate = longDate: (lib.concatStringsSep "-" [
|
||||||
(builtins.substring 0 4 longDate)
|
(builtins.substring 0 4 longDate)
|
||||||
|
@ -22,6 +23,7 @@ in {
|
||||||
stdenv = prev.gcc14Stdenv;
|
stdenv = prev.gcc14Stdenv;
|
||||||
version = version + "+date=" + (mkDate (inputs.self.lastModifiedDate or "19700101")) + "_" + (inputs.self.shortRev or "dirty");
|
version = version + "+date=" + (mkDate (inputs.self.lastModifiedDate or "19700101")) + "_" + (inputs.self.shortRev or "dirty");
|
||||||
inherit (final) hyprlang;
|
inherit (final) hyprlang;
|
||||||
|
shortRev = self.sourceInfo.shortRev or "dirty";
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
|
|
Loading…
Reference in a new issue