From fa766b70278262e1386ee59d6fea7a365109f805 Mon Sep 17 00:00:00 2001 From: Alexander Tomokhov Date: Wed, 22 Nov 2023 09:44:50 +0400 Subject: [PATCH] use git revision as Nix derivation version --- default.nix | 4 ++-- flake.nix | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/default.nix b/default.nix index b1c3e0b..0759fd3 100644 --- a/default.nix +++ b/default.nix @@ -1,8 +1,8 @@ -{ pythonPackages }: +{ pythonPackages, rev ? "local" }: pythonPackages.buildPythonApplication rec { pname = "selfprivacy-graphql-api"; - version = "local"; + version = rev; src = builtins.filterSource (p: t: p != ".git" && t != "symlink") ./.; propagatedBuildInputs = with pythonPackages; [ fastapi diff --git a/flake.nix b/flake.nix index 75391ba..568b7ff 100644 --- a/flake.nix +++ b/flake.nix @@ -9,6 +9,7 @@ pkgs = nixpkgs.legacyPackages.${system}; selfprivacy-graphql-api = pkgs.callPackage ./default.nix { pythonPackages = pkgs.python310Packages; + rev = self.shortRev or self.dirtyShortRev or "dirty"; }; in {