forked from lix-project/nixos-module
Compare commits
7 commits
Author | SHA1 | Date | |
---|---|---|---|
jade | 691193879d | ||
jade | fd186f535a | ||
Fabián Heredia Montiel | 81d9ff97c9 | ||
jade | 7dd3d652a3 | ||
jade | ca0cc16273 | ||
jade | bb51b2d161 | ||
Fabián Heredia Montiel | b3457b78ac |
14
flake.lock
14
flake.lock
|
@ -36,11 +36,11 @@
|
|||
"lix": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1726590994,
|
||||
"narHash": "sha256-CrvIEzBzvvfE7jGIXBv6hSYDxv4eYeHWAwVho5WrF48=",
|
||||
"rev": "8ab5743904a06c78153281bf61b3aa8aa451a489",
|
||||
"lastModified": 1731164513,
|
||||
"narHash": "sha256-WnT6MpgrMKgqV2Rs+MfU88+KO+/njELPOtGoNhoX2oA=",
|
||||
"rev": "b967f1d5fe9d1bf58e6159e9b426c5b341489397",
|
||||
"type": "tarball",
|
||||
"url": "https://git.lix.systems/api/v1/repos/lix-project/lix/archive/8ab5743904a06c78153281bf61b3aa8aa451a489.tar.gz?rev=8ab5743904a06c78153281bf61b3aa8aa451a489"
|
||||
"url": "https://git.lix.systems/api/v1/repos/lix-project/lix/archive/b967f1d5fe9d1bf58e6159e9b426c5b341489397.tar.gz?rev=b967f1d5fe9d1bf58e6159e9b426c5b341489397"
|
||||
},
|
||||
"original": {
|
||||
"type": "tarball",
|
||||
|
@ -49,11 +49,11 @@
|
|||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1726463316,
|
||||
"narHash": "sha256-gI9kkaH0ZjakJOKrdjaI/VbaMEo9qBbSUl93DnU7f4c=",
|
||||
"lastModified": 1730785428,
|
||||
"narHash": "sha256-Zwl8YgTVJTEum+L+0zVAWvXAGbWAuXHax3KzuejaDyo=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "99dc8785f6a0adac95f5e2ab05cc2e1bf666d172",
|
||||
"rev": "4aa36568d413aca0ea84a1684d2d46f55dbabad7",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
{
|
||||
inherit pkgs;
|
||||
packages = {
|
||||
default = pkgs.nixVersions.nix_2_18;
|
||||
default = pkgs.nix;
|
||||
inherit (pkgs) nix-doc nix-eval-jobs;
|
||||
};
|
||||
|
||||
|
@ -57,6 +57,7 @@
|
|||
|
||||
checks = {
|
||||
inherit (self.packages.${system}) default nix-eval-jobs;
|
||||
inherit (pkgs) nixos-option;
|
||||
} // lib.optionalAttrs (lib.elem system linux64BitSystems) {
|
||||
# wrongMajor intentionally not included here since it is expected to fail
|
||||
inherit (self.nixosTests.${system}) it-builds;
|
||||
|
|
42
overlay.nix
42
overlay.nix
|
@ -1,16 +1,13 @@
|
|||
{ lix, 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
|
||||
lixPackageFromSource = final.callPackage (lix + "/package.nix") ({
|
||||
inherit versionSuffix;
|
||||
stdenv = final.clangStdenv;
|
||||
});
|
||||
|
||||
# These packages depend on Nix features that Lix does not support
|
||||
# These packages should receive CppNix since they may link to it or otherwise
|
||||
# cause problems (or even just silly mass-rebuilds) if we give them Lix
|
||||
overridelist_upstream = [
|
||||
"attic-client"
|
||||
"devenv"
|
||||
|
@ -60,12 +57,37 @@ let
|
|||
# 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;
|
||||
|
||||
overlay =
|
||||
# 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 prev.${name}.override {
|
||||
nix = final.nixVersions.stable_upstream;
|
||||
} else prev.${name}
|
||||
) // {
|
||||
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;
|
||||
# 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*
|
||||
|
|
|
@ -1 +1 @@
|
|||
{"nix-eval-jobs": {"kind": "tarball", "rev": "f8869bdcca7c1d5aaf37de3da3a4176811279a57", "nar_hash": "sha256-F/RvI9chHywnckEqHO1ggjzCayknhDnnl2kNnnVXpWg=", "locked_url": "https://git.lix.systems/api/v1/repos/lix-project/nix-eval-jobs/archive/f8869bdcca7c1d5aaf37de3da3a4176811279a57.tar.gz?rev=f8869bdcca7c1d5aaf37de3da3a4176811279a57", "url": "https://git.lix.systems/lix-project/nix-eval-jobs/archive/main.tar.gz"}}
|
||||
{"nix-eval-jobs": {"kind": "tarball", "rev": "57ddb99e781d19704f8a84036f9890e6ca554c41", "nar_hash": "sha256-9qkRZFTgbMonlBaLqL+OW6iiHLWXuBJlThISMhwQuGg=", "locked_url": "https://git.lix.systems/api/v1/repos/lix-project/nix-eval-jobs/archive/57ddb99e781d19704f8a84036f9890e6ca554c41.tar.gz?rev=57ddb99e781d19704f8a84036f9890e6ca554c41", "url": "https://git.lix.systems/lix-project/nix-eval-jobs/archive/main.tar.gz"}}
|
Loading…
Reference in a new issue