forked from lix-project/nixos-module
use nixpkgs.lix if no LixSrc provided
This commit is contained in:
parent
d70318fb94
commit
c35345038e
|
@ -1,5 +1,5 @@
|
||||||
{ lix, versionSuffix ? "" }:
|
{ lixSrc ? null, versionSuffix ? "" }:
|
||||||
{ pkgs, config, ... }:
|
{ pkgs, config, ... }:
|
||||||
{
|
{
|
||||||
nixpkgs.overlays = [ (import ./overlay.nix { inherit lix versionSuffix; }) ];
|
nixpkgs.overlays = [ (import ./overlay.nix { inherit lixSrc versionSuffix; }) ];
|
||||||
}
|
}
|
||||||
|
|
25
overlay.nix
25
overlay.nix
|
@ -1,16 +1,20 @@
|
||||||
{ lix, versionSuffix ? "" }:
|
{ lixSrc ? null, versionSuffix ? "" }:
|
||||||
final: prev:
|
final: prev:
|
||||||
let
|
let
|
||||||
# This is kind of scary to not override the nix version to pretend to be
|
# 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
|
# 2.18 since nixpkgs can introduce new breakage in its Nix unstable CLI
|
||||||
# usage.
|
# usage.
|
||||||
# https://github.com/nixos/nixpkgs/blob/6afb255d976f85f3359e4929abd6f5149c323a02/nixos/modules/config/nix.nix#L121
|
# https://github.com/nixos/nixpkgs/blob/6afb255d976f85f3359e4929abd6f5149c323a02/nixos/modules/config/nix.nix#L121
|
||||||
lixPkg = final.callPackage (lix + "/package.nix") ({
|
lixPkg =
|
||||||
versionSuffix = "-${versionSuffix}";
|
if lixSrc == null
|
||||||
# FIXME: do this more sensibly for future releases
|
then prev.pkgs.lix
|
||||||
# https://git.lix.systems/lix-project/lix/issues/406
|
else
|
||||||
officialRelease = false;
|
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
|
# These packages depend on Nix features that Lix does not support
|
||||||
overridelist_2_18 = [
|
overridelist_2_18 = [
|
||||||
|
@ -26,7 +30,8 @@ let
|
||||||
override_2_18 = prev.lib.genAttrs overridelist_2_18 (
|
override_2_18 = prev.lib.genAttrs overridelist_2_18 (
|
||||||
name: prev.${name}.override {
|
name: prev.${name}.override {
|
||||||
nix = final.nixVersions.nix_2_18_upstream;
|
nix = final.nixVersions.nix_2_18_upstream;
|
||||||
});
|
}
|
||||||
|
);
|
||||||
|
|
||||||
warning = ''
|
warning = ''
|
||||||
warning: You have the lix overlay included into a nixpkgs import twice,
|
warning: You have the lix overlay included into a nixpkgs import twice,
|
||||||
|
@ -81,7 +86,7 @@ let
|
||||||
pegtl = prev.callPackage ./pegtl.nix { };
|
pegtl = prev.callPackage ./pegtl.nix { };
|
||||||
};
|
};
|
||||||
in
|
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
|
# value and many other things make it way too easy to include the overlay
|
||||||
# twice
|
# 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
|
||||||
|
|
Loading…
Reference in a new issue