From fa56391bbcf262cab7a0fe30c3719c1a1d27d8c1 Mon Sep 17 00:00:00 2001 From: howyay <28365438+howyay@users.noreply.github.com> Date: Wed, 4 Sep 2024 17:02:37 +0800 Subject: [PATCH] nix: commit pin fallback fallbacks to self revision if repo is dirty, or if hyprland is unpinned --- flake.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.nix b/flake.nix index 92f17f7..70a6369 100644 --- a/flake.nix +++ b/flake.nix @@ -40,7 +40,7 @@ ]); rawCommitPins = (builtins.fromTOML (builtins.readFile ./hyprpm.toml)).repository.commit_pins; commitPins = builtins.listToAttrs (map (p: { name = builtins.head p; value = builtins.elemAt p 1;}) rawCommitPins); - selfRev = commitPins.${hyprland.rev}; + selfRev = "${substring 0 7 commitPins.${hyprland.rev} or "git"}"; version = "date=${mkDate (self.lastModifiedDate or "19700101")}_${self.shortRev or "dirty"}_${selfRev}"; in { @@ -54,10 +54,10 @@ hyprscroller = pkgs.stdenv.mkDerivation { pname = "hyprscroller"; inherit version; - src = builtins.fetchGit { + src = if (commitPins ? ${hyprland.rev}) && (self ? rev) then (builtins.fetchGit { url = "https://github.com/dawsers/hyprscroller"; rev = selfRev; - }; + }) else ./.; nativeBuildInputs = [ pkgs.cmake