Compare commits
6 commits
Author | SHA1 | Date | |
---|---|---|---|
Fabián Heredia Montiel | 2bbdcd73b9 | ||
jade | efbb3769cb | ||
jade | 2b8c2f73ec | ||
jade | 593d825a99 | ||
jade | 31f4f25f6a | ||
jade | 30e488a7d5 |
22
flake.lock
22
flake.lock
|
@ -5,11 +5,11 @@
|
||||||
"systems": "systems"
|
"systems": "systems"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1710146030,
|
"lastModified": 1726560853,
|
||||||
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
|
"narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=",
|
||||||
"owner": "numtide",
|
"owner": "numtide",
|
||||||
"repo": "flake-utils",
|
"repo": "flake-utils",
|
||||||
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
|
"rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -36,24 +36,24 @@
|
||||||
"lix": {
|
"lix": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1723503926,
|
"lastModified": 1729298361,
|
||||||
"narHash": "sha256-Rosl9iA9MybF5Bud4BTAQ9adbY81aGmPfV8dDBGl34s=",
|
"narHash": "sha256-hiGtfzxFkDc9TSYsb96Whg0vnqBVV7CUxyscZNhed0U=",
|
||||||
"rev": "bcaeb6388b8916ac6d1736e3aa2b13313e6a6bd2",
|
"rev": "ad9d06f7838a25beec425ff406fe68721fef73be",
|
||||||
"type": "tarball",
|
"type": "tarball",
|
||||||
"url": "https://git.lix.systems/api/v1/repos/lix-project/lix/archive/bcaeb6388b8916ac6d1736e3aa2b13313e6a6bd2.tar.gz?rev=bcaeb6388b8916ac6d1736e3aa2b13313e6a6bd2"
|
"url": "https://git.lix.systems/api/v1/repos/lix-project/lix/archive/ad9d06f7838a25beec425ff406fe68721fef73be.tar.gz?rev=ad9d06f7838a25beec425ff406fe68721fef73be"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"type": "tarball",
|
"type": "tarball",
|
||||||
"url": "https://git.lix.systems/lix-project/lix/archive/2.91.0.tar.gz"
|
"url": "https://git.lix.systems/lix-project/lix/archive/2.91.1.tar.gz"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1723175592,
|
"lastModified": 1729070438,
|
||||||
"narHash": "sha256-M0xJ3FbDUc4fRZ84dPGx5VvgFsOzds77KiBMW/mMTnI=",
|
"narHash": "sha256-KOTTUfPkugH52avUvXGxvWy8ibKKj4genodIYUED+Kc=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "5e0ca22929f3342b19569b21b2f3462f053e497b",
|
"rev": "5785b6bb5eaae44e627d541023034e1601455827",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||||
inputs.lix = {
|
inputs.lix = {
|
||||||
url = "https://git.lix.systems/lix-project/lix/archive/2.91.0.tar.gz";
|
url = "https://git.lix.systems/lix-project/lix/archive/2.91.1.tar.gz";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
inputs.flake-utils.url = "github:numtide/flake-utils";
|
inputs.flake-utils.url = "github:numtide/flake-utils";
|
||||||
|
@ -47,7 +47,7 @@
|
||||||
{
|
{
|
||||||
inherit pkgs;
|
inherit pkgs;
|
||||||
packages = {
|
packages = {
|
||||||
default = pkgs.nixVersions.nix_2_18;
|
default = pkgs.nix;
|
||||||
inherit (pkgs) nix-doc nix-eval-jobs;
|
inherit (pkgs) nix-doc nix-eval-jobs;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -57,6 +57,7 @@
|
||||||
|
|
||||||
checks = {
|
checks = {
|
||||||
inherit (self.packages.${system}) default nix-eval-jobs;
|
inherit (self.packages.${system}) default nix-eval-jobs;
|
||||||
|
inherit (pkgs) nixos-option;
|
||||||
} // lib.optionalAttrs (lib.elem system linux64BitSystems) {
|
} // lib.optionalAttrs (lib.elem system linux64BitSystems) {
|
||||||
# wrongMajor intentionally not included here since it is expected to fail
|
# wrongMajor intentionally not included here since it is expected to fail
|
||||||
inherit (self.nixosTests.${system}) it-builds;
|
inherit (self.nixosTests.${system}) it-builds;
|
||||||
|
|
55
overlay.nix
55
overlay.nix
|
@ -1,16 +1,13 @@
|
||||||
{ lix, versionSuffix ? "" }:
|
{ lix, versionSuffix ? "" }:
|
||||||
final: prev:
|
final: prev:
|
||||||
let
|
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
|
|
||||||
lixPackageFromSource = final.callPackage (lix + "/package.nix") ({
|
lixPackageFromSource = final.callPackage (lix + "/package.nix") ({
|
||||||
inherit versionSuffix;
|
inherit versionSuffix;
|
||||||
});
|
});
|
||||||
|
|
||||||
# These packages depend on Nix features that Lix does not support
|
# These packages should receive CppNix since they may link to it or otherwise
|
||||||
overridelist_2_18 = [
|
# cause problems (or even just silly mass-rebuilds) if we give them Lix
|
||||||
|
overridelist_upstream = [
|
||||||
"attic-client"
|
"attic-client"
|
||||||
"devenv"
|
"devenv"
|
||||||
"nix-du"
|
"nix-du"
|
||||||
|
@ -20,11 +17,6 @@ let
|
||||||
"nurl"
|
"nurl"
|
||||||
"prefetch-yarn-deps" # force these onto upstream so we are not regularly rebuilding electron
|
"prefetch-yarn-deps" # force these onto upstream so we are not regularly rebuilding electron
|
||||||
];
|
];
|
||||||
override_2_18 = prev.lib.genAttrs overridelist_2_18 (
|
|
||||||
name: prev.${name}.override {
|
|
||||||
nix = final.nixVersions.nix_2_18_upstream;
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
inherit (prev) lib;
|
inherit (prev) lib;
|
||||||
|
|
||||||
|
@ -64,7 +56,37 @@ let
|
||||||
# errors. This is a simple safeguard to put in at least something that might be seen.
|
# errors. This is a simple safeguard to put in at least something that might be seen.
|
||||||
maybeWarnWrongMajor = x: if !(lib.hasPrefix supportedLixMajor lixPackageToUse.version) then builtins.trace wrongMajorWarning x else x;
|
maybeWarnWrongMajor = x: if !(lib.hasPrefix supportedLixMajor lixPackageToUse.version) then builtins.trace wrongMajorWarning x else x;
|
||||||
|
|
||||||
overlay = override_2_18 // {
|
# It is not enough to *just* throw whatever the default nix version is at
|
||||||
|
# anything in the "don't give lix" list, we have to *also* ensure that we
|
||||||
|
# give whatever upstream version as specified in the callPackage invocation.
|
||||||
|
#
|
||||||
|
# Unfortunately I don't think there is any actual way to directly query that,
|
||||||
|
# so we instead do something extremely evil and guess which version it
|
||||||
|
# probably was. This code is not generalizable to arbitrary derivations, so
|
||||||
|
# it will hopefully not make us cry, at least.
|
||||||
|
useCppNixOverlay =
|
||||||
|
lib.genAttrs overridelist_upstream (
|
||||||
|
name:
|
||||||
|
if (lib.functionArgs prev.${name}.override ? "nix") then
|
||||||
|
let
|
||||||
|
# Get the two common inputs of a derivation/package.
|
||||||
|
inputs = prev.${name}.buildInputs ++ prev.${name}.nativeBuildInputs;
|
||||||
|
nixDependency = lib.findFirst
|
||||||
|
(drv: (drv.pname or "") == "nix")
|
||||||
|
final.nixVersions.stable_upstream # default to stable nix if nix is not an input
|
||||||
|
inputs;
|
||||||
|
nixMajor = lib.versions.major (nixDependency.version or "");
|
||||||
|
nixMinor = lib.versions.minor (nixDependency.version or "");
|
||||||
|
nixAttr = "nix_${nixMajor}_${nixMinor}";
|
||||||
|
finalNix = final.nixVersions.${nixAttr};
|
||||||
|
in
|
||||||
|
prev.${name}.override {
|
||||||
|
nix = finalNix;
|
||||||
|
}
|
||||||
|
else prev.${name}
|
||||||
|
);
|
||||||
|
|
||||||
|
overlay = useCppNixOverlay // {
|
||||||
lix-overlay-present = 1;
|
lix-overlay-present = 1;
|
||||||
# used for things that one wouldn't necessarily want to update, but we
|
# used for things that one wouldn't necessarily want to update, but we
|
||||||
# nevertheless shove it in the overlay and fixed-point it in case one *does*
|
# nevertheless shove it in the overlay and fixed-point it in case one *does*
|
||||||
|
@ -73,15 +95,14 @@ let
|
||||||
|
|
||||||
lix = maybeWarnWrongMajor (maybeWarnDuplicate lixPackageToUse);
|
lix = maybeWarnWrongMajor (maybeWarnDuplicate lixPackageToUse);
|
||||||
|
|
||||||
nixVersions = prev.nixVersions // rec {
|
nixVersions = prev.nixVersions // {
|
||||||
nix_2_18 = final.lix;
|
stable = final.lix;
|
||||||
stable = nix_2_18;
|
stable_upstream = prev.nixVersions.stable;
|
||||||
nix_2_18_upstream = prev.nixVersions.nix_2_18;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
nix-eval-jobs = (prev.nix-eval-jobs.override {
|
nix-eval-jobs = (prev.nix-eval-jobs.override {
|
||||||
# lix
|
# lix
|
||||||
nix = final.nixVersions.nix_2_18;
|
nix = final.lix;
|
||||||
}).overrideAttrs (old:
|
}).overrideAttrs (old:
|
||||||
let src = final.lix-sources.nix-eval-jobs;
|
let src = final.lix-sources.nix-eval-jobs;
|
||||||
in {
|
in {
|
||||||
|
|
Loading…
Reference in a new issue