Compare commits
No commits in common. "main" and "main" have entirely different histories.
20
flake.lock
20
flake.lock
|
@ -5,11 +5,11 @@
|
|||
"systems": "systems"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1731533236,
|
||||
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
|
||||
"lastModified": 1726560853,
|
||||
"narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
|
||||
"rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -36,11 +36,11 @@
|
|||
"lix": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1733448312,
|
||||
"narHash": "sha256-id5U81bzXk/Lg900nGLM4CQb0wmTdzIvQz7CZk2OcTM=",
|
||||
"rev": "2a9e560570982a91937d199af3e7b7a8f3cbe14b",
|
||||
"lastModified": 1726590994,
|
||||
"narHash": "sha256-CrvIEzBzvvfE7jGIXBv6hSYDxv4eYeHWAwVho5WrF48=",
|
||||
"rev": "8ab5743904a06c78153281bf61b3aa8aa451a489",
|
||||
"type": "tarball",
|
||||
"url": "https://git.lix.systems/api/v1/repos/lix-project/lix/archive/2a9e560570982a91937d199af3e7b7a8f3cbe14b.tar.gz?rev=2a9e560570982a91937d199af3e7b7a8f3cbe14b"
|
||||
"url": "https://git.lix.systems/api/v1/repos/lix-project/lix/archive/8ab5743904a06c78153281bf61b3aa8aa451a489.tar.gz?rev=8ab5743904a06c78153281bf61b3aa8aa451a489"
|
||||
},
|
||||
"original": {
|
||||
"type": "tarball",
|
||||
|
@ -49,11 +49,11 @@
|
|||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1733392399,
|
||||
"narHash": "sha256-kEsTJTUQfQFIJOcLYFt/RvNxIK653ZkTBIs4DG+cBns=",
|
||||
"lastModified": 1726463316,
|
||||
"narHash": "sha256-gI9kkaH0ZjakJOKrdjaI/VbaMEo9qBbSUl93DnU7f4c=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "d0797a04b81caeae77bcff10a9dde78bc17f5661",
|
||||
"rev": "99dc8785f6a0adac95f5e2ab05cc2e1bf666d172",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
{
|
||||
inherit pkgs;
|
||||
packages = {
|
||||
default = pkgs.nix;
|
||||
default = pkgs.nixVersions.nix_2_18;
|
||||
inherit (pkgs) nix-doc nix-eval-jobs;
|
||||
};
|
||||
|
||||
|
@ -57,7 +57,6 @@
|
|||
|
||||
checks = {
|
||||
inherit (self.packages.${system}) default nix-eval-jobs;
|
||||
inherit (pkgs) nixos-option nix-doc nixd nixt;
|
||||
} // lib.optionalAttrs (lib.elem system linux64BitSystems) {
|
||||
# wrongMajor intentionally not included here since it is expected to fail
|
||||
inherit (self.nixosTests.${system}) it-builds;
|
||||
|
|
64
nix-doc/package.nix
Normal file
64
nix-doc/package.nix
Normal file
|
@ -0,0 +1,64 @@
|
|||
# Temporary replacement of the nix-doc package with
|
||||
# https://github.com/NixOS/nixpkgs/pull/296523 so that we can have working Lix
|
||||
# with nix-doc on 23.11 and 24.05-pre
|
||||
#
|
||||
# Can be removed when that commit is in 23.11 and 24.05-pre, or 24.05 is
|
||||
# released with the commit.
|
||||
{ lib
|
||||
, stdenv
|
||||
, rustPlatform
|
||||
, fetchFromGitHub
|
||||
, boost
|
||||
, nix
|
||||
, pkg-config
|
||||
# Whether to build the nix-doc plugin for Nix
|
||||
, withPlugin ? true
|
||||
}:
|
||||
|
||||
let
|
||||
packageFlags = [ "-p" "nix-doc" ] ++ lib.optionals withPlugin [ "-p" "nix-doc-plugin" ];
|
||||
in
|
||||
rustPlatform.buildRustPackage rec {
|
||||
pname = "nix-doc";
|
||||
version = "0.6.5";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
rev = "v${version}";
|
||||
owner = "lf-";
|
||||
repo = "nix-doc";
|
||||
sha256 = "sha256-9cuNzq+CBA2jz0LkZb7lh/WISIlKklfovGBAbSo1Mgk=";
|
||||
};
|
||||
|
||||
doCheck = true;
|
||||
buildInputs = lib.optionals withPlugin [ boost nix ];
|
||||
|
||||
nativeBuildInputs = lib.optionals withPlugin [ pkg-config nix ];
|
||||
|
||||
cargoBuildFlags = packageFlags;
|
||||
cargoTestFlags = packageFlags;
|
||||
|
||||
# Packaging support for making the nix-doc plugin load cleanly as a no-op on
|
||||
# the wrong Nix version (disabling bindnow permits loading libraries
|
||||
# requiring unavailable symbols if they are unreached)
|
||||
hardeningDisable = lib.optionals withPlugin [ "bindnow" ];
|
||||
# Due to a Rust bug, setting -Z relro-level to anything including "off" on
|
||||
# macOS will cause link errors
|
||||
env = lib.optionalAttrs (withPlugin && stdenv.isLinux) {
|
||||
# nix-doc does not use nightly features, however, there is no other way to
|
||||
# set relro-level
|
||||
RUSTC_BOOTSTRAP = 1;
|
||||
RUSTFLAGS = "-Z relro-level=partial";
|
||||
};
|
||||
|
||||
cargoSha256 = "sha256-CHagzXTG9AfrFd3WmHanQ+YddMgmVxSuB8vK98A1Mlw=";
|
||||
|
||||
meta = with lib; {
|
||||
description = "An interactive Nix documentation tool";
|
||||
longDescription = "An interactive Nix documentation tool providing a CLI for function search, a Nix plugin for docs in the REPL, and a ctags implementation for Nix script";
|
||||
homepage = "https://github.com/lf-/nix-doc";
|
||||
license = licenses.lgpl3Plus;
|
||||
maintainers = [ maintainers.lf- ];
|
||||
platforms = platforms.unix;
|
||||
mainProgram = "nix-doc";
|
||||
};
|
||||
}
|
46
overlay.nix
46
overlay.nix
|
@ -1,22 +1,23 @@
|
|||
{ 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 should receive CppNix since they may link to it or otherwise
|
||||
# cause problems (or even just silly mass-rebuilds) if we give them Lix
|
||||
# These packages depend on Nix features that Lix does not support
|
||||
overridelist_upstream = [
|
||||
"attic-client"
|
||||
"devenv"
|
||||
"nix-du"
|
||||
"nix-init"
|
||||
"nix-prefetch-git"
|
||||
"nixd"
|
||||
"nixos-option"
|
||||
"nixt"
|
||||
"nurl"
|
||||
"prefetch-yarn-deps" # force these onto upstream so we are not regularly rebuilding electron
|
||||
];
|
||||
|
@ -59,37 +60,12 @@ 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;
|
||||
|
||||
# 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 =
|
||||
overlay =
|
||||
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 // {
|
||||
name: if (lib.functionArgs prev.${name}.override ? "nix") then prev.${name}.override {
|
||||
nix = final.nixVersions.stable_upstream;
|
||||
} else prev.${name}
|
||||
) // {
|
||||
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*
|
||||
|
@ -120,7 +96,7 @@ let
|
|||
}
|
||||
);
|
||||
|
||||
nix-doc = prev.nix-doc.override { withPlugin = false; };
|
||||
nix-doc = prev.callPackage ./nix-doc/package.nix { withPlugin = false; };
|
||||
};
|
||||
in
|
||||
# Make the overlay idempotent, since flakes passing nixos modules around by
|
||||
|
|
|
@ -1 +1 @@
|
|||
{"nix-eval-jobs": {"kind": "tarball", "rev": "df3edf37301cdc77ca5bd5f3f6fcccd6d0befee5", "nar_hash": "sha256-KpKmFgcUGQlAWhLUHyBn3AnTJLp7Kt82q2Cxfp3Yf44=", "locked_url": "https://git.lix.systems/api/v1/repos/lix-project/nix-eval-jobs/archive/df3edf37301cdc77ca5bd5f3f6fcccd6d0befee5.tar.gz?rev=df3edf37301cdc77ca5bd5f3f6fcccd6d0befee5", "url": "https://git.lix.systems/lix-project/nix-eval-jobs/archive/main.tar.gz"}}
|
||||
{"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"}}
|
Loading…
Reference in a new issue