Skip to content

Commit

Permalink
nix: commit pin fallback
Browse files Browse the repository at this point in the history
fallbacks to self revision if repo is dirty, or if hyprland is unpinned
  • Loading branch information
howyay committed Sep 4, 2024
1 parent b442578 commit fa56391
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand All @@ -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
Expand Down

0 comments on commit fa56391

Please sign in to comment.