From 65d3a862bc830864e1f515d00068c8e5a6fcbdee Mon Sep 17 00:00:00 2001 From: a-kenji Date: Wed, 4 Sep 2024 10:59:51 +0200 Subject: [PATCH] Add version specifiers to unstable version --- nix/flake-edit.nix | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/nix/flake-edit.nix b/nix/flake-edit.nix index 91aa70e..6fab2f5 100644 --- a/nix/flake-edit.nix +++ b/nix/flake-edit.nix @@ -9,6 +9,7 @@ let cargoTOML = builtins.fromTOML (builtins.readFile (self + "/Cargo.toml")); inherit (cargoTOML.package) version name; + pname = name; gitDate = "${builtins.substring 0 4 self.lastModifiedDate}-${ builtins.substring 4 2 self.lastModifiedDate }-${builtins.substring 6 2 self.lastModifiedDate}"; @@ -21,8 +22,7 @@ let pkg-config openssl ]; - inherit version name; - pname = name; + inherit version name pname; src = lib.cleanSourceWith { src = craneLib.path ../.; }; }; cargoArtifacts = craneLib.buildDepsOnly commonArgs; @@ -32,7 +32,7 @@ let cargoDoc = craneLib.cargoDoc (commonArgs // { inherit cargoArtifacts; }); cargoTest = craneLib.cargoNextest (commonArgs // { inherit cargoArtifacts; }); assetDir = "target/assets"; - postInstall = name: '' + postInstall = '' # install the manpage installManPage ${assetDir}/${name}.1 # explicit behavior @@ -58,11 +58,15 @@ in ASSET_DIR = assetDir; }; doCheck = false; - version = "unstable-" + gitDate; - pname = "flake-edit"; - name = "flake-edit"; - postInstall = postInstall "flake-edit"; - inherit assetDir cargoArtifacts meta; + version = version + "-unstable-" + gitDate; + inherit + name + pname + postInstall + assetDir + cargoArtifacts + meta + ; } ); inherit