From a537be487b1b8b3eaac646648ab6679f2f988fc4 Mon Sep 17 00:00:00 2001 From: crop Date: Sun, 21 Jul 2024 20:15:55 +0200 Subject: [PATCH] Allow use of lix from nixpkgs Change behaviour of module. Allow not specifying LixSrc and provide fallback to nixpkgs.pkgs.lix --- module.nix | 4 ++-- overlay.nix | 18 +++++++++++------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/module.nix b/module.nix index 5e7f1bf..8aec7e0 100644 --- a/module.nix +++ b/module.nix @@ -1,5 +1,5 @@ -{ lix, versionSuffix ? "" }: +{ lixSrc ? null, versionSuffix ? "" }: { pkgs, config, ... }: { - nixpkgs.overlays = [ (import ./overlay.nix { inherit lix versionSuffix; }) ]; + nixpkgs.overlays = [ (import ./overlay.nix { inherit lixSrc versionSuffix; }) ]; } diff --git a/overlay.nix b/overlay.nix index ec76bb2..95b74bf 100644 --- a/overlay.nix +++ b/overlay.nix @@ -1,16 +1,20 @@ -{ lix, versionSuffix ? "" }: +{ lixSrc ? null, versionSuffix ? "" }: final: prev: let # This is kind of scary to not override the nix version to pretend to be # 2.18 since nixpkgs can introduce new breakage in its Nix unstable CLI # usage. # https://github.com/nixos/nixpkgs/blob/6afb255d976f85f3359e4929abd6f5149c323a02/nixos/modules/config/nix.nix#L121 - lixPkg = final.callPackage (lix + "/package.nix") ({ - versionSuffix = "-${versionSuffix}"; - # FIXME: do this more sensibly for future releases - # https://git.lix.systems/lix-project/lix/issues/406 - officialRelease = false; - }); + lixPkg = + if lixSrc == null + then prev.pkgs.lix + else + final.callPackage (lixSrc + "/package.nix") ({ + versionSuffix = "-${versionSuffix}"; + # FIXME: do this more sensibly for future releases + # https://git.lix.systems/lix-project/lix/issues/406 + officialRelease = false; + }); # These packages depend on Nix features that Lix does not support overridelist_2_18 = [