fix: use the official-release bit from the Lix sources to skip versionSuffix

I wrote that json file intending to use it for this and then forgot. lol
oops.
This commit is contained in:
jade 2024-08-12 17:57:09 -07:00
parent e350380d72
commit 1c291723b9
2 changed files with 12 additions and 7 deletions

View file

@ -8,8 +8,12 @@
inputs.flakey-profile.url = "github:lf-/flakey-profile";
outputs = inputs@{ self, nixpkgs, lix, flake-utils, flakey-profile, ... }:
let versionSuffix = "pre${builtins.substring 0 8 lix.lastModifiedDate}-${lix.shortRev or lix.dirtyShortRev}";
in {
let
lixVersionJson = builtins.fromJSON (builtins.readFile (lix + "/version.json"));
versionSuffix = nixpkgs.lib.optionalString (!lixVersionJson.official_release)
"-pre${builtins.substring 0 8 lix.lastModifiedDate}-${lix.shortRev or lix.dirtyShortRev}";
in
{
inherit inputs;
nixosModules = {
# Use a locally built Lix

View file

@ -6,7 +6,7 @@ let
# usage.
# https://github.com/nixos/nixpkgs/blob/6afb255d976f85f3359e4929abd6f5149c323a02/nixos/modules/config/nix.nix#L121
lixPackageFromSource = final.callPackage (lix + "/package.nix") ({
versionSuffix = "-${versionSuffix}";
inherit versionSuffix;
});
# These packages depend on Nix features that Lix does not support
@ -23,7 +23,8 @@ let
override_2_18 = prev.lib.genAttrs overridelist_2_18 (
name: prev.${name}.override {
nix = final.nixVersions.nix_2_18_upstream;
});
}
);
inherit (prev) lib;
@ -56,7 +57,7 @@ let
maybeWarnDuplicate = x: if final.lix-overlay-present > 1 then builtins.trace warning x else x;
versionJson = builtins.fromJSON (builtins.readFile ./version.json);
supportedLixMajor = builtins.elemAt (builtins.match ''^([[:digit:]]+\.[[:digit:]]+)\..*'' versionJson.version) 0;
supportedLixMajor = lib.versions.majorMinor versionJson.version;
lixPackageToUse = if lix != null then lixPackageFromSource else prev.lix;
# Especially if using Lix from nixpkgs, it is plausible that the overlay
# could be used against the wrong Lix major version and cause confusing build
@ -98,7 +99,7 @@ let
nix-doc = prev.callPackage ./nix-doc/package.nix { withPlugin = false; };
};
in
# Make the overlay idempotent, since flakes passing nixos modules around by
# Make the overlay idempotent, since flakes passing nixos modules around by
# value and many other things make it way too easy to include the overlay
# twice
if (prev ? lix-overlay-present) then { lix-overlay-present = 2; } else overlay
if (prev ? lix-overlay-present) then { lix-overlay-present = 2; } else overlay